Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » eclipse creates exe for C++ not for C project
icon5.gif  eclipse creates exe for C++ not for C project [message #1007891] Thu, 07 February 2013 19:51
Missing name Mising name is currently offline 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.



Sad

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: Thu, 07 February 2013 20:12]

Report message to a moderator

Previous Topic:No error when class not #included?
Next Topic:How do I create an OS-neutral run configuration in Eclipse?
Goto Forum:
  


Current Time: Thu Aug 21 06:28:22 EDT 2014

Powered by FUDForum. Page generated in 0.02132 seconds