[semi OT] how to link a mingw32 Qt4 app to a msvc6 lib ?
Christian Ehrlicher
Ch.Ehrlicher at gmx.de
Fri Jan 6 22:23:24 CET 2006
Thiago Macieira schrieb:
> Alexander Neundorf wrote:
>
>>#ifdef _MSCVER
>>
>>#define FOO_CALL __stdcall
>>
>>#if defined FOO_EXPORTS
>> #define FOO_DLL_SPEC __declspec(dllexport)
>>#else
>> #define FOO_DLL_SPEC __declspec(dllimport)
>>#endif
>>
>>#else // this was the gcc/linux path:
>> #define FOO_CALL
>> #define FOO_DLL_SPEC
>>#endif
>>
>>FOO_DLL_SPEC int FOO_CALL foo_init();
>>
>>Now I don't know how to define FOO_CALL and FOO_DLL_SPEC with mingw gcc.
>>The library is compiled with the settings as given here, i.e. with
>>__stdcall. Do I have to use them same with mingw gcc ? Does it use the
>>same keywords then ?
>
>
> Make the mingw codepath above be the same as the MS C codepath. I'm not
> sure about __stdcall, though. If gcc chokes on it, remove. But I am sure
> the declspec stuff works on gcc/win32.
When you have problems linking with the msvc import lib - gcc can link
against a dll without a need for an import lib.
When you want to use an import lib, you must create a new one for use
with gcc (http://mingw.org/MinGWiki/index.php/CreateImportLibraries).
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20060106/5f512033/signature.pgp
More information about the Kde-buildsystem
mailing list