Golevka / emacs-clang-complete-async

An emacs plugin to complete C and C++ code using libclang
360 stars 71 forks source link

Link failed on mingw. #14

Open iwonderhow opened 11 years ago

iwonderhow commented 11 years ago

I comile this on mingw, everything goes well, but when begin to link, there're a lot of errors as below:

C:/MinGW/lib/libclang.a(CIndex.o):CIndex.cpp:(.text+0x1bb): undefined reference to llvm::sys::MutexImpl::~MutexImpl()' C:/MinGW/lib/libclang.a(CIndex.o):CIndex.cpp:(.text+0x212): undefined reference toclang::SourceManager::isBeforeInTranslationUnit(clang::SourceLocation, clang::SourceLocation) const' C:/MinGW/lib/libclang.a(CIndex.o):CIndex.cpp:(.text+0x25c): undefined reference to clang::SourceManager::isBeforeInTranslationUnit(clang::SourceLocation, clang::SourceLocation) const' C:/MinGW/lib/libclang.a(CIndex.o):CIndex.cpp:(.text+0x4ae): undefined reference toclang::SourceManager::isBeforeInTranslationUnit(clang::SourceLocation, clang::SourceLocation) const'

Will you fix this problem in the future?

PS: I use clang and llvm version 2.9.

Golevka commented 11 years ago

I haven't tried to compile LLVM/clang on my own, instead I grabbed a precompiled libclang.dll/libclang.lib then tried to link against it and found no problem. Maybe I would try building clang-async upon a local build of libclang later.

bood commented 11 years ago

I would suggest to use the win32 version clang instead:

http://www.ishani.org/web/articles/code/clang-win32/

and then you may compole emacs-clang-complete-async with msvc2012 like this (in src dir):

cl /O2 /TP /Dssize_t=long /DLINE_MAX=255 /ID:\Tools\clang3.3_march2013\include *.c /link /LIBPATH:D:\Tools\clang3.3_march2013\lib libclang.lib /out:..\clang-complete.exe