|
This thread is locked; no one can reply to it. |
1
2
|
clear_to_color problem |
Richard Phipps
Member #1,632
November 2001
|
I've just changed my project from using a dynamic linked 4.0.3 allegro version to a static linked 4.1.14. Despite make failing when creating the docs, (using GCC 2.95) the library seems ok. However my program now crashes using: void clear_to_color(BITMAP *bitmap, int color); so: clear_to_color(bmp, 0); crashes.. Anyone else had this? |
ReyBrujo
Moderator
January 2001
|
Obvious questions: bmp is a valid pointer? I have seen someone passed three parameters to clear_to_color... has it changed in the WIP? -- |
Richard Phipps
Member #1,632
November 2001
|
Yes, no code changed, but it suddenly started crashing on clear_to_color. I'm not sure whether the lib was built ok, it seems to have been.. Plus, I've gone from 4.0.3 to 4.1.14 so I'm not sure if this the cause. |
X-G
Member #856
December 2000
|
Base check: Did you recompile your entire project, deleting all intermediate files first, after changing to the WIP? -- |
Richard Phipps
Member #1,632
November 2001
|
Yes, all object files were deleted. Compiling with static linking no problems. GDB doesn't seem to help. Changing to clear_bitmap(bmp); works.. But I do need to be able to clear to a colour in some cases. |
ReyBrujo
Moderator
January 2001
|
And if you pass a color, it hungs? Try compiling your program with the debug allegro library, triggering gdb, and letting it hung. You set up your GFX mode before calling it? -- |
Richard Phipps
Member #1,632
November 2001
|
I tried using GDB it shows _mangled main after the clear_to_colour. I just recompiled the exhello example with static linking and 640 x 480 (my LCD monitor can't display less than this). It also crashes. EDIT: commenting out the clear_to_colour line makes it work fine. |
ReyBrujo
Moderator
January 2001
|
Can you create the smallest program triggering the error? And you cannot debug with GDB, unless you put a breakpoint in the clear_to_color call. MinGW? -- |
Richard Phipps
Member #1,632
November 2001
|
I'm not sure about GDB, I use MinGW yes.. |
ReyBrujo
Moderator
January 2001
|
I have WIP 13 installed. Can you give me the command line to compile the file? Sorry, I don't have the WIP in source, wiped it after installing. I want to see if I can reproduce it with the previous WIP. -- |
Richard Phipps
Member #1,632
November 2001
|
Hmmm.. Quote: gcc.exe "C:\Allegro\examples\exhello.c" -o "C:\Allegro\examples\exhello.exe" -DALLEGRO_STATICLINK -fexpensive-optimizations -g3 -mwindows -I"C:\Dev-CPP\include" -L"C:\Dev-CPP\lib" -lalleg_s -lgdi32 -ldxguid -lole32 -ldinput -lddraw -lwinmm -ldsound This WORKS. Quote: gcc.exe "C:\Allegro\examples\exhello.c" -o "C:\Allegro\examples\exhello.exe" -DALLEGRO_STATICLINK -fexpensive-optimizations -O3 -g3 -mwindows -I"C:\Dev-CPP\include" -L"C:\Dev-CPP\lib" -lalleg_s -lgdi32 -ldxguid -lole32 -ldinput -lddraw -lwinmm -ldsound This crashes to desktop and puts windows into 640 x 480 x 8bit mode. The -O3 seems to cause the crash! |
ReyBrujo
Moderator
January 2001
|
Hmm... some optimization went wierd... try -O2 (I don't know why people use -O3 in projects that are not C++). -- |
X-G
Member #856
December 2000
|
-O3 is a pretty aggressive optimization level that some times breaks programs. -O2 is really the max you can go for safely... -- |
Richard Phipps
Member #1,632
November 2001
|
Quote: -O3 is a pretty aggressive optimization level that some times breaks programs. -O2 is really the max you can go for safely... I didn't know this. Uhhhh.. Guys. -O or -O2 crashes as well.. Only no optimization makes it work (and this it the exhello example here). Can anyone else test this? |
ReyBrujo
Moderator
January 2001
|
Just noticed I didn't have the static libraries. Will test with the latest WIP on MSVC. -- |
Richard Phipps
Member #1,632
November 2001
|
I just downloaded the 4.1.13, make and make install (with STATICLINK=1) reported no problems. Trying to compile the exhello program with any optimization still crashes. |
ReyBrujo
Moderator
January 2001
|
Your example with the 4.1.14 and the command line you said that did not work... worked here. So, it must be something there... -- |
Richard Phipps
Member #1,632
November 2001
|
Oh damn. EDIT: That is with the -O3 optimization? |
ReyBrujo
Moderator
January 2001
|
Yep, worked with them, and without the Dev-C++ paths. Maybe those paths are messing something up? -- |
Richard Phipps
Member #1,632
November 2001
|
I have an older GCC, v2.95 I think. Is it possibly related to this? |
ReyBrujo
Moderator
January 2001
|
Hmm... I have that version at home, not here. I will check it out later today (8 or so hours from now). I doubt it is related to GCC, though. -- |
Sirocco
Member #88
April 2000
|
Side note: On older version of Allegro 3.xx, clear_to_color() regularly failed on me, which was why I almost never used it prior to migrating to 4.xx. I also had similar problems assigning sub-bitmaps, but that's another story entirely ^.^ --> |
Richard Phipps
Member #1,632
November 2001
|
Well, dynamic linking with 4.1.13 or 4.1.14 doesn't work either. Despite doing a make uninstall and a clean build. It looks like I'm stuck with 4.0.3 then. |
Evert
Member #794
November 2000
|
Quote: I have an older GCC, v2.95 I think. Is it possibly related to this?
Possibly - I'll have a look at the problem when I get home and see if I can trace it to the source. |
Richard Phipps
Member #1,632
November 2001
|
I did download the latest GCC file, but it crashes winace and winzip can't read it. Gah! Anyway, I need to do some more programming on my game now as I have a lot to do. I'll try to look at this when it's done.. |
|
1
2
|