Setting Up Dev-cpp


MattPurland

Still Fresh
Joined
Jun 26, 2006
Messages
38
Hi, I've followed the tutorial on the wiki (http://wiki.gp2x.org/wiki/Using_Devcpp) for setting up dev-cpp with the devkitgp2x but I get the following error:

File format not recognized
G:\My Documents\Work\PNGTest\Makefile.win [Build Error] [PNGTest.gpe] Error 1

I'm a bit of a n00b at this, but any idea's why it would give this error? I've double checked the setup many times and I can't see where I've gone wrong :(

Cheers!
 
Any ideas? I've replaced the devkitGP2X with a newer one (HW SDL, etc) and I get the following:

no input files
G:\My Documents\Work\PNGTest\Makefile.win [Build Error] [main.o] Error 1

I don't undsertand why it can't find main.cpp :(
 
Someone had a similar problem a while ago on this forum. Have a little dig in the old posts and see if you can find it. I use codeblocks myself so I can't help. Sorry.
 
I've given up on dev-cpp and gone for codeblocks. Better results but I get this when compiling:

Code:
Project   : AirFighterSDL
Compiler  : GP2X (called directly)
Directory : G:\My Documents\Work\AirFighterSDL\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
Linking executable: G:\My Documents\Work\AirFighterSDL\AirFighterSDL.gpe
C:\devkitGP2X\lib\libSDL_image.a(IMG_jpg.o): In function `jpeg_SDL_RW_src':
IMG_jpg.c:(.text+0x38c): undefined reference to `jpeg_resync_to_restart'
C:\devkitGP2X\lib\libSDL_image.a(IMG_jpg.o): In function `IMG_LoadJPG_RW':
IMG_jpg.c:(.text+0x41c): undefined reference to `jpeg_std_error'
IMG_jpg.c:(.text+0x45c): undefined reference to `jpeg_destroy_decompress'
IMG_jpg.c:(.text+0x490): undefined reference to `jpeg_CreateDecompress'
IMG_jpg.c:(.text+0x4b0): undefined reference to `jpeg_read_header'
IMG_jpg.c:(.text+0x4cc): undefined reference to `jpeg_calc_output_dimensions'
IMG_jpg.c:(.text+0x53c): undefined reference to `jpeg_start_decompress'
IMG_jpg.c:(.text+0x57c): undefined reference to `jpeg_read_scanlines'
IMG_jpg.c:(.text+0x598): undefined reference to `jpeg_finish_decompress'
IMG_jpg.c:(.text+0x5a4): undefined reference to `jpeg_destroy_decompress'
C:\devkitGP2X\lib\libSDL_image.a(IMG_png.o): In function `IMG_isPNG':
IMG_png.c:(.text+0x60): undefined reference to `png_sig_cmp'
C:\devkitGP2X\lib\libSDL_image.a(IMG_png.o): In function `png_read_data':
IMG_png.c:(.text+0xa8): undefined reference to `png_get_io_ptr'
C:\devkitGP2X\lib\libSDL_image.a(IMG_png.o): In function `IMG_LoadPNG_RW':
IMG_png.c:(.text+0x144): undefined reference to `png_create_read_struct'
IMG_png.c:(.text+0x170): undefined reference to `png_create_info_struct'
IMG_png.c:(.text+0x1c8): undefined reference to `png_set_read_fn'
IMG_png.c:(.text+0x1dc): undefined reference to `png_read_info'
IMG_png.c:(.text+0x224): undefined reference to `png_get_IHDR'
IMG_png.c:(.text+0x230): undefined reference to `png_set_strip_16'
IMG_png.c:(.text+0x23c): undefined reference to `png_set_packing'
IMG_png.c:(.text+0x254): undefined reference to `png_set_expand'
IMG_png.c:(.text+0x26c): undefined reference to `png_get_valid'
IMG_png.c:(.text+0x2a0): undefined reference to `png_get_tRNS'
IMG_png.c:(.text+0x34c): undefined reference to `png_set_expand'
IMG_png.c:(.text+0x370): undefined reference to `png_set_gray_to_rgb'
IMG_png.c:(.text+0x384): undefined reference to `png_read_update_info'
IMG_png.c:(.text+0x3cc): undefined reference to `png_get_IHDR'
IMG_png.c:(.text+0x5e8): undefined reference to `png_read_image'
IMG_png.c:(.text+0x7bc): undefined reference to `png_destroy_read_struct'
Process terminated with status 1 (0 minutes, 1 seconds)
0 errors, 0 warnings

Any ideas?
 
Yep, you need to link with libjpeg and libpng (if I'm not mistaken)

(Add -ljpeg and -lpng to the link part of your makefile)
 
I'm not using any jpeg's but ok :D

Edit:
Now I get this error, any ideas?

Code:
Project   : AirFighterSDL
Compiler  : GP2X (called directly)
Directory : G:\My Documents\Work\AirFighterSDL\
--------------------------------------------------------------------------------
Switching to target: default
Linking executable: G:\My Documents\Work\AirFighterSDL\AirFighterSDL.gpe
C:\devkitGP2X\lib\libpng.a(png.o): In function `png_reset_crc':
png.c:(.text+0x118): undefined reference to `crc32'
C:\devkitGP2X\lib\libpng.a(png.o): In function `png_calculate_crc':
png.c:(.text+0x14c): undefined reference to `crc32'
png.c:(.text+0x168): undefined reference to `crc32'
C:\devkitGP2X\lib\libpng.a(png.o): In function `png_reset_zstream':
png.c:(.text+0x4a4): undefined reference to `inflateReset'
C:\devkitGP2X\lib\libpng.a(pngread.o): In function `png_create_read_struct_2':
pngread.c:(.text+0x194): undefined reference to `inflateInit_'
C:\devkitGP2X\lib\libpng.a(pngread.o): In function `png_read_init_3':
pngread.c:(.text+0x3d0): undefined reference to `inflateInit_'
C:\devkitGP2X\lib\libpng.a(pngread.o): In function `png_read_row':
pngread.c:(.text+0xd20): undefined reference to `inflate'
C:\devkitGP2X\lib\libpng.a(pngread.o): In function `png_read_destroy':
pngread.c:(.text+0x1dd4): undefined reference to `inflateEnd'
C:\devkitGP2X\lib\libpng.a(pngrutil.o): In function `png_decompress_chunk':
pngrutil.c:(.text+0xfc): undefined reference to `inflate'
pngrutil.c:(.text+0x220): undefined reference to `inflateReset'
pngrutil.c:(.text+0x32c): undefined reference to `inflateReset'
C:\devkitGP2X\lib\libpng.a(pngrutil.o): In function `png_read_finish_row':
pngrutil.c:(.text+0x5b98): undefined reference to `inflate'
pngrutil.c:(.text+0x5c24): undefined reference to `inflateReset'
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
Can I see your linker line? eg
-static -lSDL etc

Also, did you manage to get the example to compile from the Wiki tutorial?
 
This is my linker line:

-static -lSDL_ttf -lSDL_image -lSDL -lfreetype -lpthread -ljpeg -lpng

I'll try the test program now

ooh it compiled, thanks Mr. Blah!
 
Back
Top