LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-03-2006, 08:26 PM   #1
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Rep: Reputation: 30
jpeg library linking question


Hi,
I am using automake. I wonder where the jpeg libraries are installed.

So CPPFLAGS tells the compiler where the static libraries are stored?

CPPFLAGS = -I$????????

will this work?

In Makefile.am
LIBS=${LIB} -lstdc++ -lpthread -ljpeg

Do I need to put the dir in INCLUDES

In configure.in
LIBS="${LIB} -lstdc++ -lpthread -ljpeg"
Sorry, I am a newbie of Linux, I don't really want to touch the part that isn't necessary (private? Joking

Thanks
Jack
 
Old 01-03-2006, 08:49 PM   #2
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
configure.in:

AC_INIT(unittest.cpp)
AM_INIT_AUTOMAKE(unittest, 1.0)
AC_PROG_CXX
AC_PROG_GCC_TRADITIONAL
AM_PROG_LEX
AC_PROG_YACC
AC_OUTPUT(Makefile)
LIBS="${LIB} -lstdc++ -lpthread -ljpeg"



Makefile.am:

INCLUDES = -I$/opt/arcom/arcom-linux/include -I$/usr/X11R6/include

LIBS=${LIB} -L$/opt/arcom/arcom-linux/lib -lstdc++ -lpthread -ljpeg

MAINTAINERCLEANFILES = aclocal.m4 config.guess config.sub configure depcomp \
install-sh ltmain.sh Makefile.in missing mkinstalldirs


bin_PROGRAMS = unittest
unittest_SOURCES = unittest.cpp baseobject.cpp thread.cpp Packet.cpp Camera.cpp Webcam.cpp Utility.cpp calibration.cpp PlumeAnalysis.cpp socket.c
 
Old 01-03-2006, 10:32 PM   #3
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
I've got link time error when I cross-compiled my project.
The functions in libjpeg were not recognised, but I've included it in Makefile.am (see above), is it an extension (.cpp and .c) issue?
Thanks
Jack
 
Old 01-04-2006, 09:05 PM   #4
mhcox
Member
 
Registered: Aug 2005
Location: Albuquerque, NM
Distribution: Fedora
Posts: 30

Rep: Reputation: 15
Try using:

LDFLAGS=-L <directory where jpeg library is located>
 
Old 01-04-2006, 09:27 PM   #5
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
I found my libs were located /usr/bin
But LDFLAGS=-L/usr/bin
did not help
Thanks
Jack
 
Old 01-04-2006, 09:36 PM   #6
mhcox
Member
 
Registered: Aug 2005
Location: Albuquerque, NM
Distribution: Fedora
Posts: 30

Rep: Reputation: 15
That's a very strange place for libraries to live. On UNIX-like OS', the usually live under /lib, /usr/lib, or /usr/local/lib. The library name will end in .a (for static archive libraries), .so or .sl for shared libraries. Under Windows, the shared libraries usually have a .dll file extension.
 
Old 01-04-2006, 09:46 PM   #7
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
In case of a cross-compilation project, would that affect the link time results? I wonder
Thanks
Jack
 
Old 01-04-2006, 09:50 PM   #8
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
Oh
I found
armbe-linux-g++ is the compiler in use
g++ != gcc
??
Thanks
Jack
 
Old 01-05-2006, 12:03 AM   #9
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
cd '/home/Jacky/Projects/RMVES/ver1_0' && gmake -k -j1
cd . && /bin/sh /home/Jacky/Projects/RMVES/ver1_0/missing --run aclocal-1.9
cd . && /bin/sh /home/Jacky/Projects/RMVES/ver1_0/missing --run automake-1.9 --gnu
cd . && /bin/sh /home/Jacky/Projects/RMVES/ver1_0/missing --run autoconf
/bin/sh ./config.status --recheck
running /bin/sh ./configure --no-create --no-recursion
installing -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking for C++ compiler default output file name... a.out
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for flex... flex
checking for yywrap in -lfl... yes
checking lex output file root... lex.yy
checking whether yytext is a pointer... yes
checking for bison... bison -y
configure: creating ./config.status
/bin/sh ./config.status
config.status: creating Makefile
config.status: executing depfiles commands
linking unittest (g++)
/usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status
gmake: *** [unittest] Error 1
gmake: Target `all' not remade because of errors.
*** Exited with status: 2 ***
 
Old 01-05-2006, 03:31 AM   #10
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
I realized that the underlying problem is the script. But does anyone spot the error? I have been staring at this piece of code for a few days..
Thanks
Jack
 
Old 01-05-2006, 03:38 AM   #11
lucky6969b
Member
 
Registered: Nov 2005
Posts: 337

Original Poster
Rep: Reputation: 30
I wonder what the variable name for C++ compiler is...
I tried CXX=gcc
CC=gcc
$CXX=gcc (but failed)
etc
Thanks
Jack
 
  


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
gd 2.0.15 cannot find jpeg library bluestorm Linux - Software 2 06-17-2009 06:33 PM
library linking question. shaggz Linux - General 1 04-25-2004 11:22 PM
gd won't see jpeg library pigmut Red Hat 0 03-05-2004 02:56 AM
jpeg library install.. eye Red Hat 1 10-15-2003 07:59 PM
jpeg and png library for gd upr8830 Linux - Software 4 06-11-2003 04:49 PM

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

All times are GMT -5. The time now is 04:40 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