eclipse creates exe for C++ not for C project [message #1007891] |
Fri, 08 February 2013 00:51 |
Missing name Mising name Messages: 7 Registered: April 2011 Location: USA |
Junior Member |
|
|
I just installed juno eclipse and Mingw and created a C++ project. That worked fine and ran like it should. But when I tried to create a C project, eclipse looks like it works, but looking in the directory, there is no executable. I was wondering if anyone else has had this problem and knows how to fix it.
Oh, one other thing I noticed is that the C++ project creates a Binaries folder under its project root while there is no such folder in the C project root.
(I have attached an image of the project explorer).
The code is the standard hello world template for both projects.
C++:
Quote:
16:31:02 **** Rebuild of configuration Debug for project Test ****
Info: Internal Builder is used for build
g++ -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Test.o" "..\\src\\Test.cpp"
g++ -o Test.exe "src\\Test.o"
16:31:03 Build Finished (took 890ms)
C:
Quote:
16:32:08 **** Rebuild of configuration Debug for project Test2 ****
Info: Internal Builder is used for build
gcc -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\Test2.o" "..\\src\\Test2.c"
gcc -o Test2.exe "src\\Test2.o"
16:32:09 Build Finished (took 1s.119ms)
Oh, I discovered another thing. If I create a C++ project hello world it will compile fine, but if I then replace the C++ code with straight C code as in:
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
with
#include <stdio.h>
#include <stdlib.h>
int main(void) {
puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
return EXIT_SUCCESS;
}
So, I have a Test3.cpp file with C code and it does not compile to an executable either.
[Updated on: Fri, 08 February 2013 01:12] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02907 seconds