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!

rcorreia
  • 549
  • 1
  • 9
  • 27
  • 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? – Fraser May 29 '14 at 07: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: http://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... – rcorreia May 29 '14 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? – rcorreia May 29 '14 at 12:53

1 Answers1

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

Fraser
  • 74,704
  • 20
  • 238
  • 215
  • 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. :) – rcorreia May 29 '14 at 12:59