thanks francois. i followed the instructions in the faq but skipped the
sed as i noted there were no leading underscores in the output of
pexports. here's the line for that function from my def file:
$ grep oopen oci.def
also, i've been linking against other export libraries shipped with
mingw (e.g. libodbc32.a) with no problems and notice that their
functions too have a leading underscore:
00000000 b .bss
00000000 d .data
00000000 i .idata$4
00000000 i .idata$5
00000000 i .idata$6
00000000 i .idata$7
00000000 t .text
00000000 I __imp__SQLAllocStmt@...
00000000 T _SQLAllocStmt@...
Francois Ferrand wrote:
>As shown by nm, your DLL only exports a symbol called "_oopen".... Yet, you
>try to call "oopen".
>This is a well known difference between MSVC and MinGW: "MSVC will prefix an
>underscore to __stdcall
>functions while MinGW will not."
>The solution is to remove the underscore. Thus, the pexports line becomes:
> pexports osi.dll | sed "s/^_//" > osi.def
>You can find all this (and more :) in the MinGW FAQ:
>>[mailto:mingw-users-admin@...] On Behalf Of
>>Sent: Monday, April 28, 2003 17:56
>>Subject: [Mingw-users] new mingw user - using dll's
>>i'm a new mingw user and am trying to use a windows dll.
>>i've read all
>>documentation that i could find (FAQ, links, google, etc.) as
>>to exhaust all attempts before posting to this forum. i'm
>>compile an existing linux/oracle oci app for windows using the mingw
>>cross-compiler. the link stage fails with an "unresolved
>>here's how i created the export library:
>> pexports oci.dll > oci.def
>> dlltool -U -d oci.def -l liboci.a
>>you can see from nm that the oopen() function is exported:
>> nm liboci.a
>> 00000000 b .bss
>> 00000000 d .data
>> 00000000 i .idata$4
>> 00000000 i .idata$5
>> 00000000 i .idata$6
>> 00000000 i .idata$7
>> 00000000 t .text
>> U __head_liboci_a
>> 00000000 I __imp__oopen
>> 00000000 T _oopen
>>and here's the failed link:
>> /usr/local/cross-tools/i386-mingw32msvc/bin/gcc -shared -o
>> odbc32.dll -L/home/scott/win/Oracle/Ora81/bin -loci SQLAllocStmt.o
>> SQLAllocStmt.o(.text+0x196):SQLAllocStmt.c: undefined reference to
>>what have i missed?
>>This sf.net email is sponsored by:ThinkGeek
>>Welcome to geek heaven.
>>MinGW-users mailing list
>>You may change your MinGW Account Options or unsubscribe at: