c++ - GCC and Include File Troubles -
c++ - GCC and Include File Troubles -
i've been having difficulty compiling piece of c++ code physics engine bullet physics, , hoping advice.
this first time using gcc
compiler, , including directories compiling in general, i'm going give whole process of problem-solving because i'm not sure went wrong or pertinent info is.
when first tried compile code got fatal error "no such error or directory", decided add together directory -i
alternative (1). fixed first error, popped up. again, able create error go away -i
alternative directory needed(2).
then got whole long list of errors following:
main.cpp:(.text+0x33): undefined reference 'ragdolldemo::initphysics()'
main.cpp:(.text+0x84): undefined reference 'glutmain(int, char**, int, int, char const*, demoapplication*)'
/tmp/cc4mqhhm.o: in function '__static_initialization_and_destruction_0(int, int)': main.cpp:(.text+0xe7): undefined reference `std::ios_base::init::init()'
i tried few different things, solution ended using home bullet folder (or usr/local/include/bullet/) --sysroot
alternative (3).
this created lot of errors c++ header files, , linked few more directories -i
(4-5), @ after 1 of added directories same set of errors thought solved --sysroot
add-on popped 1 time again (6).
i can't tell now. guess declaring bullet folder root makes impossible compiler find required c++ files in actual root directories, don't that... , when tried including c++ files needed, compiler seemingly forgot told utilize bullet root.
final compilation tried before gave , realized asking help might improve spending 3 hours looking @ documentation without thought of exact problem is. numbers correspond steps above.
gcc (3)--sysroot=/home/josh/bullet-2.82-r2704/ (1)-isystem/home/josh/bullet-2.82-r2704/demos/opengl/ (2)-isystem/home/josh/bullet-2.82-r2704/src/ (4)-i/usr/include/ (5)-i/usr/include/c++/4.8 (6)-i/usr/include/x86_64-linux-gnu/c++/4.8/ ./main.cpp
i'm using ubuntu 14.04 lts , os , emacs 24.3.1 ide.
any help appreciated.
best, josh
what seeing not include
issue. linker failing link symbols. need link proper library, illustration lglut
c++ gcc compiler-errors include
Comments
Post a Comment