Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » runtime errors?

This thread is locked; no one can reply to it. rss feed Print
runtime errors?
ITAmember
Member #10,095
August 2008

I have a windows vista laptop and I am using Dev-C++ compiler. When I type this code in:

#include <allegro.h>

int main(void)
{
allegro_init();
allegro_message("It Works!");
}
END_OF_MAIN()

I then set the proget type to Win32 GUI (I'm running a 32 bit vista OS) and type
-lalleg into the Linker box. This works on my XP computer. When I compile it I get this error message:

Microsoft Visual C++ Runtime Libray
Runtime Error!
Program: C:\Dev-Cpp\Projectl.exe
034
An application has made an attempt to load the C runtime library incorrectly.
Please contact the applications support team for more information.

This happens whenever I run a program that has used Allegro. Please help!

Dario ff
Member #10,065
August 2008
avatar

mmm... why Windows Vista always makes programs all crappy??? T_T it only causes problems. The code would seem to work; just try to make a program in XP and then run it Windows Vista, all I can say::
NOTE:
you didn´t return something in main ;D

TranslatorHack 2010, a human translation chain in a.cc.
My games: [GiftCraft] - [Blocky Rhythm[SH2011]] - [Elven Revolution] - [Dune Smasher!]

LennyLen
Member #5,313
December 2004
avatar

Quote:

mmm... why Windows Vista always makes programs all crappy

It doesn't. Many of us have had no problems writing and compiling for Vista. The only people who appear to have problems are those that don't follow instructions carefully.

BAF
Member #2,981
December 2002
avatar

Dev-C++ causes more problems than Vista.

Tobias Dammers
Member #2,604
August 2002
avatar

Dev-C++ uses MinGW as its compiler, which relies on a bug in the OS that was present in windows 95 through XP, but has been fixed for Vista. Therefor, MinGW is broken on Vista, unless you use a patch that is available somewhere (which is basically a broken replacement for the fixed dll Vista provides).
On top of that, Dev-C++ itself has never been a very good and stable IDE, and being abandonware certainly doesn't help.
If you really really want an IDE, use a different one; I'd say Visual C++ Express is a good (free) candidate, assuming you have a legal Vista installed; otherwise, I hear Code::blocks isn't half bad either. For the compiler, MinGW should work once patched, but since VC++ is basically free nowadays, you might as well use "the official windows compiler".
If you can live without an IDE (which many prefer), a good text editor (Notepad++ or SciTE, or something similar) and a decent compiler will get you a long way.

Then, to rule out your allegro install as the culprit, try compiling and running the most basic Hello World in text mode (console program).

---
Me make music: Triofobie
---
"We need Tobias and his awesome trombone, too." - Johan Halmén

BAF
Member #2,981
December 2002
avatar

You can install Visual Studio express (at least the 2005 version) on a bastard copy of the OS, IIRC.

ITAmember
Member #10,095
August 2008

When I try to compile the same program in Visual C++ 2008 I get the same error message. I then get a series of error messages:

Unhandled exception at 0x77979cac in allegro.exe: 0xC0000142: DLL Initialization Failed.

---

allegro.exe has triggered a breakpoint

---

The application falied to initialize properly (0x0). Click OK to terminate the application.

---

Windows has triggered a breakpoint in allegro.exe.

This may be due to a corruption of the heap, which indicates a bug in allegro.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while allegro.exe has focus.

The output window may have more diagnostic information.

---
This is the output from the output window.
---

'allegro.exe': Loaded 'C:\Users_____\Documents\Visual Studio 2008\Projects\allegro\Debug\allegro.exe', Symbols loaded.
'allegro.exe': Loaded 'C:\Windows\System32\ntdll.dll'
'allegro.exe': Loaded 'C:\Windows\System32\kernel32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\alleg42.dll', Binary was not built with debug information.
'allegro.exe': Loaded 'C:\Windows\System32\ddraw.dll'
'allegro.exe': Loaded 'C:\Windows\System32\msvcrt.dll'
'allegro.exe': Loaded 'C:\Windows\System32\user32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\gdi32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\advapi32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\rpcrt4.dll'
'allegro.exe': Loaded 'C:\Windows\System32\dciman32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\setupapi.dll'
'allegro.exe': Loaded 'C:\Windows\System32\oleaut32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\ole32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\dwmapi.dll'
'allegro.exe': Loaded 'C:\Windows\System32\dinput.dll'
'allegro.exe': Loaded 'C:\Windows\System32\winmm.dll'
'allegro.exe': Loaded 'C:\Windows\System32\oleacc.dll'
'allegro.exe': Loaded 'C:\Windows\System32\dsound.dll'
'allegro.exe': Loaded 'C:\Windows\System32\powrprof.dll'
'allegro.exe': Loaded 'C:\Program Files\CyberLink\Power2Go\msvcr80.dll'
'allegro.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc90.debugcrt_1fc8b3b9a1e18e3b_9.0.21022.8_none_96748342450f6aa2\msvcr90d.dll'
'allegro.exe': Loaded 'C:\Windows\System32\imm32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\msctf.dll'
'allegro.exe': Loaded 'C:\Windows\System32\lpk.dll'
'allegro.exe': Loaded 'C:\Windows\System32\usp10.dll'
'allegro.exe': Loaded 'C:\Program Files\Google\Google Desktop Search\GoogleDesktopNetwork3.dll'
'allegro.exe': Loaded 'C:\Windows\System32\ws2_32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\nsi.dll'
'allegro.exe': Loaded 'C:\Windows\System32\ntmarta.dll'
'allegro.exe': Loaded 'C:\Windows\System32\Wldap32.dll'
'allegro.exe': Loaded 'C:\Windows\System32\psapi.dll'
'allegro.exe': Loaded 'C:\Windows\System32\samlib.dll'
'allegro.exe': Unloaded 'C:\Program Files\Google\Google Desktop Search\GoogleDesktopNetwork3.dll'
'allegro.exe': Loaded 'C:\Windows\System32\uxtheme.dll'
'allegro.exe': Loaded 'C:\Program Files\Logitech\SetPoint\lgscroll.dll'
'allegro.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.1434_none_d08b6002442c891f\msvcr80.dll'
'allegro.exe': Loaded 'C:\Windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.1434_none_d08b6002442c891f\msvcp80.dll'
First-chance exception at 0x77979cac in allegro.exe: 0xC0000142: DLL Initialization Failed.
Unhandled exception at 0x77979cac in allegro.exe: 0xC0000142: DLL Initialization Failed.
allegro.exe has triggered a breakpoint
First-chance exception at 0x736dd1b2 in allegro.exe: 0xC0000005: Access violation.

*** A stack buffer overrun occurred in "c:\Users_____\Documents\Visual Studio 2008\Projects\allegro\Debug\allegro.exe" :

This is usually the result of a memory copy to a local buffer or structure where the size is not properly calculated/checked.
If this bug ends up in the shipping product, it could be a severe security hole.
The stack trace should show the guilty function (the function directly above __report_gsfailure).
*** enter .exr 77A39320 for the exception record
*** then kb to get the faulting stack

Windows has triggered a breakpoint in allegro.exe.

This may be due to a corruption of the heap, which indicates a bug in allegro.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while allegro.exe has focus.

The output window may have more diagnostic information.
Windows has triggered a breakpoint in allegro.exe.

This may be due to a corruption of the heap, which indicates a bug in allegro.exe or any of the DLLs it has loaded.

This may also be due to the user pressing F12 while allegro.exe has focus.

The output window may have more diagnostic information.
The program '[5488] allegro.exe: Native' has exited with code -1073740791 (0xc0000409).

Matthew Leverton
Supreme Loser
January 1999
avatar

Don't mix incompatible versions of the C runtime.

ITAmember
Member #10,095
August 2008

Matthew Leverton said:

Don't mix incompatible versions of the C runtime.

What do you mean by that, and how would I go about fixing it?

Go to: