Sign in to follow this  

Dev-C++ not creating exeutables

This topic is 4393 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 am reading a book called Teach yourself C++ in 21 days. I am using Dev-C++ as my compiler. I got to day 11 last night, and before I went to bed I installed the new version of it (4.9.9.2) and now this morning when I started reading my book again I typed in a program and it doesnt give me any compile errors but doesnt create an executable... what gives?

Share this post


Link to post
Share on other sites
Did you remember to link the program? Compiling doesn't produce an executable right off the bat, it produces object files first. These files are then linked together with a linker.

The advantage to this system is that you can use multiple source files without recompiling them all at once, and you can also use libraries that other people have written that you don't have the source code for.

Share this post


Link to post
Share on other sites
4.9.9.1 allows spaces in the filepath of Dev-cpp, 4.9.9.2 does not - I still haven't updated it, for that reason. I really doubt that's your issue, but you might want to take a look.

Really weird that it runs the program but doesn't build the exe.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It's probably just named or located differently from what you expect.

Share this post


Link to post
Share on other sites
Here we go: g++.exe source.o -o "Project2.exe" -L"C:/Dev-Cpp/lib"
that is the line from my compiler log when I compile a helloworld app telling me it made the exe, but when I compile my other program nothing like that is in the compile log.

Share this post


Link to post
Share on other sites
this doesnt make sense I compiled an old program of mine and it made the exe for it. for some reason it just wont compile this code:

#include <iostream.h>

int main()
{
int myArray[5];
int i;
for(i=0; i<5; i++)
{
cout << "Value of myArray[" << i << "]: ";
cin >> myArray[i];
}
for(i=0; i<5; i++)
cout << "myArray[" << i << "]: " << myArray[i] << "\n";
return 0;
}

Share this post


Link to post
Share on other sites
Again, I doubt it's the issue at hand, but in the future you'll want to use

#include <iostream>
using namespace std;

instead of iostream.h, which is deprecated. I assume your other programs use this too, though, so it wouldn't make much sense.

Share this post


Link to post
Share on other sites
iostream.h does not exsist in C++, try
#include <iostream>
using namespace std;
for your uses.

And g++.exe source.o -o "Project2.exe" -L"C:/Dev-Cpp/lib" suggests that it is making the EXE, it is just called Project2.exe.

Share this post


Link to post
Share on other sites
I know its making the exe durign that compile, but that is from a different project that compiles fine. I tried replacing #include <iostream.h> with #include <iostream>
using namespace std;

but it still does not work.

Share this post


Link to post
Share on other sites
Let me see if I can shed some light here...

Quote:
g++.exe source.o -o "Project2.exe" -L"C:/Dev-Cpp/lib

This line is from your functional hello world program. It works just fine, right?

Quote:
g++.exe array.o -o "11.1" -L"C:/Dev-Cpp/lib

This is the nonfunctional one; the one you want to compile to an exe.

Well, it looks from the log as though your compiler is making a file called "11.1", and NOT the "11.1.exe" that you are expecting.

Just find the file named 11.1 and add the .exe extension to it. My suspicion is that when you named it 11.1, the compiler mistakenly took that to mean that you want to make the file with an extension of ".1" only, instead of the .exe extension.

Try to not use periods in your filenames. I think it confuses your compiler.

Hope this helps!

Share this post


Link to post
Share on other sites
Well I have some sad news... due to my inability to get Dev-C++ to compile programs that have user-defined arrays in them I have switched to MS VS 2005. It is really too bad, I loved dev c++ setup.

Share this post


Link to post
Share on other sites
Quote:
Original post by BTownTKD
Well, it looks from the log as though your compiler is making a file called "11.1", and NOT the "11.1.exe" that you are expecting.

Just find the file named 11.1 and add the .exe extension to it. My suspicion is that when you named it 11.1, the compiler mistakenly took that to mean that you want to make the file with an extension of ".1" only. Try to not use periods in your filenames. I think it confuses your compiler.

Hope this helps!


yeah but i have had project called like 10.18 and 7.4 througth the first 10 days of the book and it worked fine. But I will try it and hopefully it works so that I can go back to dev c++ and not havet o deal with ms vs

Share this post


Link to post
Share on other sites
Woot, ty btown and everyone else. Yeah for somereason after I updated dev c++ it was making the name 11.1 instead of like 10.4.exe like it was before but that was the problem so I guess ill have to start naming my project like so 11_1.
Ty so much.

Share this post


Link to post
Share on other sites

This topic is 4393 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this