AWS Thinkbox Discussion Forums

trouble building the examples

I downloaded krakatoa SR to my linumx box. I figure the code to build the example would be something like:

gcc -v -Wall -std=c++11 -Iinclude -L lib-linux-x64 -lKrakatoaSR -ltbbmalloc -ltbb examples/example02.cpp 

But i get errors such as:

example02.cpp:(.text+0x20): undefined reference to `krakatoasr::krakatoa_renderer::krakatoa_renderer()'

Am i missing something here?

Hi spirail,

Would it be possible to get the full build output log as well as the version of gcc and the OS you’re using?

Also, do these errors occur when you try to build any of the examples, or just 2?

Occurs on all of the examples.
I just used example02 as krakatoa_renderer is the first error in this example.
I would really like to be sure the build command is correct

This is the Krakatoa version i downloaded from the official site:
KrakatoaSR_API_2.6.3_Windows_Linux_OS_X.zip

uname -a Linux bobreborn 4.13.0-39-generic #44~16.04.1-Ubuntu SMP Thu Apr 5 16:43:10 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

g++

 g++ -v -Iinclude -Llib-linux-x64 -lKrakatoaSR -ltbbmalloc -ltbb examples/example02.cpp 
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 
COLLECT_GCC_OPTIONS='-v' '-I' 'include' '-Llib-linux-x64' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I include -imultiarch x86_64-linux-gnu -D_GNU_SOURCE examples/example02.cpp -quiet -dumpbase example02.cpp -mtune=generic -march=x86-64 -auxbase example02 -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccdCq0Ld.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 include
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d8217bc73be730fa402b500d5726a5b4
COLLECT_GCC_OPTIONS='-v' '-I' 'include' '-Llib-linux-x64' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 as -v -I include --64 -o /tmp/ccKUDjNt.o /tmp/ccdCq0Ld.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-I' 'include' '-Llib-linux-x64' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccrCtOOJ.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -Llib-linux-x64 -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lKrakatoaSR -ltbbmalloc -ltbb /tmp/ccKUDjNt.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/ccKUDjNt.o: In function `example02()':
example02.cpp:(.text+0x20): undefined reference to `krakatoasr::krakatoa_renderer::krakatoa_renderer()'
example02.cpp:(.text+0x36): undefined reference to `krakatoasr::krakatoa_renderer::set_render_resolution(int, int)'
example02.cpp:(.text+0xe6): undefined reference to `krakatoasr::animated_transform::animated_transform(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float)'
example02.cpp:(.text+0xfd): undefined reference to `krakatoasr::krakatoa_renderer::set_camera_tm(krakatoasr::animated_transform const&)'
example02.cpp:(.text+0x10e): undefined reference to `krakatoasr::particle_stream::create_from_file(char const*)'
example02.cpp:(.text+0x1be): undefined reference to `krakatoasr::animated_transform::animated_transform(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float)'
example02.cpp:(.text+0x1d5): undefined reference to `krakatoasr::particle_stream::set_transform(krakatoasr::animated_transform const&)'
example02.cpp:(.text+0x1e1): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x1f4): undefined reference to `krakatoasr::particle_stream::particle_stream(krakatoasr::particle_stream const&)'
example02.cpp:(.text+0x207): undefined reference to `krakatoasr::krakatoa_renderer::add_particle_stream(krakatoasr::particle_stream)'
example02.cpp:(.text+0x213): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x224): undefined reference to `krakatoasr::krakatoa_renderer::use_emission(bool)'
example02.cpp:(.text+0x238): undefined reference to `krakatoasr::krakatoa_renderer::set_emission_strength(float)'
example02.cpp:(.text+0x249): undefined reference to `krakatoasr::krakatoa_renderer::set_emission_strength_exponent(int)'
example02.cpp:(.text+0x270): undefined reference to `krakatoasr::file_saver::file_saver(char const*, char const*, char const*, char const*, char const*)'
example02.cpp:(.text+0x283): undefined reference to `krakatoasr::krakatoa_renderer::set_render_save_callback(krakatoasr::render_save_interface*)'
example02.cpp:(.text+0x28f): undefined reference to `krakatoasr::krakatoa_renderer::render()'
example02.cpp:(.text+0x29b): undefined reference to `krakatoasr::file_saver::~file_saver()'
example02.cpp:(.text+0x2a7): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x2b3): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x2bf): undefined reference to `krakatoasr::krakatoa_renderer::~krakatoa_renderer()'
example02.cpp:(.text+0x2e0): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x2f1): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x302): undefined reference to `krakatoasr::file_saver::~file_saver()'
example02.cpp:(.text+0x313): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x324): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x335): undefined reference to `krakatoasr::krakatoa_renderer::~krakatoa_renderer()'
collect2: error: ld returned 1 exit status

gcc (slightly different)

gcc -v -Iinclude -Llib-linux-x64 -lKrakatoaSR -ltbbmalloc -ltbb examples/example02.cpp 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.9' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 
COLLECT_GCC_OPTIONS='-v' '-I' 'include' '-Llib-linux-x64' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/cc1plus -quiet -v -I include -imultiarch x86_64-linux-gnu -D_GNU_SOURCE examples/example02.cpp -quiet -dumpbase example02.cpp -mtune=generic -march=x86-64 -auxbase example02 -version -fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccQWerkf.s
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 include
 /usr/include/c++/5
 /usr/include/x86_64-linux-gnu/c++/5
 /usr/include/c++/5/backward
 /usr/lib/gcc/x86_64-linux-gnu/5/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
GNU C++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) version 5.4.0 20160609 (x86_64-linux-gnu)
	compiled by GNU C version 5.4.0 20160609, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: d8217bc73be730fa402b500d5726a5b4
COLLECT_GCC_OPTIONS='-v' '-I' 'include' '-Llib-linux-x64' '-mtune=generic' '-march=x86-64'
 as -v -I include --64 -o /tmp/cchRdnc8.o /tmp/ccQWerkf.s
GNU assembler version 2.26.1 (x86_64-linux-gnu) using BFD version (GNU Binutils for Ubuntu) 2.26.1
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/5/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/5/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-I' 'include' '-Llib-linux-x64' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/5/collect2 -plugin /usr/lib/gcc/x86_64-linux-gnu/5/liblto_plugin.so -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper -plugin-opt=-fresolution=/tmp/ccY16v40.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/5/crtbegin.o -Llib-linux-x64 -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lKrakatoaSR -ltbbmalloc -ltbb /tmp/cchRdnc8.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/5/crtend.o /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crtn.o
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/tmp/cchRdnc8.o: In function `example02()':
example02.cpp:(.text+0x20): undefined reference to `krakatoasr::krakatoa_renderer::krakatoa_renderer()'
example02.cpp:(.text+0x36): undefined reference to `krakatoasr::krakatoa_renderer::set_render_resolution(int, int)'
example02.cpp:(.text+0xe6): undefined reference to `krakatoasr::animated_transform::animated_transform(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float)'
example02.cpp:(.text+0xfd): undefined reference to `krakatoasr::krakatoa_renderer::set_camera_tm(krakatoasr::animated_transform const&)'
example02.cpp:(.text+0x10e): undefined reference to `krakatoasr::particle_stream::create_from_file(char const*)'
example02.cpp:(.text+0x1be): undefined reference to `krakatoasr::animated_transform::animated_transform(float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float)'
example02.cpp:(.text+0x1d5): undefined reference to `krakatoasr::particle_stream::set_transform(krakatoasr::animated_transform const&)'
example02.cpp:(.text+0x1e1): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x1f4): undefined reference to `krakatoasr::particle_stream::particle_stream(krakatoasr::particle_stream const&)'
example02.cpp:(.text+0x207): undefined reference to `krakatoasr::krakatoa_renderer::add_particle_stream(krakatoasr::particle_stream)'
example02.cpp:(.text+0x213): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x224): undefined reference to `krakatoasr::krakatoa_renderer::use_emission(bool)'
example02.cpp:(.text+0x238): undefined reference to `krakatoasr::krakatoa_renderer::set_emission_strength(float)'
example02.cpp:(.text+0x249): undefined reference to `krakatoasr::krakatoa_renderer::set_emission_strength_exponent(int)'
example02.cpp:(.text+0x270): undefined reference to `krakatoasr::file_saver::file_saver(char const*, char const*, char const*, char const*, char const*)'
example02.cpp:(.text+0x283): undefined reference to `krakatoasr::krakatoa_renderer::set_render_save_callback(krakatoasr::render_save_interface*)'
example02.cpp:(.text+0x28f): undefined reference to `krakatoasr::krakatoa_renderer::render()'
example02.cpp:(.text+0x29b): undefined reference to `krakatoasr::file_saver::~file_saver()'
example02.cpp:(.text+0x2a7): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x2b3): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x2bf): undefined reference to `krakatoasr::krakatoa_renderer::~krakatoa_renderer()'
example02.cpp:(.text+0x2e0): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x2f1): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x302): undefined reference to `krakatoasr::file_saver::~file_saver()'
example02.cpp:(.text+0x313): undefined reference to `krakatoasr::particle_stream::~particle_stream()'
example02.cpp:(.text+0x324): undefined reference to `krakatoasr::animated_transform::~animated_transform()'
example02.cpp:(.text+0x335): undefined reference to `krakatoasr::krakatoa_renderer::~krakatoa_renderer()'
/tmp/cchRdnc8.o:(.eh_frame+0x13): undefined reference to `__gxx_personality_v0'

Thanks for the information. I’ll look into this and let you know when I have a solution.

Is “include” in the current working directory? I usually see those errors when gcc can’t find my headers. I haven’t played with the Krakatoa library yet, but you can also try providing the full path in the “-I” path (capital i)

Just crazy ideas while we wait for Evan.

yes. it is. … if it wasn’t the error would be that it cannot find the header file which is in the first line of every example.
The declarations are being found. But it’s the functions themselves that are not being found - i guess.

Its not the -L command either. I have tried to copy the libs to the main c paths also.
The -l (lower cause L) seem to find the .so files correctly (since gcc does not error). So it seems to be that its not finding the functions in the .so file.
… im wondering if this is not compiled against the correct architecture for me. ie: intel/amd/32/64 etc etc.

The arguments are just in the wrong order. The following should build.

g++ -v -Iinclude -Llib-linux-x64 examples/example02.cpp -lKrakatoaSR -ltbbmalloc -ltbb
Privacy | Site terms | Cookie preferences