Archived

This topic is now archived and is closed to further replies.

Dev-C++ compiling '2'?

This topic is 5003 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just installed Dev-C++, created a new project (the default Windows app), and tried to compile. It gave me this error: 2 C:\Documents and Settings\Morgan\My Documents\Programming\Dev-C++ Projects\test\2 unable to run program file. It seems like it is trying to compile a file that doesn't exist and was never added to my project. I used Dev-C++ fine before I had to reinstall windows. It does the same thing with any other program I try to compile, including projects created under my old install. I have no idea how to fix this; please help! [edited by - nagromo on April 5, 2004 5:28:02 PM]

Share this post


Link to post
Share on other sites
Did you delete the devcpp.cfg and devcpp.ini files? Search for them, but make sure that you have the option to look for hidden files and folders checked. Delete these files, and reinstall. Also, make sure you don''t have spaces in the path where you installed Dev-C++. This can mess up the command line stuff.

Scott Simontis
e-mail:ageofscott@NOSPAM.comcast.net
AIM:ssimontis

Share this post


Link to post
Share on other sites
in older versions, dev-c++ (or actually the mingw tools) would only work when located in a directory without spaces. I.e. "Program Files" would break the tool integration. I''m not sure if the same was true of the project files themselves, but it''s something to check.

lonesock

Piranha are people too.

Share this post


Link to post
Share on other sites
I deleted the config files and now it gives a new error:

ld C:\Documents and Settings\Morgan\My Documents\Programming\Dev-C++ Projects\TextRPG\ld
cannot open crt2.o: No such file or directory.

Adding C:/Dev-C++/lib/crt2.o to the files to link didn''t help, either, and I have no idea what ld is.

Share this post


Link to post
Share on other sites
I think lonesock is correct. Use directory names without spaces.



First make it work, then make it fast. --Brian Kernighan

The problems of this world cannot possibly be solved by skeptics or cynics whose horizons are limited by the obvious realities. We need men and women who can dream of things that never were. - John Fitzgerald Kennedy(35th US President)

Do not interrupt your enemy when he is making a mistake. - Napolean Bonaparte

Share this post


Link to post
Share on other sites
quote:
Original post by CaptainJester
I think lonesock is correct. Use directory names without spaces.


FYI:

Program Files = progra~1
Documents and settings = Docume~1

when it asks for an install path replace the names with spaces to the names w/out spaces and it''ll usually be ok. this is a general fix i''ve had to use with various poorly written apps. there''s a way to escape the space characters as well, but i forget how.

-me

Share this post


Link to post
Share on other sites
It is installed in C:/Dev-C++. I moved my project folder there so the project's path also has no spaces and it still gives me the error. The default windows app gives me a different error, though:

47 C:\Dev-Cpp\include\windows.h
In file included from C:/Dev-Cpp/include/windows.h
2 C:\Dev-Cpp\Projects\test\main.cpp
from main.cpp
24 C:\Dev-Cpp\include\stdarg.h:6
no include path in which to find stdarg.h
40 C:\Dev-Cpp\include\string.h
In file included from C:/Dev-Cpp/include/string.h
37 C:\Dev-Cpp\include\winnt.h
from C:/Dev-Cpp/include/winnt.h
246 C:\Dev-Cpp\include\windef.h
from C:/Dev-Cpp/include/windef.h
48 C:\Dev-Cpp\include\windows.h
from C:/Dev-Cpp/include/windows.h
2 C:\Dev-Cpp\Projects\test\main.cpp
from main.cpp
24 C:\Dev-Cpp\include\stddef.h:6
no include path in which to find stddef.h

It goes on with many more errors in standard header files. I did this with a fresh install. The files stddef.h etc. exist in C:\Dev-Cpp\include. Please help!

[edited by - nagromo on April 5, 2004 9:53:51 PM]

Share this post


Link to post
Share on other sites
Windows can handle both.
/ is standard on Unix, which is where the compiler originated, and that is how it passes things to the OS.
\ is Windows standard and represents strings gotten from the OS.
Windows will accept either; try it in a MS-dos prompt or in your code.

Share this post


Link to post
Share on other sites
two things (both under the Tools menu, compiler options):

1) add "-Wno-deprecated" to your compiler options (no "we don't like .h includes anymore" warnings)
2) add "C:\Dev-Cpp\include\c++\backward" to the c++ include directories (so you can use the .h include files) you may need to edit the dir, just determine where the "\backward" directory is found.

If this works, then 2 more things [8^)

1) sorry I misled earlier
2) you can probably move back to paths with spaces, though I don't recommend it.

edit: this is probably because the old version used the gcc 2.95 compiler, while the new dev-c++ comes with the 3.x by default.

lonesock

Piranha are people too.

[edited by - lonesock on April 6, 2004 5:25:39 AM]

Share this post


Link to post
Share on other sites
Man.. just get a new compiler!! I had the same exact problem on my laptop. The thing was working for a few days and all of a sudden the error 2 thing came up. I tried everything. So.. I just went and got me visual studio .net . Do the same or find a different compiler.

Share this post


Link to post
Share on other sites
That faq said that error is caused by a missing executable or compiler setting. I will try when I get home from school. Kackurot, just stick with it and you can make anything work. Thanks, everyone.

Share this post


Link to post
Share on other sites
No more ''2'' error, but it still can''t find crt2.o.
ld C:\Dev-Cpp\Projects\OpenGL2D\ld
cannot open crt2.o: No such file or directory.
This is the error. I have no idea what ld is; it seems like it is trying to make stuff that doesn''t exist. I might try another compiler if noone can figure this out. What are some other good/free compilers/IDE''s?

Share this post


Link to post
Share on other sites