Thread: [Dev-C++] Problem with libjpeg in Dev C++
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <lis...@da...> - 2003-08-02 07:47:10
|
Hello dev-cpp-users, I want to compile code from an OpenGL tutorial that uses libjpeg to read textures from a jpeg file. Unfortunatly, whenever I try to compile the code, I get linker errors for all libjpeg functions. (I use the -ljpeg parameter.) I searched the Dev C++ forums and a lot of other people seem to have the same problem, but none of them received a helpful reply. Maybe somebody here knows a sollution ? Thanks, Dennis |
|
From: <or...@vp...> - 2003-08-02 19:20:35
|
Dennis Möhlmann wrote: > Hello dev-cpp-users, > > I want to compile code from an OpenGL tutorial that uses libjpeg to read > textures from a jpeg file. Unfortunatly, whenever I try to compile the code, I > get linker errors for all libjpeg functions. (I use the -ljpeg parameter.) > > I searched the Dev C++ forums and a lot of other people seem to have the same > problem, but none of them received a helpful reply. Maybe somebody here knows > a sollution ? Yes, I know the solution. But I'll keep it a secret, until you tell me the errors you get. ;) -- Greetings, Balázs |
|
From: <lis...@da...> - 2003-08-03 08:02:23
|
Oops, didn't know the linker can any other error messages than this one (never received a different error so far...) (hope this doesn't get wrapped...) g++.exe ../_obj/BlackMagic3D.o ../_obj/world.o ../_obj/entity.o ../_obj/engine.o ../_obj/model.o ../_obj/winmsg.o ../_obj/viewport.o ../_obj/keyboard.o ../_obj/renderer.o ../_obj/image.o -o "..\_exe\BlackMagic3D.exe" -L"C:/Programme/Dev-Cpp/lib" -mwindows -lopengl32 -lglu32 -lglaux -lwinmm -ljpeg ../_obj/image.o(.text+0x68e):image.cpp: undefined reference to `jpeg_std_error(jpeg_error_mgr*)' ../_obj/image.o(.text+0x6ad):image.cpp: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned)' ../_obj/image.o(.text+0x6c2):image.cpp: undefined reference to `jpeg_stdio_src(jpeg_decompress_struct*, _iobuf*)' ../_obj/image.o(.text+0x6d6):image.cpp: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)' ../_obj/image.o(.text+0x6e8):image.cpp: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)' ../_obj/image.o(.text+0x7f0):image.cpp: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)' ../_obj/image.o(.text+0x828):image.cpp: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)' ../_obj/image.o(.text+0x83a):image.cpp: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)' Your Message: (Saturday, August 02, 2003, 9:20:42 PM) OB> Dennis Möhlmann wrote: >> Hello dev-cpp-users, >> >> I want to compile code from an OpenGL tutorial that uses libjpeg to read >> textures from a jpeg file. Unfortunatly, whenever I try to compile the code, I >> get linker errors for all libjpeg functions. (I use the -ljpeg parameter.) >> >> I searched the Dev C++ forums and a lot of other people seem to have the same >> problem, but none of them received a helpful reply. Maybe somebody here knows >> a sollution ? OB> Yes, I know the solution. OB> But I'll keep it a secret, until you tell me the errors you get. ;) OB> -- OB> Greetings, OB> Balázs -- Best regards, Dennis mailto:lis...@da... |
|
From: <or...@vp...> - 2003-08-03 08:51:32
|
Dennis Möhlmann wrote: > Oops, didn't know the linker can any other error messages than this one (never > received a different error so far...) > > (hope this doesn't get wrapped...) > > g++.exe ../_obj/BlackMagic3D.o ../_obj/world.o ../_obj/entity.o ../_obj/engine.o ../_obj/model.o ../_obj/winmsg.o ../_obj/viewport.o ../_obj/keyboard.o ../_obj/renderer.o ../_obj/image.o -o "..\_exe\BlackMagic3D.exe" -L"C:/Programme/Dev-Cpp/lib" -mwindows -lopengl32 -lglu32 -lglaux -lwinmm -ljpeg > > ../_obj/image.o(.text+0x68e):image.cpp: undefined reference to `jpeg_std_error(jpeg_error_mgr*)' > ../_obj/image.o(.text+0x6ad):image.cpp: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned)' > ../_obj/image.o(.text+0x6c2):image.cpp: undefined reference to `jpeg_stdio_src(jpeg_decompress_struct*, _iobuf*)' > ../_obj/image.o(.text+0x6d6):image.cpp: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)' > ../_obj/image.o(.text+0x6e8):image.cpp: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)' > ../_obj/image.o(.text+0x7f0):image.cpp: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)' > ../_obj/image.o(.text+0x828):image.cpp: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)' > ../_obj/image.o(.text+0x83a):image.cpp: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)' Well, it sais, it has undefined references of jpeg functions. I have no idea though why it has them, as the jpeg library has these functions. Maybe you should try to recompile the jpeg library from the code. -- Greetings, Balázs |
|
From: <lis...@da...> - 2003-08-03 19:52:37
|
I will try that, once I find the sources... Thanks for your reply! Your Message: (Sunday, August 03, 2003, 10:51:28 AM) OB> Dennis Möhlmann wrote: >> Oops, didn't know the linker can any other error messages than this one (never >> received a different error so far...) >> >> (hope this doesn't get wrapped...) >> >> g++.exe ../_obj/BlackMagic3D.o ../_obj/world.o ../_obj/entity.o ../_obj/engine.o ../_obj/model.o ../_obj/winmsg.o ../_obj/viewport.o ../_obj/keyboard.o ../_obj/renderer.o ../_obj/image.o -o >> "..\_exe\BlackMagic3D.exe" -L"C:/Programme/Dev-Cpp/lib" -mwindows -lopengl32 -lglu32 -lglaux -lwinmm -ljpeg >> >> ../_obj/image.o(.text+0x68e):image.cpp: undefined reference to `jpeg_std_error(jpeg_error_mgr*)' >> ../_obj/image.o(.text+0x6ad):image.cpp: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned)' >> ../_obj/image.o(.text+0x6c2):image.cpp: undefined reference to `jpeg_stdio_src(jpeg_decompress_struct*, _iobuf*)' >> ../_obj/image.o(.text+0x6d6):image.cpp: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)' >> ../_obj/image.o(.text+0x6e8):image.cpp: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)' >> ../_obj/image.o(.text+0x7f0):image.cpp: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)' >> ../_obj/image.o(.text+0x828):image.cpp: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)' >> ../_obj/image.o(.text+0x83a):image.cpp: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)' OB> Well, it sais, it has undefined references of jpeg functions. OB> I have no idea though why it has them, as the jpeg library has these OB> functions. OB> Maybe you should try to recompile the jpeg library from the code. OB> -- OB> Greetings, OB> Balázs -- Best regards, Dennis mailto:lis...@da... |
|
From: Per W. <pw...@ia...> - 2003-08-06 11:30:17
|
Are you compiling a c++ program? The jpeg library is in C. Did you
remember to specify
extern "C" {
#include xxx
}
when including the jpeg include files?
As you can see, the linker doesn't just complain about
missing symbol _jpeg_std_error, but actually knows about what parameter
types the function takes. This is because your source code is trying to
call the jpeg functions in C++ mode, i.e. with name-mangled external
references.
/Per W
> Thanks for your reply!
>
> Your Message: (Sunday, August 03, 2003, 10:51:28 AM)
>
> OB> Dennis M=F6hlmann wrote:
>
> >> Oops, didn't know the linker can any other error messages than this =
one (never
> >> received a different error so far...)
> >>
> >> (hope this doesn't get wrapped...)
> >>
> >> g++.exe ../_obj/BlackMagic3D.o ../_obj/world.o ../_obj/entity.o ../_ob=
j/engine.o ../_obj/model.o ../_obj/winmsg.o ../_obj/viewport.o ../_obj/keyb=
oard.o ../_obj/renderer.o ../_obj/image.o -o
> >> "..\_exe\BlackMagic3D.exe" -L"C:/Programme/Dev-Cpp/lib" -mwindows -lop=
engl32 -lglu32 -lglaux -lwinmm -ljpeg
> >>
> >> ../_obj/image.o(.text+0x68e):image.cpp: undefined reference to `jpeg_s=
td_error(jpeg_error_mgr*)'
> >> ../_obj/image.o(.text+0x6ad):image.cpp: undefined reference to `jpeg_C=
reateDecompress(jpeg_decompress_struct*, int, unsigned)'
> >> ../_obj/image.o(.text+0x6c2):image.cpp: undefined reference to `jpeg_s=
tdio_src(jpeg_decompress_struct*, _iobuf*)'
> >> ../_obj/image.o(.text+0x6d6):image.cpp: undefined reference to `jpeg_r=
ead_header(jpeg_decompress_struct*, int)'
> >> ../_obj/image.o(.text+0x6e8):image.cpp: undefined reference to `jpeg_s=
tart_decompress(jpeg_decompress_struct*)'
> >> ../_obj/image.o(.text+0x7f0):image.cpp: undefined reference to `jpeg_r=
ead_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)'
> >> ../_obj/image.o(.text+0x828):image.cpp: undefined reference to `jpeg_f=
inish_decompress(jpeg_decompress_struct*)'
> >> ../_obj/image.o(.text+0x83a):image.cpp: undefined reference to `jpeg_d=
estroy_decompress(jpeg_decompress_struct*)'
>
> OB> Well, it sais, it has undefined references of jpeg functions.
> OB> I have no idea though why it has them, as the jpeg library has these
> OB> functions.
> OB> Maybe you should try to recompile the jpeg library from the code.
>
> OB> --
> OB> Greetings,
> OB> Bal=E1zs
>
> --
> Best regards,
> Dennis mailto:lis...@da...
>
>
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/=
01
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: <lis...@da...> - 2003-08-07 12:39:20
|
Hello dev-cpp-users; hello Per,
thanks for your reply! I didn't even know about extern (newbie at work ;)),
but now that I added it, everything works perfectly fine. Thanks again!
Your Message: (Wednesday, August 06, 2003, 1:29:05 PM)
PW> Are you compiling a c++ program? The jpeg library is in C. Did you
PW> remember to specify
PW> extern "C" {
PW> #include xxx
PW> }
PW> when including the jpeg include files?
PW> As you can see, the linker doesn't just complain about
PW> missing symbol _jpeg_std_error, but actually knows about what parameter
PW> types the function takes. This is because your source code is trying to
PW> call the jpeg functions in C++ mode, i.e. with name-mangled external
PW> references.
PW> /Per W
>> Thanks for your reply!
>>
>> Your Message: (Sunday, August 03, 2003, 10:51:28 AM)
>>
>> OB> Dennis Möhlmann wrote:
>>
>> >> Oops, didn't know the linker can any other error messages than this one (never
>> >> received a different error so far...)
>> >>
>> >> (hope this doesn't get wrapped...)
>> >>
>> >> g++.exe ../_obj/BlackMagic3D.o ../_obj/world.o ../_obj/entity.o ../_obj/engine.o ../_obj/model.o ../_obj/winmsg.o ../_obj/viewport.o ../_obj/keyboard.o ../_obj/renderer.o ../_obj/image.o -o
>> >> "..\_exe\BlackMagic3D.exe" -L"C:/Programme/Dev-Cpp/lib" -mwindows -lopengl32 -lglu32 -lglaux -lwinmm -ljpeg
>> >>
>> >> ../_obj/image.o(.text+0x68e):image.cpp: undefined reference to `jpeg_std_error(jpeg_error_mgr*)'
>> >> ../_obj/image.o(.text+0x6ad):image.cpp: undefined reference to `jpeg_CreateDecompress(jpeg_decompress_struct*, int, unsigned)'
>> >> ../_obj/image.o(.text+0x6c2):image.cpp: undefined reference to `jpeg_stdio_src(jpeg_decompress_struct*, _iobuf*)'
>> >> ../_obj/image.o(.text+0x6d6):image.cpp: undefined reference to `jpeg_read_header(jpeg_decompress_struct*, int)'
>> >> ../_obj/image.o(.text+0x6e8):image.cpp: undefined reference to `jpeg_start_decompress(jpeg_decompress_struct*)'
>> >> ../_obj/image.o(.text+0x7f0):image.cpp: undefined reference to `jpeg_read_scanlines(jpeg_decompress_struct*, unsigned char**, unsigned)'
>> >> ../_obj/image.o(.text+0x828):image.cpp: undefined reference to `jpeg_finish_decompress(jpeg_decompress_struct*)'
>> >> ../_obj/image.o(.text+0x83a):image.cpp: undefined reference to `jpeg_destroy_decompress(jpeg_decompress_struct*)'
>>
>> OB> Well, it sais, it has undefined references of jpeg functions.
>> OB> I have no idea though why it has them, as the jpeg library has these
>> OB> functions.
>> OB> Maybe you should try to recompile the jpeg library from the code.
>>
>> OB> --
>> OB> Greetings,
>> OB> Balázs
>>
>> --
>> Best regards,
>> Dennis mailto:lis...@da...
--
Best regards,
Dennis mailto:lis...@da...
|