1

I'm trying to build cpp-netlib using cmake from cygwin. However cmake try to find the package without the lib prefix. And -DBoost_USE_STATIC_LIBS=ON won't resolve the problem!

Here is my command line:

cmake ../cpp-netlib-0.9.4/ -DBOOST_ROOT:string=/cygdrive/c/Dev/boost_1_55_0 -DBoost_USE_STATIC_LIBS=ON -DBoost_DEBUG=ON -DBoost_DETAILED_FAILURE_MSG=ON

The searching:

-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:930 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc48-mt-1_55;boost_thread-gcc48-mt;boost_thread-mt-1_55;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:966 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc48-mt-d-1_55;boost_thread-gcc48-mt-d;boost_thread-mt-d-1_55;boost_thread-mt-d;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:930 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-gcc48-mt-1_55;boost_filesystem-gcc48-mt;boost_filesystem-mt-1_55;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:966 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-gcc48-mt-d-1_55;boost_filesystem-gcc48-mt-d;boost_filesystem-mt-d-1_55;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:930 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: boost_program_options-gcc48-mt-1_55;boost_program_options-gcc48-mt;boost_program_options-mt-1_55;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:966 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: boost_program_options-gcc48-mt-d-1_55;boost_program_options-gcc48-mt-d;boost_program_options-mt-d-1_55;boost_program_options-mt-d;boost_program_options-mt;boost_program_options

Here is the full result: http://pastebin.com/ZBfQyWvw.

As you can see in the command line I'm using cpp-netlib 0.9.4 and Boost 1.55.0.

Any hints?

Thank you!

3
  • 1
    Can you give the name and full path of one of the Boost libs which definitely exists on your machine, and which you're expecting CMake to find please? Commented May 29, 2014 at 7:14
  • Yes, sure. The libs are located at C:\Dev\boost_1_55_0\stage\lib (or /cygdrive/c/Dev/boost_1_55_0/stage/lib). The full listing is here: pastebin.com/6uk5pv3s. However I have seen another problem when you ask me it. The libboost files are vc120, and CMake from cpp-netlib is expecting gcc48... Commented May 29, 2014 at 11:00
  • Forgetting cygwin, I downloaded CMake and OpenSSL versions for Windows and built it using command prompt. Everything worked fine now. However I'm having some problems on build the solution. I need to change something on the project or I just need to open the .sln and build? Commented May 29, 2014 at 12:53

1 Answer 1

1

It looks like your Boost libraries have been built with MSVC specified as the compiler (the "-vc120-" in their names is the telltale). With Cygwin, you need to build for Unix variants.

From the note at the top of Boost's build instructions for Windows:

A note to Cygwin and MinGW users

If you plan to use your tools from the Windows command prompt, you're in the right place. If you plan to build from the Cygwin bash shell, you're actually running on a POSIX platform and should follow the instructions for getting started on Unix variants. Other command shells, such as MinGW's MSYS, are not supported—they may or may not work.

You can see that CMake's FindBoost module is doing the right thing; guessing that the compiler is GCC. For example, line 62 of your linked CMake output is:

-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:739 ] guessed _boost_COMPILER = -gcc48

Sign up to request clarification or add additional context in comments.

1 Comment

Perfect, that was my problem. Use CMake and OpenSSL for Windows and build using command prompt fix the issue. Trying to build the solution now but I think it is another topic. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.