Missing Library in Compiling

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 1
Reputation: nesalang is an unknown quantity at this point 
Solved Threads: 0
nesalang nesalang is offline Offline
Newbie Poster

Missing Library in Compiling

 
0
  #1
Jul 2nd, 2008
When I try to compile

g++-4.2 memJpegDecoder.cpp

I get these errors.

  1. /usr/lib/gcc/x86_64-linux-gnu/4.2.1/../../../../lib/crt1.o: In function `_start':
  2. (.text+0x20): undefined reference to `main'
  3. /tmp/cci2IOXX.o: In function `memJpegDecoder::decompress()':
  4. memJpegDecoder.cpp:(.text+0x5b5): undefined reference to `jpeg_calc_output_dimensions'
  5. memJpegDecoder.cpp:(.text+0x68a): undefined reference to `jpeg_start_decompress'
  6. memJpegDecoder.cpp:(.text+0x6ac): undefined reference to `jpeg_read_scanlines'
  7. memJpegDecoder.cpp:(.text+0x730): undefined reference to `jpeg_finish_decompress'
  8. memJpegDecoder.cpp:(.text+0x739): undefined reference to `jpeg_destroy_decompress'
  9. /tmp/cci2IOXX.o: In function `memJpegDecoder::readHeader()':
  10. memJpegDecoder.cpp:(.text+0x756): undefined reference to `jpeg_read_header'
  11. /tmp/cci2IOXX.o: In function `memJpegDecoder::setSource(char*, long)':
  12. memJpegDecoder.cpp:(.text+0x79a): undefined reference to `jpeg_std_error'
  13. memJpegDecoder.cpp:(.text+0x7b7): undefined reference to `jpeg_CreateDecompress'
  14. memJpegDecoder.cpp:(.text+0x7c8): undefined reference to `jpeg_mem_src'
  15. collect2: ld returned 1 exit status

I've tried linking the libjpeg files in /usr/lib, but it doesn't seem to be working. The header file that makes these calls can be found at https://setisvn.ssl.berkeley.edu/svn...glib/jpeglib.h. Please let me know if you have any questions.
Last edited by nesalang; Jul 2nd, 2008 at 5:41 pm.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,433
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1471
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Missing Library in Compiling

 
0
  #2
Jul 2nd, 2008
>>g++-4.2 memJpegDecoder.cpp
That is attempting to compile the *.cpp and create the executable program a.out. From the error message I assume that *.cpp file doesnot contain a main() function, which is required of all c and c++ executable programs.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 10
Reputation: hazmatt is an unknown quantity at this point 
Solved Threads: 0
hazmatt hazmatt is offline Offline
Newbie Poster

Re: Missing Library in Compiling

 
0
  #3
Jul 5th, 2008
I'm working on a different part of the same project with him. Hopefully I'll get a copy of his work within a day or two, but the main thing we're trying to do right now that's giving those errors is that the project builds correctly with cmake. We're trying to write our own make file for the entire project, so we're trying to get it to work with make instead of cmake. I'll be back when I get his part.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC