newton-3.13, 101 sample not compiling

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

newton-3.13, 101 sample not compiling

Postby sake » Fri Aug 28, 2015 3:12 pm

I managed get newton-2.36 installed with gentoo's package manager (it's the latest version they host) and I have successfully compiled some samples with it but I have had no luck with newton-3.

Version 3.14 didn't compile but 3.13 compiled successfully and the demoSandbox works.
I tried to compile this sample stripped from the "stdafx.h" include.
Code: Select all
g++ -lNewton newt.cpp
/usr/local/lib64/libNewton.so: undefined reference to `sem_init'
/usr/local/lib64/libNewton.so: undefined reference to `pthread_attr_setstacksize'
/usr/local/lib64/libNewton.so: undefined reference to `sem_destroy'
/usr/local/lib64/libNewton.so: undefined reference to `pthread_create'
/usr/local/lib64/libNewton.so: undefined reference to `sem_post'
/usr/local/lib64/libNewton.so: undefined reference to `sem_wait'
/usr/local/lib64/libNewton.so: undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status


I don't know that that well linux build tools or c++ and I have no idea what I'm missing here.
sake
 
Posts: 2
Joined: Fri Aug 28, 2015 2:18 pm

Re: newton-3.13, 101 sample not compiling

Postby Julio Jerez » Fri Aug 28, 2015 5:12 pm

in you make file you nee to include a reference to -libpthread. (look it up, or check the make file command line) that's a Linux system library that newton assume is in the system already.
something like

++ -lNewton -lpthread newt.cpp
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: newton-3.13, 101 sample not compiling

Postby sake » Fri Aug 28, 2015 5:56 pm

Silly me, I actually tried that before posting but apparently I had typo in there.
I managed to compile it with g++ -lNewton -lpthread newt.cpp

I had to change all function from calls (dGetIdentityMatrix()) to my own defined function that returns pointer to float arrray because otherwise it would fail with error
Code: Select all
newt.cpp:(.text+0x25b): undefined reference to `dGetIdentityMatrix()'
sake
 
Posts: 2
Joined: Fri Aug 28, 2015 2:18 pm

Re: newton-3.13, 101 sample not compiling

Postby Julio Jerez » Sat Aug 29, 2015 2:00 pm

did you get it to run?
FYI, 3.14 now compiles in linux and mac.
Julio Jerez
Moderator
Moderator
 
Posts: 11043
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles


Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest