gopi_vbboy
Cyborg Agent
I am having some difficulty compiling a C++ program that I've written.
This program is very simple and, to the best of my knowledge.
The program is as follows:
*i.stack.imgur.com/JQXWL.png
Here is the output I received when trying to compile this program with Visual C++ 2010:
Dismayed, I tried g++ 4.5.2, but it was equally unhelpful:
To be honest, I don't really know what any of these error message mean.
Many other C++ programs have source files with a .cpp extension, so I thought perhaps I needed to rename my file. I changed its name to helloworld.cpp, but that didn't help.
What have I done wrong here? Have I missed some critical part of the C++ Standard? Or are all compilers really just so broken that they can't compile this simple program?
This program is very simple and, to the best of my knowledge.
The program is as follows:
*i.stack.imgur.com/JQXWL.png
Here is the output I received when trying to compile this program with Visual C++ 2010:
Code:
c:\dev>cl /nologo helloworld.png
cl : Command line warning D9024 : unrecognized source file type 'helloworld.png', object file assumed
helloworld.png : fatal error LNK1107: invalid or corrupt file: cannot read at 0x5172
Dismayed, I tried g++ 4.5.2, but it was equally unhelpful:
Code:
c:\dev>g++ helloworld.png
helloworld.png: file not recognized: File format not recognized
collect2: ld returned 1 exit status
To be honest, I don't really know what any of these error message mean.
Many other C++ programs have source files with a .cpp extension, so I thought perhaps I needed to rename my file. I changed its name to helloworld.cpp, but that didn't help.
What have I done wrong here? Have I missed some critical part of the C++ Standard? Or are all compilers really just so broken that they can't compile this simple program?