Bonjour;
Voila donc le problème.
J'aimerai à l'aide du logiciel QT créator [windows] réaliser une interface graphique qui permettrait la mise en œuvre d'une carte K8055.
J'injecte le .h d'un dll pour pouvoir l'utiliser dans mon projet QT
je fais un .UI ; je code en conséquence pour pouvoir me connecter;
je compile...
Et évidement je ne vois pas ou est ce que ça coinceundefined reference to `_imp__OpenDevice@4'
error: collect2: ld returned 1 exit status.
Merci de votre aide !
Je n'utilise pour l'instant que la fonction OpenDevice de mon .h
Cordialement.
Code K8055.h :
Code widget.cpp:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30 #ifdef __cplusplus extern "C" { #endif #define FUNCTION __declspec(dllimport) //k8055D FUNCTION long __stdcall OpenDevice(long CardAddress); FUNCTION void __stdcall CloseDevice(); FUNCTION long __stdcall ReadAnalogChannel(long Channel); FUNCTION void __stdcall ReadAllAnalog(long *Data1, long *Data2); FUNCTION void __stdcall OutputAnalogChannel(long Channel, long Data); FUNCTION void __stdcall OutputAllAnalog(long Data1, long Data2); FUNCTION void __stdcall ClearAnalogChannel(long Channel); FUNCTION void __stdcall ClearAllAnalog(); FUNCTION void __stdcall SetAnalogChannel(long Channel); FUNCTION void __stdcall SetAllAnalog(); FUNCTION void __stdcall WriteAllDigital(long Data); FUNCTION void __stdcall ClearDigitalChannel(long Channel); FUNCTION void __stdcall ClearAllDigital(); FUNCTION void __stdcall SetDigitalChannel(long Channel); FUNCTION void __stdcall SetAllDigital(); FUNCTION bool __stdcall ReadDigitalChannel(long Channel); FUNCTION long __stdcall ReadAllDigital(); FUNCTION long __stdcall ReadCounter(long CounterNr); FUNCTION void __stdcall ResetCounter(long CounterNr); FUNCTION void __stdcall SetCounterDebounceTime(long CounterNr, long DebounceTime); #ifdef __cplusplus } #endif
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 #include "widget.h" #include "ui_widget.h" #include "K8055D.h" //le code généré automatiquement void Widget::on_pushButton_clicked() { OpenDevice (0); }
Partager