LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-07-2004, 08:44 AM   #1
nimra
LQ Newbie
 
Registered: May 2004
Posts: 28

Rep: Reputation: 15
tiff library - linker error


Hi everybody

I try to create a tiff. My test code is the following:

#include "tiffio.h"
main(){
TIFF* tif = TIFFOpen("mypic.tif", "w");
TIFFClose(tif);
}

then i compile with g++ tifftest.cpp and i fail:

In function 'main':
: undefined reference to 'TIFFOpen'
In function 'main':
: undefined reference to 'TIFFClose'
collect2: ld returned 1 exit status

The tiffio.h library is where it should be and both functions are declared there, as well.

somebody has an idea? thx a lot.
 
Old 06-07-2004, 10:58 AM   #2
nimra
LQ Newbie
 
Registered: May 2004
Posts: 28

Original Poster
Rep: Reputation: 15
It works!

I solved it with:
g++ -o tifftest tifftest -lm ltiff

Does anybody know why the #include is not sufficient?
 
Old 06-08-2004, 02:22 AM   #3
nimra
LQ Newbie
 
Registered: May 2004
Posts: 28

Original Poster
Rep: Reputation: 15
Sorry, there are some errors in the comand

g++ -o tifftest tifftest.cpp -lm -ltiff

Hope that it will help somebody
 
Old 10-08-2011, 03:54 AM   #4
romagnolo
Member
 
Registered: Jul 2009
Location: Montaletto
Distribution: Debian GNU/Linux
Posts: 107

Rep: Reputation: 5
Quote:
Originally Posted by nimra View Post
Sorry, there are some errors in the comand

g++ -o tifftest tifftest.cpp -lm -ltiff

Hope that it will help somebody
It did now!
 
  


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
linker error pavan Programming 2 10-06-2005 01:58 AM
ld linker error Ankit mittal Programming 2 09-30-2005 07:40 AM
Linker error eddydw Linux - General 0 09-20-2004 01:21 PM
Linker Error dim79 Programming 2 06-28-2003 09:53 AM
linker error Config Programming 8 06-04-2002 03:33 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:51 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration