0

I'm new to CMake and to Boost!

I'm on a mac, so I can't test Boost code on my machine. I have a VM with Ubuntu. I am using JetBrains CLion IDE, which uses CMake to build. I've been unsuccessful with every tutorial I have tried. So, I just decided to make a project that does nothing. I've added the Boost information to the CMakeLists.txt file:

enter image description here


EDIT

Since I really didn't understand the CMakeLists.txt configuration, I learned that I was using one wrong configuration and needed to just remove the set(Boost_LIBRARY_DIR /usr/local/arm/lib) command. Here is a new image of the CORRECT CMakeLists.txt file.

enter image description here

I can't find where Boost_LIBRARIES is getting configured, which might have something to do with my problem. You can see main does nothing but print out "Hello, World!"

enter image description here

Here is the error I get when I try to build:

enter image description here

Patricia
  • 5,019
  • 14
  • 72
  • 152

1 Answers1

1

Boost_LIBRARIES is configured when you call find_package(Boost 1.54 ....)

The line

set (Boost_LIBRARY_DIR /usr/local/arm/lib)

has no impact in your code.

The mac still uses the intel processor, AFAIK, and so would your Ubuntu VM. From the location of your boost libraries it looks like boost was compiled for arm. Do you have other boost libraries installed on your system? Did you install boost yourself?

a

Alain
  • 532
  • 6
  • 15
  • I did install boost myself with a little help from a coworker. Yes, boost was compiled for arm. Is that the issue? How must I compile it in order to get it to work in my VM? – Patricia Apr 09 '15 at 14:44
  • If you mean to compile for arm then you need to indicate so in your CMakeLists.txt file. You can find documentation at http://www.cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html. If not then you can install boost using apt-get. – Alain Apr 09 '15 at 16:25
  • As I said, I'm new to CMake and Boost and C++, for that matter. You were absolutely correct. All I needed to do is to remove the set (Boost_LIBRARY_DIR /usr/local/arm/lib) line. That made it work! :-) – Patricia Apr 09 '15 at 18:58
  • I have a new question if you'd like to try to help. It's here: http://stackoverflow.com/q/29616807/1735836 – Patricia Apr 13 '15 at 23:40
  • Alain - I'm having some linking issues. The question is here: http://stackoverflow.com/q/29638539/1735836 If you're interested!! :-) – Patricia Apr 14 '15 at 22:39