Author Topic: Setting Environment Variables  (Read 8187 times)

mrsharp

  • Guest
Setting Environment Variables
« on: September 04, 2013, 05:21:51 pm »
Hello,

I'm trying to use the cpp-netlib 0.10.1 which requires the Boost library. I have successfully tested my installation of the Boost library with some example code provided by the Boost website. (http://www.boost.org/doc/libs/1_54_0/more/getting_started/unix-variants.html#build-a-simple-program-using-boost) which worked perfectly. I was able to successfully set the search directory under Settings->Compiler and Debugger..->Search Directory allowing the sample code to work. However, when trying to compile the sample code from the cpp-netlib (http://cpp-netlib.org/0.10.1/examples/http/simple_wget.html), it does not compile. The first error I receive is "undefined reference to 'boost::system::generic_category()'.

The tutorial on the cpp-netlib website (http://cpp-netlib.org/0.10.1/getting_started.html#getting-boost) states that I need to set the environment variable BOOST_ROOT to the top directory of the Boost directory. I know where my boost directory is located. I don't know how to create and set this variable and need help in doing this. However, maybe it is the wrong way of going about this and I need some other course of action. My purpose is to use the cpp-netlib library.

I do know there is a plugin Environment Variables, but my understanding is that it sets it for your current focus in C::B. I would like it set globally instead, however.

Also, I noticed that the boost directory (from the Boost library) does not contain a network folder. This folder sits within the 'boost' directory of cpp-netlib. Maybe someone could also explain the reason cpp-netlib would do this. I am a new programmer and this seems overly complicated to do that.

If it helps I have both the Boost library and the cpp-netlib sitting in a ~/Libraries directory.

Thank you!

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Setting Environment Variables
« Reply #1 on: September 04, 2013, 05:29:44 pm »
Quote
I don't know how to create and set this variable and need help in doing this.
In CodeBlocks' Main Menu->Settings->Global variables.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.