Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Run-time Error

This thread is locked; no one can reply to it. rss feed Print
Run-time Error
ajsuson
Member #14,202
April 2012

Sorry to keep you guys waiting. However, this is about Allegro 4.2 with the use of C with Mappy. And, I would like to show you the source code I made so far. Though, it was messy. As I compile it, I have so much Mappy warnings when using my laptop. But, while using desktop, the program crashed. Is there something that I must fix. Sorry to ask you about it even I should be the one do something about it myself without asking. Yeah, I have a file for you to view and compile. The latest 4.2 is a must and I have some file you need.

Edgar Reynaldo
Member #8,592
May 2007
avatar

ajsuson
Member #14,202
April 2012

Sorry to ask. How do I do that again in Dev-C++?

AceBlkwell
Member #13,038
July 2011

ajsuson,

I'm far from an expert but I do use Dev-Cpp when in Windows. I haven't used the command line options very often.

I click Project in the menu along the top, then choose the Project Option. In the project option box there are multiple tabs. Parameter option is fourth on along the top. (on my version, though most are in the same area give or take a tab) Within the Parameter tab is Compiler, C++ Compiler, and Linker boxes. You can add the -g command to the Compiler or C++ Compiler boxes and see if that works.

Let me know how it turns out.

Ace

ajsuson
Member #14,202
April 2012

#SelectExpand
1Compiler: Default compiler 2Building Makefile: "G:\Projects\Games\Lacdoh's Snowlody\sources\Push_Ice\Makefile.win" 3Executing make... 4make.exe -f "G:\Projects\Games\Lacdoh's Snowlody\sources\Push_Ice\Makefile.win" all 5gcc.exe -D__DEBUG__ -c mappyal.c -o mappyal.o -I"C:/Dev-Cpp/include" -I"C:/Allegro/allegro-mingw-4.2.3/include" -g3 6 7In file included from mappyal.c:7: 8C:/Dev-Cpp/include/stdio.h:210: error: syntax error before "__gnuc_va_list" 9C:/Dev-Cpp/include/stdio.h:211: error: syntax error before "__gnuc_va_list" 10C:/Dev-Cpp/include/stdio.h:212: error: syntax error before "__gnuc_va_list" 11C:/Dev-Cpp/include/stdio.h:213: error: syntax error before "__gnuc_va_list" 12C:/Dev-Cpp/include/stdio.h:218: error: syntax error before "__gnuc_va_list" 13 14C:/Dev-Cpp/include/stdio.h: In function `vsnprintf': 15C:/Dev-Cpp/include/stdio.h:219: error: `s' undeclared (first use in this function) 16C:/Dev-Cpp/include/stdio.h:219: error: (Each undeclared identifier is reported only once 17C:/Dev-Cpp/include/stdio.h:219: error: for each function it appears in.) 18C:/Dev-Cpp/include/stdio.h:219: error: `n' undeclared (first use in this function) 19C:/Dev-Cpp/include/stdio.h:219: error: `format' undeclared (first use in this function) 20C:/Dev-Cpp/include/stdio.h:219: error: `arg' undeclared (first use in this function) 21C:/Dev-Cpp/include/stdio.h: At top level: 22C:/Dev-Cpp/include/stdio.h:220: error: syntax error before "__gnuc_va_list" 23C:/Dev-Cpp/include/stdio.h:222: error: syntax error before "__gnuc_va_list" 24C:/Dev-Cpp/include/stdio.h:224: error: syntax error before "__gnuc_va_list" 25 26In file included from mappyal.c:7: 27C:/Dev-Cpp/include/stdio.h:432: error: syntax error before "__gnuc_va_list" 28C:/Dev-Cpp/include/stdio.h:433: error: syntax error before "__gnuc_va_list" 29C:/Dev-Cpp/include/stdio.h:434: error: syntax error before "__gnuc_va_list" 30C:/Dev-Cpp/include/stdio.h:435: error: syntax error before "__gnuc_va_list" 31C:/Dev-Cpp/include/stdio.h:439: warning: `__cdecl__' attribute only applies to function types 32C:/Dev-Cpp/include/stdio.h:439: error: syntax error before "fgetwc" 33C:/Dev-Cpp/include/stdio.h:440: warning: `__cdecl__' attribute only applies to function types 34C:/Dev-Cpp/include/stdio.h:440: error: syntax error before "fputwc" 35 36C:/Dev-Cpp/include/stdio.h:441: warning: `__cdecl__' attribute only applies to function types 37C:/Dev-Cpp/include/stdio.h:441: error: syntax error before "ungetwc" 38C:/Dev-Cpp/include/stdio.h:446: warning: `__cdecl__' attribute only applies to function types 39C:/Dev-Cpp/include/stdio.h:446: error: syntax error before "getwc" 40C:/Dev-Cpp/include/stdio.h:447: warning: `__cdecl__' attribute only applies to function types 41C:/Dev-Cpp/include/stdio.h:447: error: syntax error before "getwchar" 42C:/Dev-Cpp/include/stdio.h:449: warning: `__cdecl__' attribute only applies to function types 43C:/Dev-Cpp/include/stdio.h:449: error: syntax error before "putwc" 44C:/Dev-Cpp/include/stdio.h:451: warning: `__cdecl__' attribute only applies to function types 45 46C:/Dev-Cpp/include/stdio.h:451: error: syntax error before "putwchar" 47C:/Dev-Cpp/include/stdio.h:467: error: syntax error before "__gnuc_va_list" 48C:/Dev-Cpp/include/stdio.h: In function `vsnwprintf': 49C:/Dev-Cpp/include/stdio.h:468: error: `s' undeclared (first use in this function) 50C:/Dev-Cpp/include/stdio.h:468: error: `n' undeclared (first use in this function) 51C:/Dev-Cpp/include/stdio.h:468: error: `format' undeclared (first use in this function) 52C:/Dev-Cpp/include/stdio.h:468: error: `arg' undeclared (first use in this function) 53C:/Dev-Cpp/include/stdio.h: At top level: 54C:/Dev-Cpp/include/stdio.h:469: error: syntax error before "__gnuc_va_list" 55C:/Dev-Cpp/include/stdio.h:471: error: syntax error before "__gnuc_va_list" 56C:/Dev-Cpp/include/stdio.h:473: error: syntax error before "__gnuc_va_list" 57C:/Dev-Cpp/include/stdio.h:489: warning: `__cdecl__' attribute only applies to function types 58C:/Dev-Cpp/include/stdio.h:489: error: syntax error before "_fgetwchar" 59C:/Dev-Cpp/include/stdio.h:490: warning: `__cdecl__' attribute only applies to function types 60C:/Dev-Cpp/include/stdio.h:490: error: syntax error before "_fputwchar" 61C:/Dev-Cpp/include/stdio.h:495: warning: `__cdecl__' attribute only applies to function types 62C:/Dev-Cpp/include/stdio.h:495: error: syntax error before "fgetwchar" 63C:/Dev-Cpp/include/stdio.h:496: warning: `__cdecl__' attribute only applies to function types 64C:/Dev-Cpp/include/stdio.h:496: error: syntax error before "fputwchar" 65 66mappyal.c: In function `MapRelocate2': 67mappyal.c:576: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 68mappyal.c:581: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 69 70mappyal.c:608: warning: use of cast expressions as lvalues is deprecated 71mappyal.c:610: warning: use of cast expressions as lvalues is deprecated 72mappyal.c:612: warning: use of cast expressions as lvalues is deprecated 73mappyal.c:614: warning: use of cast expressions as lvalues is deprecated 74 75mappyal.c: In function `MapDrawParallax': 76mappyal.c:1319: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 77 78mappyal.c:1349: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 79 80mappyal.c: In function `MapDrawBG': 81mappyal.c:1369: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 82mappyal.c:1415: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 83mappyal.c: In function `MapDrawBGT': 84mappyal.c:1439: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 85mappyal.c:1463: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 86mappyal.c: In function `MapDrawFG': 87mappyal.c:1485: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 88mappyal.c:1533: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 89mappyal.c: In function `MapDrawRow': 90 91mappyal.c:1562: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 92mappyal.c:1620: warning: `set_clip' is deprecated (declared at C:/Allegro/allegro-mingw-4.2.3/include/allegro/alcompat.h:207) 93 94make.exe: *** [mappyal.o] Error 1 95 96Execution terminated

Is there something I should do to fix this stdio.h? Probably, something wrong with stdio.h as if it's not reading at all after making some simple code known as "Hello, World" back there. Like this one:

#SelectExpand
1Compiler: Default compiler 2Executing gcc.exe... 3gcc.exe "C:\Users\ajsuson\Documents\hello.c" -o "C:\Users\ajsuson\Documents\hello.exe" -g3 -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3 4In file included from C:\Users\ajsuson\Documents\hello.c:1: 5C:/Dev-Cpp/include/stdio.h:210: error: syntax error before "__gnuc_va_list" 6C:/Dev-Cpp/include/stdio.h:211: error: syntax error before "__gnuc_va_list" 7C:/Dev-Cpp/include/stdio.h:212: error: syntax error before "__gnuc_va_list" 8C:/Dev-Cpp/include/stdio.h:213: error: syntax error before "__gnuc_va_list" 9C:/Dev-Cpp/include/stdio.h:218: error: syntax error before "__gnuc_va_list" 10C:/Dev-Cpp/include/stdio.h: In function `vsnprintf': 11C:/Dev-Cpp/include/stdio.h:219: error: `s' undeclared (first use in this function) 12C:/Dev-Cpp/include/stdio.h:219: error: (Each undeclared identifier is reported only once 13C:/Dev-Cpp/include/stdio.h:219: error: for each function it appears in.) 14C:/Dev-Cpp/include/stdio.h:219: error: `n' undeclared (first use in this function) 15 16C:/Dev-Cpp/include/stdio.h:219: error: `format' undeclared (first use in this function) 17C:/Dev-Cpp/include/stdio.h:219: error: `arg' undeclared (first use in this function) 18C:/Dev-Cpp/include/stdio.h: At top level: 19C:/Dev-Cpp/include/stdio.h:220: error: syntax error before "__gnuc_va_list" 20C:/Dev-Cpp/include/stdio.h:222: error: syntax error before "__gnuc_va_list" 21C:/Dev-Cpp/include/stdio.h:224: error: syntax error before "__gnuc_va_list" 22In file included from C:\Users\ajsuson\Documents\hello.c:1: 23C:/Dev-Cpp/include/stdio.h:432: error: syntax error before "__gnuc_va_list" 24C:/Dev-Cpp/include/stdio.h:433: error: syntax error before "__gnuc_va_list" 25C:/Dev-Cpp/include/stdio.h:434: error: syntax error before "__gnuc_va_list" 26C:/Dev-Cpp/include/stdio.h:435: error: syntax error before "__gnuc_va_list" 27C:/Dev-Cpp/include/stdio.h:439: warning: `__cdecl__' attribute only applies to function types 28C:/Dev-Cpp/include/stdio.h:439: error: syntax error before "fgetwc" 29C:/Dev-Cpp/include/stdio.h:440: warning: `__cdecl__' attribute only applies to function types 30C:/Dev-Cpp/include/stdio.h:440: error: syntax error before "fputwc" 31C:/Dev-Cpp/include/stdio.h:441: warning: `__cdecl__' attribute only applies to function types 32C:/Dev-Cpp/include/stdio.h:441: error: syntax error before "ungetwc" 33C:/Dev-Cpp/include/stdio.h:446: warning: `__cdecl__' attribute only applies to function types 34C:/Dev-Cpp/include/stdio.h:446: error: syntax error before "getwc" 35C:/Dev-Cpp/include/stdio.h:447: warning: `__cdecl__' attribute only applies to function types 36C:/Dev-Cpp/include/stdio.h:447: error: syntax error before "getwchar" 37C:/Dev-Cpp/include/stdio.h:449: warning: `__cdecl__' attribute only applies to function types 38C:/Dev-Cpp/include/stdio.h:449: error: syntax error before "putwc" 39C:/Dev-Cpp/include/stdio.h:451: warning: `__cdecl__' attribute only applies to function types 40C:/Dev-Cpp/include/stdio.h:451: error: syntax error before "putwchar" 41C:/Dev-Cpp/include/stdio.h:467: error: syntax error before "__gnuc_va_list" 42C:/Dev-Cpp/include/stdio.h: In function `vsnwprintf': 43C:/Dev-Cpp/include/stdio.h:468: error: `s' undeclared (first use in this function) 44C:/Dev-Cpp/include/stdio.h:468: error: `n' undeclared (first use in this function) 45 46C:/Dev-Cpp/include/stdio.h:468: error: `format' undeclared (first use in this function) 47C:/Dev-Cpp/include/stdio.h:468: error: `arg' undeclared (first use in this function) 48C:/Dev-Cpp/include/stdio.h: At top level: 49C:/Dev-Cpp/include/stdio.h:469: error: syntax error before "__gnuc_va_list" 50C:/Dev-Cpp/include/stdio.h:471: error: syntax error before "__gnuc_va_list" 51C:/Dev-Cpp/include/stdio.h:473: error: syntax error before "__gnuc_va_list" 52C:/Dev-Cpp/include/stdio.h:489: warning: `__cdecl__' attribute only applies to function types 53 54C:/Dev-Cpp/include/stdio.h:489: error: syntax error before "_fgetwchar" 55C:/Dev-Cpp/include/stdio.h:490: warning: `__cdecl__' attribute only applies to function types 56C:/Dev-Cpp/include/stdio.h:490: error: syntax error before "_fputwchar" 57C:/Dev-Cpp/include/stdio.h:495: warning: `__cdecl__' attribute only applies to function types 58 59C:/Dev-Cpp/include/stdio.h:495: error: syntax error before "fgetwchar" 60C:/Dev-Cpp/include/stdio.h:496: warning: `__cdecl__' attribute only applies to function types 61C:/Dev-Cpp/include/stdio.h:496: error: syntax error before "fputwchar" 62 63Execution terminated

AceBlkwell
Member #13,038
July 2011

ajsuson

Again I'm not expert with C but if I was in your position, I would remove Mingw and reinstall. Sounds like something is corrupt with the h file. Just me but I wouldn't edit it or try to patch a new stdio.h file in existing Mingw setup. Maybe more experience programmer can give better advice.

Ace

EDIT: maybe it's not stdio.h but another h file stdio is referencing. Maybe other include files are missing or corrupt in your installation. Again I'm not an expert. Just brainstorming out loud. 8-)

Edgar Reynaldo
Member #8,592
May 2007
avatar

Your install is bad somehow. Also, what is -g3 supposed to do? If you mean -g for debugging symbols, that goes before you state the source file, to the left of it.

CodeBlocks and MinGW are a much better answer if you ask me.

Go to: