Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Allegro not working properly Dev-C++, WinXP

This thread is locked; no one can reply to it. rss feed Print
Allegro not working properly Dev-C++, WinXP
Aviv01
Member #9,273
November 2007

Hi,
So this is the situation: I open a new project, link the allegro library under Project Options, and copy and paste a source file involving allegro.h from internet. I complie and run it, and everything works fine.
However, if I press complie again (whether or not I make any adjustments), it does not complie and gives me the following errors in the message table (in Dev-C++), where the number (as in File 1) represents the row:

Line 1: cannot open output file Game Project.exe
[Game Project.dev is the source code file for the project.]
File 1: G:\Dev-Cpp\mingw32\bin\ld.exe
Message 1: Invalid argument

Line 2: [blank]
File 2: C:\My Documents\Programming\Useful Programs\GameProject\Makefile.win
Message 2: [Build Error] ["Game] Error 1

I would greatly appreciate your help.

I would also like to mention (in case it may be relevant) that when I installed allegro, I followed the instructions in the file mingw32.txt. Everything seemed fine; but, when I finished, I noticed that I now had two Dev-Cpp folders in my G:\ drive. One was the original (which also included the downloaded allegro folder), and the other contained the new allegro library and include files resulted from the build. I restarted the computer, and the two folders (with the exact same name in the same location) still did not merge into one. So, I just did it manually (whether I should have or not), by copying and pasting the new files to their appropriate locations in the original folder and deleting the other folder. I suspect that this occured because I was browsing through My Computer while allegro was building its library in the cmd console.

Audric
Member #907
January 2001

> Line 1: cannot open output file Game Project.exe

This happens if the program is still running.

Aviv01
Member #9,273
November 2007

Well, if the program is still running, it would appear in the Windows Task Manager under the Processes tab, as Project1.exe for example. This is not the case. In fact, there is no evidence (other than what you pointed) to suggest that the program is still running. As well, the problem does seem to be specific to allegro: If I start a new project without linking the allegro library, then everything seems to work fine. As a matter of fact, if I start a new project (well, at least without the allegro library link), and I run the corresponding .exe file by opening it from My Documents, and then (with the program still running) compile the code, everything goes by fine. If I run it from the IDE (in this case, Dev-C++)(with the program still running from before), the window showing the program simply pops in front.
But, funny enough, if I do the exact same thing for a single source file and not a project, then it gives me the following error message:

Line 1: \My Documents\Programming\Useful Programs\Monster.exe
File 1: G:\Dev-Cpp\mingw32\bin\ld.exe: cannot open output file C
Message 1: Permission denied

Now, I will further explain the original problem (which involves a project that is linked to the allegro library):

It seems that compiling the source code has nothing to do with the problem. I can compile it continuously with no error messages; the problem stems from running it and then compiling. For example, I can compile a source code and run it (as long as there is nothing wrong with the code). And, I can run it continously, as long as I do not compile the code again. After I close the program, and press compile again (with or without any changes to the code), I receive the error messages mentioned in the first post above (from the message board in Dev-C++). Even if I erase the entire code, and compile the blank page, I get the same error messages. From there, I can do one of the following: (1) restart the computer, which allows me to compile and run the same project again (but with the same problem applicable of course); or (2) open a new (allegro) project (but with the same problem applicable to the new project).

[I found that if I open a new (allegro) project, and compile it a second time after running it (without any changes to the code), there are no error messages, but I cannot run it (nothing happens at the Dev-C++ interface). If I try to run it by opening the corresponding .exe file, a window pops out saying "Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item."]

So, I decided that I will uninstall Dev-C++ (and delete the Dev-Cpp folder which also contains the allegro folder). I undid the changes to Environmental Variables previously required to build the allegro library. I ran CCleaner in attempt to clean up my system and to tidy up my registry. I also ran Registry Mechanic afterwards for any additional registry cleaning. I then assumed that I did everything there is to do in order to bring my system back to the state it was in before I installed Dev-C++ and allegro. I then restarted the computer.

I reinstalled the full Dev-C++ (I did not do anything for allegro yet). I then simply tested out the IDE to check if everything was okay with it. It turns out that there is a problem right over here with Dev-C++ (regardless of allegro afterall). Everything seems to work fine for code in single source files (as far as I can tell). It is when I try to make a project that problems begin. Basically, the project compiles but does not run properly.

Here is a breakdown of what I do:
I open a new project; I choose Windows Application; I close the main.cpp that comes by default (as instructed in other tutorial websites); I add a new souce file to the project and write a simple code using iostream; I compile it; I run it, and this is what I noticed:
(1) If I have system("Pause") anywhere in the code (usually near the end), it is all it gives me (i.e. the output is "Please press a key to continue", even though it should cout some other stuff before it). If I copy and paste the code to a single source file, then it runs properly.
(2) For other codes, the program did not even show up. I had to use Windows Task Manager to close it (where the corresponding .exe file appeared under Processes).

So I say the problem deduces to one of the following:
(1) There is something wrong with my system.
(2) There is something in my system that is interfering with the processes of Dev-C++.
(3) There is something wrong with the CD I am using to install Dev-C++.
(4) I am simply not using Dev-C++ correctly (somehow) when it comes to making projects.

Here is something that might be relevant:
I recall using RegistrySmart 4.2 not too long ago before uninstalling it due to apparent problems it was causing. These problems included the disappearance of the Windows Quick Launch, and also (more relevant) this: If I ran RegistrySmart for a second time, the program did not appear, only the usual bar at the bottom (that could not display the window).

Hence, I am afraid there might be something wrong with my system. I need help with this. I did everything I could think of. I need to know what I should do next in order to check if there is anything that could be causing malfunction in my system (e.g. a necessary file or something that I might have deleted).

Mathwiz3141
Member #8,039
November 2006

To me, it sounds like something is wrong with Dev-C++. I'm more of a mac guy, but when I use Windows I use Dev-C++.

Try uninstalling Dev-C++, and then downloading the newest version from http://www.bloodshed.net/dev/devcpp.html.

The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers. - Bill Gates (no offense to Microsoft)

Aviv01
Member #9,273
November 2007

Yes, I found a report on SourceForfe (http://sourceforge.net/forum/forum.php?forum_id=448086) that seems to describe the same problem with making projects in Dev-C++.
So, I installed the new version, with the devcpp-4.9.9.2_setup.exe that has 9326468 bytes. But, there's still that same issue.
I opened a new topic on this problem titled "problem with allegro library". I simplified the problem overthere a bit.

Go to: