Linker Error mit gcc und 3rd party .dll



  • Hallo Experten,

    ich wurde hierher verwiesen, weil man sich hier mit Linker-Fehlern auskennen soll.
    Meiner kommt daher, dass ich in MinGW Developer Studio auf ein USB-Gerät zugreifen und dazu Funktionen benutzen will, die in einer vcinpl.dll enthalten sind. Den passenden Header vcinpl.h

    [..]
    EXTERN_C HRESULT VCIAPI vciEnumDeviceOpen( OUT PHANDLE hEnum );
    [..]

    gibt es dazu. Beispielhaft für alle, die danach kommen werden, geht es jetzt um die Funktion vciEnumDeviceOpen().
    MinGW Developer Studio bringt etliche Bibliotheken mit. Sie sind alle nach dem Schema lib????.a benannt. Also habe ich die .dll auch in dieses Format umgewandelt. Die notwendige Moduldefinitionsdatei vcinpl.def schickte mir der Hersteller.
    Nun sagt

    objdump libvcinpl.a -t
    

    dass die gewünschte funktion in der Bibliothek enthalten ist:

    [...]

    dqss00176.o: file format pe-i386

    SYMBOL TABLE:
    [ 0](sec 1)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .text
    [ 1](sec 2)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .data
    [ 2](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .bss
    [ 3](sec 4)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$7
    [ 4](sec 5)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$5
    [ 5](sec 6)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$4
    [ 6](sec 7)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$6
    [ 7](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 _vciEnumDeviceOpen
    [ 8](sec 5)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 __imp__vciEnumDeviceOpen
    [ 9](sec 0)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 __head_libvcinpl_a

    [..]

    dqss00100.o: file format pe-i386

    SYMBOL TABLE:
    [ 0](sec 1)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .text
    [ 1](sec 2)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .data
    [ 2](sec 3)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .bss
    [ 3](sec 4)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$7
    [ 4](sec 5)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$5
    [ 5](sec 6)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$4
    [ 6](sec 7)(fl 0x00)(ty 0)(scl 3) (nx 0) 0x00000000 .idata$6
    [ 7](sec 1)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 __vciEnumDeviceOpen@4
    [ 8](sec 5)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 __imp___vciEnumDeviceOpen@4
    [ 9](sec 0)(fl 0x00)(ty 0)(scl 2) (nx 0) 0x00000000 __head_libvcinpl_a

    [...]

    Aber trotzdem führt der Code

    #include "vcinpl.h"
    
    int main( int argc, char* argp[]){
    	HANDLE hDevice;
    	vciEnumDeviceOpen( &hDevice);
    }
    

    zum Fehler

    --------------------Configuration: CanComm - Debug--------------------
    Linking...
    O:\dev\CanComm\CanComm\Debug\CanCommPanel.o: In function ZN8wxObject19ReservedObjectFunc9Ev': C:\\FuE\\MinGWStudio\\Include\\wx\\window.h.text+0x35 2): undefined reference tovciEnumDeviceOpen@4'
    O:\dev\CanComm\CanComm\Debug\CanCommPanel.o: In function ZN12CanCommPanelC1EP8wxWindowi': O:\\dev\\CanComm\\CanComm\\CanCommPanel.cpp:48: undefined reference tovciEnumDeviceOpen@4'
    collect2: ld returned 1 exit status

    CanComm.exe - 2 error(s), 0 warning(s)

    Was ist nun zu tun, damit ich das USB-Gerät ansprechen kann?

    Mit freundlichem Gruß

    luker


Anmelden zum Antworten