lib3ds undefined reference
Hi
I want to compile a program PTAMM that, among other things, also needs lib3ds. After I had build those libraries and started to make the program I got this error; Model3ds.cc:(.text+0x502): undefined reference to `lib3ds_mesh_calculate_vertex_normals' Model3ds.o: In function `PTAMM::Model3DS::_Load()': Model3ds.cc:(.text+0xeb6): undefined reference to `lib3ds_file_open' collect2: ld returned 1 exit status make: *** [PTAMM] Error 1 The header for this function is lib3ds.h and is in /usr/local. During the configure of lib3ds it showed it missed g77 and xlf but I guess it then went for f77 as shown below; checking how to run the C++ preprocessor... g++ -E checking for g77... no checking for xlf... no checking for f77... f77 checking whether we are using the GNU Fortran 77 compiler... yes checking whether f77 accepts -g... yes If that's the problem then I wonder how to get g77 and xlf. Some other forums spoke about the gcc-4 and higher could be the problem. But there wasn't really a solution given. I did install gcc-3.4 though, but it resides along side gcc-4 (de-installing gcc via synaptic manager seems dangerous), so I guess it doesn't change a whole lot. What would be the best way to go about this? |
Quote:
g77 is a link to f77. Or a copy of f77. And besides that : There's no fortran code in lib3ds. It's all c. It's just a default configure file : Will look for a fortran77 compiler also when there are no fortran files in the program. Not all the libraries work well on all OS. And you cannot use all versions of the libraries. ( A "latest version" may fail.) Example that compiles OK on CentOS 6.3 64bits : TooN-2.0 lib3ds-20080909 libcvd-20100511 gvars3-20120724 PTAM. Which OS are you using ? Name, <version>, <architecture> please. . |
I'm using Ubuntu 10.10 on, I guess, an i386 architecture (32 bit intel)
So the mentioning of no g77 and xlf shouldn't be a problem? It just switches compilers or something? I've now tried both versions of lib3ds I could find, with first of lib3ds-20080909 and then lib3ds-1.3.0. But still to no avail. |
Quote:
lib3ds_file_open) inside the libraries specified during the build and so bails out, aborting the build. Have you properly installed lib3ds prior the PTAMM build? If so, run ldconfig first to update shared library information and check the library presence with Code:
ldconfig -p | grep lib3ds |
Ubuntu 10.10 :
How about : sudo apt-get install lib3ds-dev It is a patched version of lib3ds-1.3.0 : With the 980 kB patch, lib3ds_1.3.0-5.diff http://packages.ubuntu.com/natty/lib3ds-dev . |
Thanks for the pointers, I tried ldconfig -p | grep lib3ds. this gives;
Code:
opie@ubuntu:~/workspace/PTAMM$ ldconfig -p | grep lib3ds Also tried the dev update and a re-install via synaptic, but that didn't help either. There also is a test program I compiled and run, ubuntu-3dstest, that put out the right numbers; Code:
Expecting: 0.065576; Value returned by lib3ds: 0.065576 I saw somewhere that lib3ds was incompatible with gcc-4 optimization feature causing vertex data problems, so setting in the makefile CFLAGS to -O0 would help, but it didn't :( |
Quote:
|
PTAMM compiles OK on a 32bits reference OS,
e.g. CentOS 6.3 - 32 and Ubuntu 10.04 - 32. And : The Ubuntu lib3ds packages did not work, sorry. Please remove the two packages. Lib3ds files : Code:
ls /usr/lib/lib3ds* ./configure --prefix=/usr/ Links http://www.robots.ox.ac.uk/~bob/rese...rch_ptamm.html http://www.robots.ox.ac.uk/~bob/software/index.html http://www.robots.ox.ac.uk/~bob/soft...amm/manual.pdf . |
Ubuntu 10.10 - 32 : 1) sudo apt-get install libxmu-dev \
libdc1394-22-dev libreadline6-dev liblapack-dev libcv-dev libfltk1.1-dev \ libgl1-mesa-dev libglu1-mesa-dev libtiff4-dev libpng12-dev libjpeg62-dev 2) TooN-2.0, lib3ds-20080909, libcvd-20100511, gvars3-20120724 : ./configure --prefix=/usr 3) cd PTAM/ && make : The binaries "CameraCalibrator" and "PTAM" are created. . |
The problem was a different link required for lib3ds, the .so files lie both in /usr/lib and in /usr/local/lib but the last ones don't seemed to work so well.
I changed in the make file to: LINKFLAGS = -L /usr/lib/ -l3ds -L /usr/local/lib/ -lcvd -lGVars3 The link to lib3ds had to go to the front so it would look there first. After a make clean it worked :) |
All times are GMT -5. The time now is 06:47 PM. |