So I've been looking around for people who have built shared libraries on windows and have run in to a bit of a stumbling block.  I'm able to compile witho<span style="font-family: arial,helvetica,sans-serif;">ut the BUILD_</span>SHARED_LIBS flag but if I put turn the flag on as follows:<br>
<font style="font-family: courier new,monospace;" size="2"><br></font><font style="font-family: courier new,monospace;" size="2">cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_SHARED_LIBS:BOOL=ON ../llvm-2.7</font><br>
<br>Then call:<br><br><span style="font-family: courier new,monospace;">mingw32-make</span><br><br>I get:<br><font style="font-family: courier new,monospace;" size="2">...<br>Linking CXX shared library ..\..\bin\libLLVMSystem.dll<br>
Info: resolving vtable for std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> > by linking to __imp___ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE (auto-import)<br>Info: resolving std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Rep::_S_empty_rep_storage by linking to __imp___ZNSs4_Rep20_S_empty_rep_storageE (auto-import)<br>
Info: resolving vtable for std::basic_streambuf<char, std::char_traits<char> > by linking to __imp___ZTVSt15basic_streambufIcSt11char_traitsIcEE (auto-import)<br>Info: resolving vtable for std::basic_ios<char, std::char_traits<char> > by linking to __imp___ZTVSt9basic_iosIcSt11char_traitsIcEE (auto-import)<br>
Info: resolving VTT for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > by linking to __imp___ZTTSt18basic_stringstreamIcSt11char_traitsIcESaIcEE (auto-import)<br>Info: resolving vtable for std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > by linking to __imp___ZTVSt18basic_stringstreamIcSt11char_traitsIcESaIcEE (auto-import)<br>
Info: resolving vtable for __cxxabiv1::__class_type_info by linking to __imp___ZTVN10__cxxabiv117__class_type_infoE (auto-import)<br>Creating library file: ..\libLLVMSystem.dll.a<br>c:/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.<br>
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.<br>CMakeFiles/LLVMSystem.dir/DynamicLibrary.cpp.obj:DynamicLibrary.cpp:(.text+0x40a): undefined reference to `_imp__EnumerateLoadedModules@12'<br>
CMakeFiles/LLVMSystem.dir/Process.cpp.obj:Process.cpp:(.text+0xbe): undefined reference to `GetProcessMemoryInfo@12'<br>CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x1d9): undefined reference to `_imp__SymSetOptions@4'<br>
CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x1f9): undefined reference to `_imp__SymInitialize@12'<br>CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x221): undefined reference to `_imp__SymGetModuleBase@8'<br>
CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x22b): undefined reference to `_imp__SymFunctionTableAccess@8'<br>CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x26c): undefined reference to `_imp__StackWalk@36'<br>
CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x2de): undefined reference to `_imp__SymGetModuleBase@8'<br>CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x353): undefined reference to `_imp__SymGetSymFromAddr@16'<br>
CMakeFiles/LLVMSystem.dir/Signals.cpp.obj:Signals.cpp:(.text+0x3b9): undefined reference to `_imp__SymGetLineFromAddr@16'<br>collect2: ld returned 1 exit status<br>mingw32-make[2]: *** [bin/libLLVMSystem.dll] Error 1<br>
mingw32-make[1]: *** [lib/System/CMakeFiles/LLVMSystem.dir/all] Error 2<br>mingw32-make: *** [all] Error 2<br></font><br><font>Any help would be greatly appreciated.</font><br>btw: my MinGW gcc is version 4.5.0.<br><br>Thanks,<br>
Kevin<br><br><br>