rdb, thank you for the reply.
I tried what you said (like the manual):
[user@pc s_save]$ g++ -c main.cpp -o main.o -fPIC -O2 -I/home/user/s_save/built/include/
[user@pc s_save]$ g++ main.o -o main -fPIC -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandafx -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lp3direct
/usr/bin/ld: cannot find -lpandafx
/usr/bin/ld: cannot find -lp3direct
collect2: error: ld returned 1 exit status
[user@pc s_save]$
Since there aren’t any libpandafx and libp3direct (they where indeed not compiled), I removed those and tried:
g++ main.o -o main -fPIC -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub
That failed requesting pthreads.
So I added it:
g++ main.o -o main -fPIC -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lpthread
That returned:
[user@pc s_save]$ g++ main.o -o main -fPIC -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lpthread
/home/user/s_save/built/lib//libp3framework.a(p3framework_composite1.o): In function `PandaFramework::open_framework(int&, char**&)':
p3framework_composite1.cxx:(.text+0x6596): undefined reference to `init_libpandaegg()'
/home/user/s_save/built/lib//libp3dtool.a(p3dtoolutil_composite1.o): In function `unload_dso(void*)':
p3dtoolutil_composite1.cxx:(.text+0x23b7): undefined reference to `dlclose'
/home/user/s_save/built/lib//libp3dtool.a(p3dtoolutil_composite1.o): In function `load_dso_error()':
p3dtoolutil_composite1.cxx:(.text+0x23eb): undefined reference to `dlerror'
/home/user/s_save/built/lib//libp3dtool.a(p3dtoolutil_composite1.o): In function `get_dso_symbol(void*, std::string const&)':
p3dtoolutil_composite1.cxx:(.text+0x2471): undefined reference to `dlsym'
/home/user/s_save/built/lib//libp3dtool.a(p3dtoolutil_composite1.o): In function `load_dso(DSearchPath const&, Filename const&)':
p3dtoolutil_composite1.cxx:(.text+0x92df): undefined reference to `dlopen'
collect2: error: ld returned 1 exit status
[user@pc s_save]$
So I added libdl:
g++ main.o -o main -fPIC -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lpthread -ldl
That returned:
[user@pc s_save]$ g++ main.o -o main -fPIC -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lpthread -ldl
/home/user/s_save/built/lib//libp3framework.a(p3framework_composite1.o): In function `PandaFramework::open_framework(int&, char**&)':
p3framework_composite1.cxx:(.text+0x6596): undefined reference to `init_libpandaegg()'
collect2: error: ld returned 1 exit status
[user@pc s_save]$
So I added libpandaegg:
g++ main.o -o main -fPIC -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lpthread -ldl -lpandaegg
But failed too. Output: http://pastebin.com/sF9tGkEP
I removed libp3pystub but didn’t change anything (at least on the output).
Edit: I compiled 'em as static. Guess the manual is using 'em as dynamic. Which leads me to believe, since I’ve had to add libpthread and libdl that are dynamic, that I’m probably missing something on g++ to mix static libs and dynamic libs.
Edit2: It can be done (http://gcc.gnu.org/ml/gcc/2001-07/msg01447.html), but didn’t solved the problem:
g++ main.o -o main -Wl,-Bstatic -L/home/user/s_save/built/lib/ -lp3framework -lpanda -lpandaexpress -lp3dtoolconfig -lp3dtool -lp3pystub -lpandaegg -Wl,-Bdynamic -lpthread -ldl
Same output: http://pastebin.com/ydBAsJbX