[cfe-dev] LLVM compilation error on MinGW / MSYS (CMake)

Óscar Fuentes ofv at wanadoo.es
Sat Mar 26 07:36:35 PDT 2011


Matthieu Monrocq
<matthieu.monrocq at gmail.com> writes:

> I have the following error when building:
>
> Creating library file: ../../../../lib/libclang.dll.a
> ../../../../lib/libLLVMSupport.a(Signals.cpp.obj):Signals.cpp:(.text+0x48a):
> undefined reference to `_imp__SymSetOptions at 4'
[snip]

Please check if this patch for tools/clang/CMakeLists.txt solves the
problem:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6ebe3c4..a56d074 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -182,11 +182,9 @@ macro(add_clang_library name)
   if (LLVM_COMMON_LIBS)
     target_link_libraries(${name} ${LLVM_COMMON_LIBS})
   endif()
-  if( NOT MINGW )
-    get_system_libs(llvm_system_libs)
-    if( llvm_system_libs )
-      target_link_libraries(${name} ${llvm_system_libs})
-    endif()
+  get_system_libs(llvm_system_libs)
+  if( llvm_system_libs )
+    target_link_libraries(${name} ${llvm_system_libs})
   endif()
   add_dependencies(${name} ClangDiagnosticCommon)
   if(MSVC)





More information about the cfe-dev mailing list