LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-27-2014, 07:30 PM   #1
noob_dev
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Rep: Reputation: Disabled
undefined reference to TIFFOPEN


I am trying to compile an open source program called quantim4 (http://www.ufz.de/index.php?en=16562) on Ubuntu 13.10 (64x) machine.
This program requires TIFF library. I believe I have TIFF library installed, because I found following library files in my computer. I need help to properly link libtiff files so that I can successfully compile this program quantim4.

/usr/lib/evince/4/backends/libtiffdocument.so
/usr/lib/i386-linux-gnu/libtiff.so.5.1.0
/usr/lib/i386-linux-gnu/libtiff.so.5
/usr/lib/x86_64-linux-gnu/libtiff.so
/usr/lib/x86_64-linux-gnu/libtiffxx.so.0.0.10
/usr/lib/x86_64-linux-gnu/libtiff.so.4.3.6
/usr/lib/x86_64-linux-gnu/libtiff.so.5.1.0
/usr/lib/x86_64-linux-gnu/libtiff.la
/usr/lib/x86_64-linux-gnu/libtiffxx.a
/usr/lib/x86_64-linux-gnu/libtiffxx.so.0
/usr/lib/x86_64-linux-gnu/libtiff.so.5
/usr/lib/x86_64-linux-gnu/libtiffxx.so
/usr/lib/x86_64-linux-gnu/libtiffxx.la
/usr/lib/x86_64-linux-gnu/libtiff.so.4
/usr/lib/x86_64-linux-gnu/libtiff.a
/usr/share/man/man3/libtiff.3tiff.gz
/usr/share/lintian/overrides/libtiff4

also, I created link(ln -s) to tiff files in my local bin folder

$ls /usr/local/lib/
libPSgraf3.a libtiff.a python2.7 site_ruby tiffio.h
libQuantim4.a libtiff.so.5 python3.3 tiff.h

$PATH
bash: /usr/local/lib:/usr/local/cuda-5.5/bin:/usr/local/cuda-5.5/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk1.7.0_45/bin: No such file or directory

when I try to compile a demo example of this program, I am getting following errors related to LIBTIFF

$g++ -g demo.c -lm -ltiff -lQuantim4 -lPSgraf3

demo.c: In function ‘int main(int, char**)’:
demo.c:172:27: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
/usr/local/lib/libQuantim4.a(files.o): In function `LoadImage(char*)':
files.c:(.text+0xe49): undefined reference to `TIFFOpen'
files.c:(.text+0xe6d): undefined reference to `TIFFGetField'
files.c:(.text+0xe83): undefined reference to `TIFFGetField'
files.c:(.text+0xe9c): undefined reference to `TIFFGetField'
files.c:(.text+0xeb5): undefined reference to `TIFFGetField'
files.c:(.text+0xfab): undefined reference to `TIFFGetField'
files.c:(.text+0xfb5): undefined reference to `TIFFScanlineSize'
files.c:(.text+0xfff): undefined reference to `TIFFGetField'
files.c:(.text+0x1052): undefined reference to `TIFFReadScanline'
files.c:(.text+0x108d): undefined reference to `TIFFClose'
files.c:(.text+0x1209): undefined reference to `TIFFReadScanline'
 
Old 01-27-2014, 08:15 PM   #2
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
i think that -ltiff search in /usr/lib only; instead of using -ltiff, use the full library path
 
Old 01-27-2014, 08:44 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,667

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
you NEED to have the -dev.deb's installed for tiff

you are missing the tiff *.h files in /usr/include
also for LARGE image support on 64 bit systems it needs to be "bigtiff"
 
Old 01-28-2014, 04:04 PM   #4
noob_dev
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for your suggestions, I implemented those but still I am getting same errors. more ideas?

$ ls /usr/include/ti*.h
/usr/include/tiff.h /usr/include/tiffio.h /usr/include/time.h

$ ls /usr/lib/libti*
/usr/lib/libtidy-0.99.so.0 /usr/lib/libtiff.a
/usr/lib/libtidy-0.99.so.0.0.0 /usr/lib/libtimezonemap.so.1
/usr/lib/libtidy.so /usr/lib/libtimezonemap.so.1.0.0

$ sudo apt-get install libtiff4 libtiff4-dev
[sudo] password for :
Reading package lists... Done
Building dependency tree
Reading state information... Done
libtiff4 is already the newest version.
libtiff4-dev is already the newest version.
The following packages were automatically installed and are no longer required:
compiz-plugins libetpan15 libgldi3
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
 
Old 01-28-2014, 05:16 PM   #5
gengisdave
Member
 
Registered: Dec 2013
Location: Turin, Italy
Distribution: slackware
Posts: 328

Rep: Reputation: 74
mmm, in your libraries listing there is no libtiff.so, just the static version; can you please post ouput of "ls -l /usr/lib64/libtif*"? in the first post i see that libtiff.so is present in both 32 and 64 bit version, in a path which a linker don't use
 
Old 01-28-2014, 07:30 PM   #6
noob_dev
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
This is a 64-bit machine. Therefore, there is lib32 and lib folders; there is no lib64.
I think lib is for lib64

$ls /usr/lib
lib/ lib32/
 
Old 01-29-2014, 01:09 AM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,667

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
looking at the unzipped "54915_quantim.zip"
54915_quantim/quantim/quantim_develop/install.sh

that and the already built tons of *.o files

that shell script ONLY runs "make" on the already built *.o files
nothing is being BUILT
it is only trying to use the versions that someone else built on DIFFERENT HARDWARE and different software


so
you need to clean out those old *.o files that should NEVER have been redistributed in that zip
you need to clean the code

Code:
cd 54915_quantim/quantim/quantim_develop/PSgraf3/source/
make clean 

cd ../../source
make clean 
cd ../

sh ./install.sh
cd demo
then rebuild that demo
 
Old 01-29-2014, 10:29 PM   #8
noob_dev
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
did it work for you after making a fresh install ?because I also did "make clean" followed by fresh installaton and I am still seeing same error.
I am installing on Ubuntu 13.10 64-bit.
I looked into synaptic manager and it has both libtiff4 and libtiff5 installed.
but I have only libtiff5-dev installed and libtiff4-dev is not installed.

I wonder if both libtiff4 and libtiff5 packages are causing some incompatibility.
 
Old 01-30-2014, 02:18 AM   #9
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,667

Rep: Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657Reputation: 2657
"makefile" projects
i hate them
I also hate programs that use "install.sh"( or the like) files to run "make and make install using sudo
( personal preferences , others like them -- i do not )

well one of the reasons i am not having a problem is i DO HAVE gcc 4.3 already installed ( along with 4.1 and 4.7 )

reading the Makefile in
54915_quantim/quantim/quantim_develop/PSgraf3/source/
it redefines CC as gcc4.3
Code:
CC = g++-4.3
SOURCES =Arrows.cpp\
	CBlock.cpp\
--- and so on ..........................
if you do not have that version already installed - you will have problems

and i am betting you do not have the older 4.3 installed on ubuntu 13 , it is likely gcc 4.8

the good news is 4.3 can be installed SIDE BY SIDE with 4.8

bad news i do not use ubuntu 13

so search this site for installing a second version of gcc

this program "54915_quantim" might be a bit TOO OLD for the current gcc 4.8 to build without hacking the program and bring it UP to the NEW c++11 specs

so ignore that "install.sh" it is only hiding any errors

in the "PSgraf3/source/" folder rerun the clean
Code:
make clean 
rm *.a 
----- that is just in case the makefile dose not do what it is supposed to do -----
make 
sudo make install
then repeat in the quantim_develop/source/ folder

then

for the demo you might want to use THIS instead
the command you posted makes a very unuseful "a.out"
Code:
 g++ -g -o demo demo.c -lm -ltiff -lQuantim4 -lPSgraf3
this makes a program called "demo"

Last edited by John VV; 01-30-2014 at 02:24 AM.
 
Old 02-03-2014, 10:15 PM   #10
noob_dev
LQ Newbie
 
Registered: Jan 2014
Posts: 5

Original Poster
Rep: Reputation: Disabled
I could not install gcc-4.3 in Ubuntu 13.10 64x using sudo. i still think that problem is because libtiff libraries are not properly linked to the quantim program during compile. I think that missing gcc4.3 is not the problem because both PSgraf3 and quantim compile successfully.

$sudo apt-get install gcc-4.3 gcc-4.4 g++-4.3 g++-4.4
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package gcc-4.3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'gcc-4.3' has no installation candidate
E: Unable to locate package g++-4.3
E: Couldn't find any package by regex 'g++-4.3'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ undefined reference grob115 Programming 4 01-22-2013 12:22 PM
Yet another undefined reference CollieJim Linux - General 2 12-18-2010 12:08 AM
undefined reference to.... crapodino Programming 1 01-13-2008 08:05 PM
undefined reference? Sharky01252 Programming 3 11-07-2006 12:36 PM
undefined reference vkmgeek Programming 1 05-11-2006 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration