[LLVMdev] Problems linking shared library with __declspec(dllexport)

Óscar Fuentes ofv at wanadoo.es
Sun Oct 11 14:42:50 PDT 2009


Anton Korobeynikov <anton at korobeynikov.info> writes:

>> I am trying to use llvm-gcc to link shared libraries on windows/mingw32.
>> When I try to link libraries that contain functions declared with
>>  __declspec(dllexport) someFunction();
>>
>> I get the link error:
>>
>>  Cannot export _someFunction: symbol not found
> dllexport declspec should be put on the function definition, in this
> example there is nothing to export - dllexport without function body
> is meaningless.

This is not correct.

The compiler remembers the dllexport declspec and when it finds the
definition, it applies it.

It works on MSVC++ and MinGW's gcc.

-- 
Óscar




More information about the llvm-dev mailing list