Здравствуйте!
Возможно ли скомпилировать код написанный на С(чистом С) компилятором g++?
Если да, то как?
А то у меня компилятор что-то ругается:
---
$g++ 4.c jdatasrc.c -ljpeg -L/usr/X11/lib/ -lX11 -lXpm -lXext -lm -lXv
/tmp/cc2m24Ip.o(.text+0x9f5): In function `read_JPEG_buffer(unsigned char*, imagem*, unsigned)':
4.c: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
/tmp/cc2m24Ip.o(.text+0xa32):4.c: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xa44):4.c: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xa7c):4.c: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned)'
/tmp/cc2m24Ip.o(.text+0xab8):4.c: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)'
/tmp/cc2m24Ip.o(.text+0xaca):4.c: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xb84):4.c: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)'
/tmp/cc2m24Ip.o(.text+0xbcd):4.c: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xbdf):4.c: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xc69): In function `read_JPEG_file(char*, imagem*)':
4.c: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
/tmp/cc2m24Ip.o(.text+0xca6):4.c: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xcb8):4.c: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xcf1):4.c: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned)'
/tmp/cc2m24Ip.o(.text+0xd09):4.c: undefined reference to `jpeg_stdio_src(jpeg_decompress_struct*, _IO_FILE*)'
/tmp/cc2m24Ip.o(.text+0xd1d):4.c: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)'
/tmp/cc2m24Ip.o(.text+0xd2f):4.c: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xde9):4.c: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)'
/tmp/cc2m24Ip.o(.text+0xe32):4.c: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)'
/tmp/cc2m24Ip.o(.text+0xe44):4.c: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
/tmp/ccP4sIcJ.o(.text+0x1fc): In function `jpeg_buffer_src(jpeg_decompress_struct*, unsigned char*, unsigned)':
jdatasrc.c: undefined reference to `jpeg_resync_to_restart(jpeg_decompress_struct*, int)'
collect2: ld returned 1 exit status
---
Если компилировать с помощью gcc то все в порядке:
---
gcc 4.c jdatasrc.c -ljpeg -L/usr/X11/lib/ -lX11 -lXpm -lXext -lm -lXv
---
Спасибо!