> Clang for now uses "gcc"/"g++" for linking, and uses its runtime 
> libraries libgcc and libstdc++. The way I set this up is to extract 
> the gcc-dw2 and clang-3.1 packages into the same directory. Then 
> everything (C and C++ headers, linker) will be found. binutils etc. 
> are still used, and I believe Clang should be able to link with 
> windres generated objects.
>
> Sorry for not explaining clearer. I was planning on uploading a readme 
> to the SF download pages, but I'm doing too much at once.
>

Much better, the compilation now works smoothly. However there is still 
an issue with linking.

When compiling a DLL (the command is below) from clang-built objects, I 
get linker errors
for all symbols to-be-exported from the DLL.

$ gcc -mwindows -municode -mdll mctrl.def $OBJECTS -o bin/mCtrl.dll 
-lcomctl32 -lole32 -loleaut32 -Wl,--kill-at
Cannot export _DllGetVersion@4: symbol not found
Cannot export _mcButton_Initialize@0: symbol not found
Cannot export _mcButton_Terminate@0: symbol not found
Cannot export _mcCreateDialogIndirectParamA@24: symbol not found
Cannot export _mcCreateDialogIndirectParamW@24: symbol not found
... and many more alike ...

I have tried specifying the export symbols in the sources via 
__declspec(dllexport)
as well as with the .def file and both lead to the same errors.

The same set of objects compiled with gcc and same options is linked 
correctly.

Please note all the symbols-to-be-exported are __stdcall and so far I 
have tried 32bit build only
so I guess the infamous symbol decorations probably play a role in the 
issue.

(Well, I mostly experiment with clang to just get more warnings and code 
analyzes so
it does not bother me right now, but you know...)

Morous


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to