Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linker errors when building unit tests #44

Closed
refi64 opened this issue Feb 26, 2016 · 6 comments
Closed

Linker errors when building unit tests #44

refi64 opened this issue Feb 26, 2016 · 6 comments
Labels

Comments

@refi64
Copy link
Contributor

refi64 commented Feb 26, 2016

This occurs with both CMake and the Bakefile system I'm working on:

[6/172] Linking CXX executable unit/example01
FAILED: : && /home/ryan/stuff/Downloads/clang+llvm-3.6.0-x86_64-linux-gnu/bin/clang++   -fcolor-diagnostics   unit/CMakeFiles/example01.dir/example01.cpp.o  -o unit/example01  -rdynamic && :
unit/CMakeFiles/example01.dir/example01.cpp.o: In function `mch::vtblmap<mch::type_switch_info>::get(void const*)':
../unit/example01.cpp:(.text._ZN3mch7vtblmapINS_16type_switch_infoEE3getEPKv[_ZN3mch7vtblmapINS_16type_switch_infoEE3getEPKv]+0xd3): undefined reference to `mch::vtblmap<mch::type_switch_info>::update(long)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

This happens when linking pretty much any of the tests.

@solodon4
Copy link
Owner

Yes, that's one of the breaks from the change in include directories I did on Andrzej's request this week. I'll fix these up during the weekend and ping you back.

@solodon4 solodon4 added the bug label Feb 26, 2016
@solodon4
Copy link
Owner

What OS are you on and what compiler/linker versions are you using? On my Mac OS X Yosemite 10.10.5 with CMake 3.5.0 everything builds without issues both with clang and with g++:
cd test
mkdir build-clang
cd build-clang
/Applications/CMake.app/Contents/bin/cmake ..
/Applications/CMake.app/Contents/bin/cmake --build .
cd ..
mkdir build-gcc
cd build-gcc
CC=/usr/local/bin/gcc-4.8 CXX=/usr/local/bin/g++-4.8 /Applications/CMake.app/Contents/bin/cmake -G "Unix Makefiles" ..
/Applications/CMake.app/Contents/bin/cmake --build .
cd ..

@refi64
Copy link
Contributor Author

refi64 commented Feb 29, 2016

@solodon4 I'm on Ubuntu 14.04 with Clang 3.6. Interestingly, it works with GCC, but NOT Clang...

@solodon4
Copy link
Owner

I'll try tomorrow on an Ubuntu VM

@solodon4
Copy link
Owner

This seems to be caused by __builtin_assume in Clang, so I commented out its use for the moment. This is tracked by issue #55 . I was able to successfully build with Clang on Linux on Travis CI VMs, so I was wondering if you can sync up to the tip and check if the issue still repros. Thank you!

@refi64
Copy link
Contributor Author

refi64 commented Mar 20, 2016

@solodon4 Yup, it works now!

@refi64 refi64 closed this as completed Mar 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants