[Buildroot] C++ Compiling
Yegor Yefremov
yegorslists at googlemail.com
Fri Sep 13 07:08:34 UTC 2013
Hi Ruud,
On Fri, Sep 13, 2013 at 9:00 AM, Ruud Commandeur <RCommandeur at clb.nl> wrote:
> Hi Everyone,
>
> This week I tried build my 1st aplication using boost. Adding the boost
> part was easy from buildroot, but when trying to build the application,
> I get "Relocations in generic ELF" and "could not read symbols: File in
> wrong format".
Have you tried using CMake (http://cmake.org/)? CMake in BR
(http://buildroot.uclibc.org/downloads/manual/manual.html#_infrastructure_for_cmake_based_packages)
This is how you include Boost modules:
# Boost
find_package( Boost 1.36.0 COMPONENTS program_options REQUIRED)
and here you link them:
ADD_EXECUTABLE(test ${SOURCES})
TARGET_LINK_LIBRARIES(test ${Boost_LIBRARIES})
That's it. CMake will check for working C++ compiler at configuring stage.
> Obviously, this has to do with cross-compiling. When compiling a
> C-source, it uses arm-none-linux-gnueabi-gcc. But for a cpp it uses g++,
> resulting in an Intel 80386 object file. Looking at the internet, I read
> about an otion called "Toolchain has C++ support?". This must be the one
> to use, but I can't find it. Neither in the Toolchain section nor the
> System configuration.
>
> I am using Buildroot 2013.02 with CodeSourcery (Sourcery Codebench) for
> ARM 2012.03.
This toolchain always provides a C++ compiler, so you don't need to
configure it in BR.
Yegor
More information about the buildroot
mailing list