Skip to content

Instantly share code, notes, and snippets.

@egradman
Created February 20, 2014 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save egradman/9123387 to your computer and use it in GitHub Desktop.
Save egradman/9123387 to your computer and use it in GitHub Desktop.
Cross-compiling OpenFrameworks 0.8 for Raspbian
# cross-compile raspberry pi openframeworks
Tested for my setup:
- Ubuntu 12.04 32-bit
- 2014-01-07-wheezy-raspbian
- OpenFrameworks 0.8 (release)
- My Pi is NFS booting from the Ubuntu box, FWIW.
Follow the directions here:
- http://www.openframeworks.cc/setup/raspberrypi/Raspberry-Pi-Getting-Started.html
- http://www.openframeworks.cc/setup/raspberrypi/Raspberry-Pi-Cross-compiling-guide.html
There are two errors in the cross-compiling guide:
- The correct command to build is `make -j6 RPI_TOOLS=$RPI_TOOLS RPI_ROOT=$RPI_ROOT GST_VERSION=1.0 PLATFORM_OS=Linux PLATFORM_ARCH=armv6l` (the difference is subtle...)
- the `$RPI_ROOT` directory should be set to a directory that _contains_ `/usr`, not the `/usr` directory itself.
You will get PKG_CONFIG errors. To fix them:
`export PKG_CONFIG_PATH=$RPI_ROOT/usr/lib/arm-linux-gnueabihf/pkgconfig:$RPI_ROOT/usr/share/pkgconfig:$RPI_ROOT/usr/lib/pkgconfig`
You may get errors related to libdl. There are some absolute symlinks in your $RPI_ROOT that are broken. Fix them with [this script](https://gitorious.org/cross-compile-tools/cross-compile-tools/source/98c51c5939d91884b096dd2fbee859803fd34fef:fixQualifiedLibraryPaths). Change the first line to `#!/bin/bash`.
@titusece
Copy link

Hi,
I'm getting below linker errors while cross compilation,

make -j3 RPI_TOOLS=$RPI_TOOLS RPI_ROOT=$RPI_ROOT GST_VERSION=1.0 PLATFORM_OS=Linux PLATFORM_ARCH=armv7l

home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(PurgeStrategy.o): In function Poco::PurgeStrategy::list(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<Poco::File, std::allocator<Poco::File> >&)': PurgeStrategy.cpp:(.text+0x1c6): undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::M_append(char const, unsigned int)'
PurgeStrategy.cpp:(.text+0x1ee): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' PurgeStrategy.cpp:(.text+0x26c): undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(RWLock.o): In function Poco::RWLockImpl::RWLockImpl()': RWLock.cpp:(.text+0x4c): undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(TextConverter.o): In function Poco::TextConverter::convert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int (_)(int))': TextConverter.cpp:(.text+0x86): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_append(char const*, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(TextConverter.o): In functionPoco::TextConverter::convert(void const_, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int (_)(int))': TextConverter.cpp:(.text+0x1da): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_append(char const*, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(FileStreamFactory.o): In functionvoid std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char_, char_, std::forward_iterator_tag) [clone .isra.15]': FileStreamFactory.cpp:(.text+0x90): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(FileStreamFactory.o): In functionPoco::FileStreamFactory::open(Poco::URI const&)': FileStreamFactory.cpp:(.text+0x286): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const'
FileStreamFactory.cpp:(.text+0x2a8): undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned int, unsigned int)' FileStreamFactory.cpp:(.text+0x2f6): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const_, std::allocator<char> const&) [clone .isra.29]': ........... ................. char> >::basic_string(char const_, std::allocator<char> const&) [clone .isra.29]': DeflatingStream.cpp:(.text+0x5a): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionPoco::DeflatingStreamBuf::readFromDevice(char_, int)': DeflatingStream.cpp:(.text+0x202): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionPoco::DeflatingStreamBuf::writeToDevice(char const_, int)': DeflatingStream.cpp:(.text+0x380): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionPoco::DeflatingStreamBuf::sync()': DeflatingStream.cpp:(.text+0x5e6): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
DeflatingStream.cpp:(.text+0x622): undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned int&, unsigned int)' /home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o):DeflatingStream.cpp:(.text+0xe22): more undefined references to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)' follow
/home/titus/workdir/usr_pi/usr/lib/arm-linux-gnueabihf/libdl.a(dlsym.o): In functiondlsym': (.text+0xc): undefined reference to __dlsym'
/home/titus/Downloads/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: bin/audioOutputExample: No symbol version section for versioned symbol`pthread_cond_destroy@@GLIBC_2.4'
/home/titus/Downloads/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:382: recipe for target 'bin/audioOutputExample' failed
make[1]: *** [bin/audioOutputExample] Error 1
make[1]: Leaving directory '/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/examples/sound/audioOutputExample'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:125: recipe for target 'Release' failed
make: *** [Release] Error 2
titus@titus-PC:~/workdir/OF/of_v0.9.3_linuxarmv7l_release/examples/sound/audioOutputExample$ ls

Can you please help to solve this issue ?

Regards,
Titus S.

@titusece
Copy link

Hi,
I'm getting below linker errors while cross compilation,

make -j3 RPI_TOOLS=$RPI_TOOLS RPI_ROOT=$RPI_ROOT GST_VERSION=1.0 PLATFORM_OS=Linux PLATFORM_ARCH=armv7l

home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(PurgeStrategy.o): In function Poco::PurgeStrategy::list(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<Poco::File, std::allocator<Poco::File> >&)': PurgeStrategy.cpp:(.text+0x1c6): undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::M_append(char const, unsigned int)'
PurgeStrategy.cpp:(.text+0x1ee): undefined reference to std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(unsigned int, unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const' PurgeStrategy.cpp:(.text+0x26c): undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(RWLock.o): In function Poco::RWLockImpl::RWLockImpl()': RWLock.cpp:(.text+0x4c): undefined reference tostd::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(TextConverter.o): In function Poco::TextConverter::convert(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int (_)(int))': TextConverter.cpp:(.text+0x86): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_append(char const*, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(TextConverter.o): In functionPoco::TextConverter::convert(void const_, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, int (_)(int))': TextConverter.cpp:(.text+0x1da): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_append(char const*, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(FileStreamFactory.o): In functionvoid std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char_, char_, std::forward_iterator_tag) [clone .isra.15]': FileStreamFactory.cpp:(.text+0x90): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(FileStreamFactory.o): In functionPoco::FileStreamFactory::open(Poco::URI const&)': FileStreamFactory.cpp:(.text+0x286): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const'
FileStreamFactory.cpp:(.text+0x2a8): undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_erase(unsigned int, unsigned int)' FileStreamFactory.cpp:(.text+0x2f6): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::compare(char const*) const'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionstd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const_, std::allocator<char> const&) [clone .isra.29]': ........... ................. char> >::basic_string(char const_, std::allocator<char> const&) [clone .isra.29]': DeflatingStream.cpp:(.text+0x5a): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionPoco::DeflatingStreamBuf::readFromDevice(char_, int)': DeflatingStream.cpp:(.text+0x202): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionPoco::DeflatingStreamBuf::writeToDevice(char const_, int)': DeflatingStream.cpp:(.text+0x380): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o): In functionPoco::DeflatingStreamBuf::sync()': DeflatingStream.cpp:(.text+0x5e6): undefined reference to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)'
DeflatingStream.cpp:(.text+0x622): undefined reference tostd::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_create(unsigned int&, unsigned int)' /home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/poco/lib/linuxarmv7l/libPocoFoundation.a(DeflatingStream.o):DeflatingStream.cpp:(.text+0xe22): more undefined references to std::__cxx11::basic_string<char, std::char_traits, std::allocator >::_M_create(unsigned int&, unsigned int)' follow
/home/titus/workdir/usr_pi/usr/lib/arm-linux-gnueabihf/libdl.a(dlsym.o): In functiondlsym': (.text+0xc): undefined reference to __dlsym'
/home/titus/Downloads/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: bin/audioOutputExample: No symbol version section for versioned symbol`pthread_cond_destroy@@GLIBC_2.4'
/home/titus/Downloads/gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:382: recipe for target 'bin/audioOutputExample' failed
make[1]: *** [bin/audioOutputExample] Error 1
make[1]: Leaving directory '/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/examples/sound/audioOutputExample'
/home/titus/workdir/OF/of_v0.9.3_linuxarmv7l_release/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk:125: recipe for target 'Release' failed
make: *** [Release] Error 2
titus@titus-PC:~/workdir/OF/of_v0.9.3_linuxarmv7l_release/examples/sound/audioOutputExample$ ls

Can you please help to solve this issue ?

Regards,
Titus S.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment