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

Failure to compile. Must statically link to boost. #48

Closed
davidgwright opened this issue Apr 6, 2016 · 5 comments
Closed

Failure to compile. Must statically link to boost. #48

davidgwright opened this issue Apr 6, 2016 · 5 comments
Assignees

Comments

@davidgwright
Copy link

Great project by the way.

I am using VS 2015 update 2.

Is it mandatory to have -D Boost_USE_STATIC_LIBS=ON, it was the only way I could get it to compile?

My cmake batch file :

cmake -D BOOST_INCLUDEDIR=C:\Development\ThirdParty\BOOST\boost_1_60_0 -D BOOST_LIBRARYDIR=C:\Development\ThirdParty\BOOST\boost_1_60_0\lib64-msvc-14.0 -D Boost_NO_SYSTEM_PATHS=ON -D Boost_USE_STATIC_LIBS=ON -D Qt5Widgets_DIR=C:\Development\ThirdParty\QT\5.6\msvc2015_64/lib/cmake/Qt5Widgets -G "Visual Studio 14 2015 Win64" .

@mabrarov
Copy link
Owner

mabrarov commented Apr 6, 2016

It is recommended required to explicitly use Boost_USE_STATIC_LIBS=ON in case you want to link against static version of Boost. It is required to link against static Boost libraries in case you want to use static C/C++ runtime (this requirement is specific for Windows platform, I guess). It is not required to use static version of Boost in other cases (but I've never tested with dynamically linked Boost on Windows).
I appreciate if you could share output (console, MSVS) in case you have errors (cmake project generation errors or build errors, etc). There is nothing special in project forcing the way binaries are linked.

@mabrarov
Copy link
Owner

mabrarov commented Apr 6, 2016

I'm using VS 2015 update 2 with static version of Boost C++ Libraries 1.60 and static version of Qt 5.6 also, BTW.

@mabrarov
Copy link
Owner

mabrarov commented Apr 7, 2016

It seems that -D Boost_USE_STATIC_LIBS=OFF is not enough to make Boost autolinking select dynamic libraries instead static (it seems that Boost autolinking almost always selects static libraries).

@mabrarov mabrarov self-assigned this Apr 7, 2016
@mabrarov
Copy link
Owner

mabrarov commented Apr 7, 2016

Fixed cmake project to turn off Boost autolinking in case -D Boost_USE_STATIC_LIBS=ON is not used (by default Boost_USE_STATIC_LIBS is OFF according to FindBoost documentation) in pull request #51.

@mabrarov
Copy link
Owner

mabrarov commented Apr 7, 2016

Tested with Boost 1.60 and MSVS 2015 update 2.

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

No branches or pull requests

2 participants