LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-05-2006, 07:28 PM   #1
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Rep: Reputation: 30
Linking libjpeg


Hi!
Can anyone please tell me how to link libjpeg with gcc! I downloaded libjpeg, and found an example in source code. Any help? Thank you!
 
Old 07-05-2006, 07:34 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
You need to make it part of the linking stage in the makefile of your application, or if your calling gcc through the command line, you need to add the lib to the command line.

This Page has some basic examples to get you going.
 
Old 07-05-2006, 11:05 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Basically, if your source code is all in one file:

gcc -ljpeg -o yourProgname yourProgname.c

This assumes libjpeg is installed in one of the places listed in $LD_LIBRARY_PATH, or in /etc/ld.so.conf, followed by running ldconfig (as root).
If none of the above, then add the -L/dir/where/libjpeg/is to the gcc commanline.

--- rod.
 
  


Reply



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
libJpeg programming Shioni Programming 3 07-06-2006 12:55 PM
libjpeg nightmare!!!!!!!!!! Beauford-2 Slackware 3 06-20-2006 07:12 PM
libjpeg error handling luigi Programming 1 04-19-2005 04:43 AM
error compiling looking for libjpeg bosewicht Linux - Newbie 1 01-04-2004 04:10 PM
Where to obtain the library for v6 of libjpeg? whepin Linux - General 1 03-31-2002 09:55 AM

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

All times are GMT -5. The time now is 07:28 AM.

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