Re: trying to build a DLL on Windows 7 gcc using 3rd party libraries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




NO, using dll's does not work - see below. Using lib files comes closest but the two routines that I am seeking to link to are not being found (I know they are there, one in each .lib).

So I am not sure why some people are asking me about security. This is NOT an issue here. The only issue is linking (the ld stage of gcc). Security is addressed but it not part of what I am trying to do right now. My last resort is to use the Visual Microsoft suite. I am sure that will work but what is the use of gcc on Microsoft if it fails building one of the most important tools needed - a dynamic link library.

I have compiled all of my functions with a prototype such as

EXPORT(char *) func..

Where in Li/Unix the EXPORT function is nothing so the declaration becomes:
    char * func..
 and I have tried a few variants on the PC - gnu's gcc I tried:
    char * __cdecl func..
       and also tried (after perusing the stdlib.h file)
    _CRTIMP char * __cdecl __MINGW_NOTHROW func..
 (and for the record, Borland's C used to work with)
    char * __export __CDECL func..

However the problem does NOT appear to be with my code declarations (maybe later when it is a .dll - then maybe it will matter). BUT FOR NOW, the problem is getting the functions in the two external libraries to be found (do they need a special prefix declarative too - they are in .h files from the provider now and that used to work with the Borland compiler). I could put in additional externs if that would help in local files (but then they would clash with the include files).

--- here is a try with the dll's (for the record and suggester's of same) 
 
gcc -shared -o vetAdmin.dll udf.o fbclient.dll ib_util.dll -Wl,--export-all-symbols -Wl,--enable-auto-import 
 
fbclient.dll: file not recognized: File format not recognized 
collect2: ld returned 1 exit status 
 
--here is a try using the lib files 
 
gcc -shared -o vetAdmin.dll udf.o fbclient_ms.lib ib_util_ms.lib -Wl,--export-all-symbols -Wl,--enable-auto-import 
 
udf.o:udf.c:(.text+0x1ce): undefined reference to `isc_decode_date@8' 
udf.o:udf.c:(.text+0x205): undefined reference to `ib_util_malloc' 
collect2: ld returned 1 exit status




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux