I ran the ImageMagick configure file with --disable-shared and --enable-static, which resulted in in spitting out only libMagick++.a libMagickCore.a libMagickCore.la libMagick++.la libMagickWand.a libMagickWand.la, no .so's.
However, when I attempt to compile a test file:
#include <Magick++.h>
int main(int argc, char** argv) {
Magick::Image image;
image.read(argv[1]);
}
with the command:
g++ -g -O2 -Wall -W -pthread -I/home/jim/Magick++/include/ImageMagick/ -I/home/jim/Magick++/include/ImageMagick/Magick++ -L/home/jim/Magick++/lib -lMagick++ -o test_magick user/jim/test_magick.cc
I get the following errors:
test_magick.cc:4: undefined reference to `Magick::Image::Image()'
test_magick.cc:5: undefined reference to `Magick::Image::read(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
test_magick.cc:5: undefined reference to `Magick::Image::~Image()'
test_magick.cc:5: undefined reference to `Magick::Image::~Image()'
Any ideas? Do I need to link to other libraries?
Compile failure with static-only libraries
Re: Compile failure with static-only libraries
What happens when you use the recommended command:
- g++ `Magick++-config --cxxflags --cppflags` -o magick++ magick++.cpp `Magick++-config --ldflags --libs`
Re: Compile failure with static-only libraries
The command it spit out to me was:
g++ -g -O2 -Wall -W -pthread -I/home/jim/Magick++/include/ImageMagick -I/home/jim/Magick++/include/ImageMagick/Magick++ -o test_magick user/jim/test_magick.cc -L/home/jim/Magick++/lib/ -L/home/jim/libjpeg/lib/ -lfreetype -lz -lMagick++ -lMagickWand -lMagickCore
result:
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `ReadAVIImage':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1204: undefined reference to `jpeg_std_error'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1223: undefined reference to `jpeg_CreateDecompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `JPEGSourceManagerMemory':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:746: undefined reference to `jpeg_resync_to_restart'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `ReadAVIImage':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1225: undefined reference to `jpeg_read_header'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1214: undefined reference to `jpeg_destroy_decompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `JPEGSourceManagerBLOB':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:769: undefined reference to `jpeg_resync_to_restart'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `ReadAVIImage':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1261: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1262: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1263: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1266: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1267: undefined reference to `jpeg_read_header'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1357: undefined reference to `jpeg_start_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1587: undefined reference to `jpeg_read_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1695: undefined reference to `jpeg_finish_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1325: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1310: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1317: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1573: undefined reference to `jpeg_destroy_decompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `ReadJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:717: undefined reference to `jpeg_std_error'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:734: undefined reference to `jpeg_CreateDecompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `JPEGSourceManager':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:632: undefined reference to `jpeg_resync_to_restart'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `ReadJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:736: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:737: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:738: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:741: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:742: undefined reference to `jpeg_read_header'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:776: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:783: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:823: undefined reference to `jpeg_start_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1055: undefined reference to `jpeg_destroy_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1069: undefined reference to `jpeg_destroy_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1101: undefined reference to `jpeg_read_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1198: undefined reference to `jpeg_finish_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1199: undefined reference to `jpeg_destroy_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:791: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `WriteJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1626: undefined reference to `jpeg_std_error'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1633: undefined reference to `jpeg_destroy_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1640: undefined reference to `jpeg_CreateCompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1679: undefined reference to `jpeg_set_defaults'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1765: undefined reference to `jpeg_simple_progression'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1780: undefined reference to `jpeg_set_quality'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1881: undefined reference to `jpeg_start_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2004: undefined reference to `jpeg_write_marker'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `WriteProfile':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1420: undefined reference to `jpeg_write_marker'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1473: undefined reference to `jpeg_write_marker'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1439: undefined reference to `jpeg_write_marker'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1491: undefined reference to `jpeg_write_marker'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `WriteJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2075: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2150: undefined reference to `jpeg_destroy_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1790: undefined reference to `jpeg_set_quality'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2141: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1782: undefined reference to `jpeg_set_quality'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2094: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2146: undefined reference to `jpeg_finish_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2031: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2114: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2051: undefined reference to `jpeg_write_scanlines'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `RegisterPNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:5796: undefined reference to `png_get_header_ver'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:5799: undefined reference to `png_get_libpng_ver'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_put_data':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1244: undefined reference to `png_get_io_ptr'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `PNGWarningHandler':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1416: undefined reference to `png_get_error_ptr'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1415: undefined reference to `png_error'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `PNGErrorHandler':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1400: undefined reference to `png_get_error_ptr'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `read_vpag_chunk_callback':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1570: undefined reference to `png_get_user_chunk_ptr'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_get_data':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1135: undefined reference to `png_get_io_ptr'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1150: undefined reference to `png_warning'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1151: undefined reference to `png_error'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `ReadOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1706: undefined reference to `png_create_read_struct_2'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1715: undefined reference to `png_create_info_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1721: undefined reference to `png_create_info_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1733: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1754: undefined reference to `png_set_sig_bytes'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1758: undefined reference to `png_permit_mng_features'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1759: undefined reference to `png_set_read_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1778: undefined reference to `png_set_keep_unknown_chunks'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1779: undefined reference to `png_set_keep_unknown_chunks'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1780: undefined reference to `png_set_keep_unknown_chunks'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1783: undefined reference to `png_set_read_user_chunk_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1802: undefined reference to `png_read_info'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1865: undefined reference to `png_get_sRGB'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1880: undefined reference to `png_get_gAMA'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1774: undefined reference to `png_set_read_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2101: undefined reference to `png_free_data'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2131: undefined reference to `png_set_interlace_handling'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2132: undefined reference to `png_read_update_info'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2437: undefined reference to `png_read_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2591: undefined reference to `png_read_end'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2596: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2175: undefined reference to `png_get_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2671: undefined reference to `png_get_text'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2796: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2234: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2128: undefined reference to `png_set_sBIT'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1924: undefined reference to `png_get_x_offset_pixels'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1925: undefined reference to `png_get_y_offset_pixels'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1840: undefined reference to `png_get_iCCP'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1892: undefined reference to `png_get_cHRM'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2288: undefined reference to `png_read_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1946: undefined reference to `png_get_pHYs'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1987: undefined reference to `png_get_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1993: undefined reference to `png_set_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2004: undefined reference to `png_set_tRNS'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2029: undefined reference to `png_set_bKGD'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1806: undefined reference to `png_set_packing'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2234: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1718: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1724: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2198: undefined reference to `png_get_PLTE'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `WriteOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6224: undefined reference to `png_create_write_struct_2'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6233: undefined reference to `png_create_info_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6239: undefined reference to `png_set_write_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6321: undefined reference to `png_set_pHYs'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6330: undefined reference to `png_set_oFFs'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6447: undefined reference to `png_set_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6980: undefined reference to `png_set_compression_buffer_size'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6985: undefined reference to `png_set_compression_mem_level'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6996: undefined reference to `png_set_compression_level'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7048: undefined reference to `png_set_filter'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7060: undefined reference to `png_set_iCCP'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6263: undefined reference to `png_permit_mng_features'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6369: undefined reference to `png_set_bKGD'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6251: undefined reference to `png_destroy_write_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7130: undefined reference to `png_set_sig_bytes'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7136: undefined reference to `png_write_info_before_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7139: undefined reference to `png_write_info'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7165: undefined reference to `png_set_packing'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7208: undefined reference to `png_set_interlace_handling'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7269: undefined reference to `png_write_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7333: undefined reference to `png_write_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7380: undefined reference to `png_malloc'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7394: undefined reference to `png_set_text'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7395: undefined reference to `png_free'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7306: undefined reference to `png_write_row'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_write_raw_profile':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6065: undefined reference to `png_malloc'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6069: undefined reference to `png_malloc'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6070: undefined reference to `png_malloc'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `WriteOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7437: undefined reference to `png_write_end'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7504: undefined reference to `png_destroy_write_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6980: undefined reference to `png_set_compression_buffer_size'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6236: undefined reference to `png_destroy_write_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7085: undefined reference to `png_set_sRGB'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7086: undefined reference to `png_set_gAMA'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_write_raw_profile':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6097: undefined reference to `png_set_text'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6098: undefined reference to `png_free'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6099: undefined reference to `png_free'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6100: undefined reference to `png_free'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `WriteOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7233: undefined reference to `png_write_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7123: undefined reference to `png_set_cHRM'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7100: undefined reference to `png_set_gAMA'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7003: undefined reference to `png_set_compression_strategy'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6961: undefined reference to `png_set_bKGD'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6817: undefined reference to `png_set_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6785: undefined reference to `png_set_PLTE'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_put_data':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1252: undefined reference to `png_error'
collect2: ld returned 1 exit status
g++ -g -O2 -Wall -W -pthread -I/home/jim/Magick++/include/ImageMagick -I/home/jim/Magick++/include/ImageMagick/Magick++ -o test_magick user/jim/test_magick.cc -L/home/jim/Magick++/lib/ -L/home/jim/libjpeg/lib/ -lfreetype -lz -lMagick++ -lMagickWand -lMagickCore
result:
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `ReadAVIImage':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1204: undefined reference to `jpeg_std_error'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1223: undefined reference to `jpeg_CreateDecompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `JPEGSourceManagerMemory':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:746: undefined reference to `jpeg_resync_to_restart'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `ReadAVIImage':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1225: undefined reference to `jpeg_read_header'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1214: undefined reference to `jpeg_destroy_decompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `JPEGSourceManagerBLOB':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:769: undefined reference to `jpeg_resync_to_restart'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-avi.o): In function `ReadAVIImage':
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1261: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1262: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1263: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1266: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1267: undefined reference to `jpeg_read_header'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1357: undefined reference to `jpeg_start_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1587: undefined reference to `jpeg_read_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1695: undefined reference to `jpeg_finish_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1325: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1310: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1317: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/avi.c:1573: undefined reference to `jpeg_destroy_decompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `ReadJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:717: undefined reference to `jpeg_std_error'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:734: undefined reference to `jpeg_CreateDecompress'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `JPEGSourceManager':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:632: undefined reference to `jpeg_resync_to_restart'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `ReadJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:736: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:737: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:738: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:741: undefined reference to `jpeg_set_marker_processor'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:742: undefined reference to `jpeg_read_header'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:776: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:783: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:823: undefined reference to `jpeg_start_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1055: undefined reference to `jpeg_destroy_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1069: undefined reference to `jpeg_destroy_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1101: undefined reference to `jpeg_read_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1198: undefined reference to `jpeg_finish_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1199: undefined reference to `jpeg_destroy_decompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:791: undefined reference to `jpeg_calc_output_dimensions'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `WriteJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1626: undefined reference to `jpeg_std_error'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1633: undefined reference to `jpeg_destroy_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1640: undefined reference to `jpeg_CreateCompress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1679: undefined reference to `jpeg_set_defaults'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1765: undefined reference to `jpeg_simple_progression'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1780: undefined reference to `jpeg_set_quality'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1881: undefined reference to `jpeg_start_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2004: undefined reference to `jpeg_write_marker'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `WriteProfile':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1420: undefined reference to `jpeg_write_marker'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1473: undefined reference to `jpeg_write_marker'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1439: undefined reference to `jpeg_write_marker'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1491: undefined reference to `jpeg_write_marker'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-jpeg.o): In function `WriteJPEGImage':
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2075: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2150: undefined reference to `jpeg_destroy_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1790: undefined reference to `jpeg_set_quality'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2141: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:1782: undefined reference to `jpeg_set_quality'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2094: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2146: undefined reference to `jpeg_finish_compress'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2031: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2114: undefined reference to `jpeg_write_scanlines'
/home/jim/ImageMagick-6.4.6-9/coders/jpeg.c:2051: undefined reference to `jpeg_write_scanlines'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `RegisterPNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:5796: undefined reference to `png_get_header_ver'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:5799: undefined reference to `png_get_libpng_ver'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_put_data':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1244: undefined reference to `png_get_io_ptr'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `PNGWarningHandler':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1416: undefined reference to `png_get_error_ptr'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1415: undefined reference to `png_error'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `PNGErrorHandler':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1400: undefined reference to `png_get_error_ptr'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `read_vpag_chunk_callback':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1570: undefined reference to `png_get_user_chunk_ptr'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_get_data':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1135: undefined reference to `png_get_io_ptr'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1150: undefined reference to `png_warning'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1151: undefined reference to `png_error'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `ReadOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1706: undefined reference to `png_create_read_struct_2'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1715: undefined reference to `png_create_info_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1721: undefined reference to `png_create_info_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1733: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1754: undefined reference to `png_set_sig_bytes'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1758: undefined reference to `png_permit_mng_features'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1759: undefined reference to `png_set_read_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1778: undefined reference to `png_set_keep_unknown_chunks'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1779: undefined reference to `png_set_keep_unknown_chunks'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1780: undefined reference to `png_set_keep_unknown_chunks'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1783: undefined reference to `png_set_read_user_chunk_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1802: undefined reference to `png_read_info'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1865: undefined reference to `png_get_sRGB'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1880: undefined reference to `png_get_gAMA'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1774: undefined reference to `png_set_read_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2101: undefined reference to `png_free_data'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2131: undefined reference to `png_set_interlace_handling'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2132: undefined reference to `png_read_update_info'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2437: undefined reference to `png_read_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2591: undefined reference to `png_read_end'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2596: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2175: undefined reference to `png_get_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2671: undefined reference to `png_get_text'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2796: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2234: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2128: undefined reference to `png_set_sBIT'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1924: undefined reference to `png_get_x_offset_pixels'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1925: undefined reference to `png_get_y_offset_pixels'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1840: undefined reference to `png_get_iCCP'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1892: undefined reference to `png_get_cHRM'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2288: undefined reference to `png_read_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1946: undefined reference to `png_get_pHYs'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1987: undefined reference to `png_get_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1993: undefined reference to `png_set_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2004: undefined reference to `png_set_tRNS'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2029: undefined reference to `png_set_bKGD'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1806: undefined reference to `png_set_packing'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2234: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1718: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1724: undefined reference to `png_destroy_read_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:2198: undefined reference to `png_get_PLTE'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `WriteOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6224: undefined reference to `png_create_write_struct_2'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6233: undefined reference to `png_create_info_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6239: undefined reference to `png_set_write_fn'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6321: undefined reference to `png_set_pHYs'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6330: undefined reference to `png_set_oFFs'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6447: undefined reference to `png_set_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6980: undefined reference to `png_set_compression_buffer_size'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6985: undefined reference to `png_set_compression_mem_level'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6996: undefined reference to `png_set_compression_level'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7048: undefined reference to `png_set_filter'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7060: undefined reference to `png_set_iCCP'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6263: undefined reference to `png_permit_mng_features'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6369: undefined reference to `png_set_bKGD'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6251: undefined reference to `png_destroy_write_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7130: undefined reference to `png_set_sig_bytes'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7136: undefined reference to `png_write_info_before_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7139: undefined reference to `png_write_info'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7165: undefined reference to `png_set_packing'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7208: undefined reference to `png_set_interlace_handling'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7269: undefined reference to `png_write_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7333: undefined reference to `png_write_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7380: undefined reference to `png_malloc'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7394: undefined reference to `png_set_text'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7395: undefined reference to `png_free'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7306: undefined reference to `png_write_row'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_write_raw_profile':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6065: undefined reference to `png_malloc'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6069: undefined reference to `png_malloc'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6070: undefined reference to `png_malloc'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `WriteOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7437: undefined reference to `png_write_end'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7504: undefined reference to `png_destroy_write_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6980: undefined reference to `png_set_compression_buffer_size'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6236: undefined reference to `png_destroy_write_struct'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7085: undefined reference to `png_set_sRGB'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7086: undefined reference to `png_set_gAMA'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_write_raw_profile':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6097: undefined reference to `png_set_text'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6098: undefined reference to `png_free'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6099: undefined reference to `png_free'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6100: undefined reference to `png_free'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `WriteOnePNGImage':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7233: undefined reference to `png_write_row'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7123: undefined reference to `png_set_cHRM'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7100: undefined reference to `png_set_gAMA'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:7003: undefined reference to `png_set_compression_strategy'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6961: undefined reference to `png_set_bKGD'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6817: undefined reference to `png_set_PLTE'
/home/jim/ImageMagick-6.4.6-9/coders/png.c:6785: undefined reference to `png_set_PLTE'
/home/jim/Magick++/lib//libMagickCore.a(magick_libMagickCore_la-png.o): In function `png_put_data':
/home/jim/ImageMagick-6.4.6-9/coders/png.c:1252: undefined reference to `png_error'
collect2: ld returned 1 exit status
Re: Compile failure with static-only libraries
I finally figured it out. You must do -I then -o -L in that order to g++.
Also you must add -lMagick++ -lMagickWand -lMagickCore -ljpeg -lpng in that order.
Also you must add -lMagick++ -lMagickWand -lMagickCore -ljpeg -lpng in that order.