-
Real Noob question
Hey all,
I'm new to programming..well actually I did some BASIC in HS back in '82 before GUI's even really existed. Anyway, my question is quite simple (I hope)
I got a copy of Visual C++ 2005 Express. I made a really simple program just to say hey. It runs just fine on the compiler, no errors or anything. My only question is...How do I turn my code into an executable program? I been all over theese boards and at leat found out it's a process called linking, but beyond that i'm stumpted. When y'all get done pointing and laughing ( I know this is rediculously newbish) any help would be greatly appreciated.
-
If you've "run it fine" within the IDE (not the compiler) then you've already got yourself an executable file... it's just a matter of finding it. You should look in your project folder location for a debug or release folder... your executable will be inside.
-
-
Apperently i'm running it with the compiler. I found the exe file, but when I try to run it i get an error saying the configuration is wrong. If there is a link or thread to point me to compiler use, or any other advice it would be greatly appreciated...as the the advice i've gotten already :) I say that cause i'm not even sure how to run it within the IDE or what it really is.
-
Did you make a standard C++ program, or are you using .NET?
When you first create your project, you want to create a Win32 Console Application, then check Empty Project on the Application Settings page of the wizard. If you do that, then you can write standard C++ code that isn't dependent on .NET. If you still have the problem it might be due to not being able to find the proper CRT dlls.
If you did something else, then you might be using C++/CLI, in which case there are other issues involved that I'm not familiar with.
-
I found my exacutable (yaay) I do think i'm missing something however, as it runs just fine on this machine, but when i put it on my usb diver and try it on anohter machine, i get an error sayin the program is configured incorrectly on xp, on vista i get a side by side error. Yes Daved, i checked the empty project box in the settings wizard. Thank y'all for the help. Now I get to find out what's missing :) In case any are curious, here is the program
#include <iostream>
using namespace std;
int main()
{
cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
cin.get();
}
-
Probably the debug versions of some libraries. Compile the program in release mode and try that version.
-
-
Also make sure you either statically link to the runtime library, or use the dll version and copy the msvcrt80.dll (I think that's the name) file with your program.
>> and return 0;
That's done automatically for main, so it's the same either way.