Author Topic: Installing Asio with Code::blocks  (Read 8540 times)

Offline k_goos

  • Single posting newcomer
  • *
  • Posts: 2
Installing Asio with Code::blocks
« on: March 18, 2012, 02:14:17 pm »
I am trying to install the asio library with Code::Blocks but I will always fail :P

I've downloaded asio at the following link: http://sourceforge.net/projects/asio/files/asio/1.4.8%20%28Stable%29/asio-1.4.8.zip/download

I am using asio-1.4.8

But I think i need to build this library first but that is something that will also not work.

I've somebody can help me please and if you need more information just ask and I will give you.  ;D


I've added to the search directories and then compiler the include folder.

Code:
Quote
#include <asio.hpp>

int main()
{
    return 0;
}

Compiler output:
Quote
-------------- Clean: Debug in Network ---------------

Cleaned "Network - Debug"

-------------- Build: Debug in Network ---------------

Compiling: main.cpp
In file included from ..\..\..\Library\asio-1.4.8\include/asio/basic_datagram_socket.hpp:18,
                 from ..\..\..\Library\asio-1.4.8\include/asio.hpp:18,
                 from C:\Users\Kevin\Desktop\Dropbox\Programming\C++\CodeBlocks\Network\main.cpp:1:
..\..\..\Library\asio-1.4.8\include/asio/detail/config.hpp:14:28: error: boost/config.hpp: No such file or directory
In file included from ..\..\..\Library\asio-1.4.8\include/asio/basic_io_object.hpp:19,
                 from ..\..\..\Library\asio-1.4.8\include/asio/basic_socket.hpp:19,
                 from ..\..\..\Library\asio-1.4.8\include/asio/basic_datagram_socket.hpp:20,
                 from ..\..\..\Library\asio-1.4.8\include/asio.hpp:18,
                 from C:\Users\Kevin\Desktop\Dropbox\Programming\C++\CodeBlocks\Network\main.cpp:1:
..\..\..\Library\asio-1.4.8\include/asio/detail/noncopyable.hpp:19:33: error: boost/noncopyable.hpp: No such file or directory
..\..\..\Library\asio-1.4.8\include/asio/detail/noncopyable.hpp:20:39: error: boost/detail/workaround.hpp: No such file or directory
..\..\..\Library\asio-1.4.8\include/asio/detail/noncopyable.hpp:27:21: error: missing binary operator before token "("
In file included from ..\..\..\Library\asio-1.4.8\include/asio/detail/bind_handler.hpp:19,
                 from ..\..\..\Library\asio-1.4.8\include/asio/detail/wrapped_handler.hpp:18,
                 from ..\..\..\Library\asio-1.4.8\include/asio/io_service.hpp:24,
                 from ..\..\..\Library\asio-1.4.8\include/asio/basic_io_object.hpp:20,
                 from ..\..\..\Library\asio-1.4.8\include/asio/basic_socket.hpp:19,
                 from ..\..\..\Library\asio-1.4.8\include/asio/basic_datagram_socket.hpp:20,
                 from ..\..\..\Library\asio-1.4.8\include/asio.hpp:18,

...

Offline gd_on

  • Lives here!
  • ****
  • Posts: 824
Re: Installing Asio with Code::blocks
« Reply #1 on: March 18, 2012, 04:14:32 pm »
The error message indicates that you need to have boost. Have you installed it ? Are boost includes in your C::B paths ?

gd_on
Windows 11 64 bits (24H2), svn C::B (last version or almost!), wxWidgets 3.2.8 (tests with 3.3), Msys2 Compilers 15.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Installing Asio with Code::blocks
« Reply #2 on: March 18, 2012, 04:43:00 pm »
Most components of Boost have dependencies on at least a few other Boost components.  Because of this, it is likely you will need to install the full Boost library.

Also note that Boost components expect to be found in a "boost" sub-directory; your folder structure should therefore be such that the asio include becomes:
Code
#include <boost/asio.hpp>

Offline k_goos

  • Single posting newcomer
  • *
  • Posts: 2
Re: Installing Asio with Code::blocks
« Reply #3 on: March 18, 2012, 06:34:26 pm »
Oke thank you for the answer but is it possible to install only the parts that are needed from boost
because it is a big library and else my project will become much lager when I release it.
because i only need the asio  ;D

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Installing Asio with Code::blocks
« Reply #4 on: March 18, 2012, 06:52:08 pm »
Oke thank you for the answer but is it possible to install only the parts that are needed from boost
because it is a big library and else my project will become much lager when I release it.
because i only need the asio  ;D
It's surely possible, but it has nothing to do with C::B.

When you registered in this forum, you accepted our forum rules.
One of the rules says, that not C::B related questions are not allowed here.
Please respect this the next time.

Topic locked !