codebrowser icon indicating copy to clipboard operation
codebrowser copied to clipboard

building errors with msys2/clang

Open fspeech opened this issue 11 years ago • 3 comments

For MinGW I used cmake -G "MSYS Makefiles". I had to add "typedef int uint" and work around realpath (with _fullpath) and mkdir (remove file code) to compile. However I am flummoxed by the linking errors:

C:\alt\msys32\mingw32\bin/../lib\libclangFrontend.a(FrontendAction.o):(.text$_ZN5clang14FrontendAction15BeginInvocationERNS_16CompilerInstanceE[__ZN5clang14FrontendAction15BeginInvocationERNS_16CompilerInstanceE]+0x0): multiple definition of `clang::FrontendAction::BeginInvocation(clang::CompilerInstance&)'
CMakeFiles/codebrowser_generator.dir/objects.a(main.cpp.obj):C:/alt/msys32/mingw32/include\clang/Frontend/FrontendAction.h:73: first defined here

And there are lots of this. Any idea on how to address this?

fspeech avatar Sep 19 '14 18:09 fspeech

Hi,

I have never tried to compile with Windows or MSYS. And I can't support it myself. I have no idea how to solve this linker error. Probably related to the linker flags.

ogoffart avatar Sep 19 '14 21:09 ogoffart

Hi, You are right. This is most likely a tool chain issue not a woboq issue per se. I will close this issue.

fspeech avatar Sep 19 '14 23:09 fspeech

Hi, An update on this issue. I was able to compile using g++ toolchain instead of clang under msys2/mingw. There appears to be a bug in your FIndLLVM.cmake script. Here is what it produces for the LD flags:

-- LLVM LD flags: -LC:\alt\msys32\mingw32/lib-lz -lffi -lncurses -lshell32 -lpsapi -limagehlp -lm

If you squint at it you'd probably notice that that there is a space missing between the -L path and -lz flags. I manually edited my build.make to finish the build, but it would be nice to fix the source (I can see that there is a stripping trailing space function called in there).

fspeech avatar Sep 20 '14 02:09 fspeech