compile to exe

I am using netbeans to compile my very simple program. when i try to run the exe on a windows machine it gives me a command prompt screen and then an error saying that ntdvm can not run the program.

When i released netbeans created a main.o file and i changed the name of that to main.exe.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  #include <cstdlib>
#include <iomanip>
#include <iostream>

using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {
    
    string input = "";
    cout << "Hackney Custom Car Care\n";
    cout << "Type a letter.\n";
    getline(cin, input);
    cout<< "You typed: " <<input << endl <<endl;

    return 0;
}
Hi,

We need you to provide us a little more information can you give us the exact detail of the error for example if any error code\number is showing and the exact word to word error message.

The question is pretty broad and generic.

Look forward for reply.
closed account (28poGNh0)
I compiled your code with my code::blocks compiler an its working fine
so why not download it http://www.codeblocks.org/downloads and then see the difference
The problem is that he changed the object file to an .exe they are different
a .o (object) is unlinked machine code and an .exe(executable) is linked machine code. You would have to link the .o then convert to an .exe if you want to run it that way AFAIK.
The more advanced users might have more info though.
thank you giblit. you are on to something. can you create an exe directly from netbeans? I can run the main.o and/or a.out when using g++ at command prompt just fine from command prompt but i am wanting to create a program that i can have another person use without flaw in windows.
Last edited on
Not sure i haven't used netbeans but you could just use an ide and compile/build it
Topic archived. No new replies allowed.