User forums > Help

Strange compiling behavior

<< < (2/3) > >>

oBFusCATed:
Try: http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F
The compiler executable should be gcc, if it is g++ you are compiling it as c++, not c.
If that is the case in the project manager -> right click your c file -> properties -> advanced -> verify that there is C no CPP

If you can't understand why it doesn't work, paste the output here.

Coywolf:
I've made sure that I changed the compiler to point to the new directory.

So here is what the build log says when I compile. The one that gives errors is in fact running g++.

--- Code: ---mingw32-g++.exe    -c "C:\Users\Mike\Documents\CS 240\project3\project3\project3.c" -o "C:\Users\Mike\Documents\CS 240\project3\project3\project3.o"
C:\Users\Mike\Documents\CS 240\project3\project3\project3.c: In function `int main()':
Errors....
--- End code ---
and for the copy not giving errors. Side question - should this be running g++ also? I notice it does gcc, then g++ on the .o. It seems like this is just to make an .exe. Is that the case?

--- Code: ---mingw32-gcc.exe    -c C:\Users\Mike\Desktop\project3.c -o C:\Users\Mike\Desktop\project3.o
mingw32-g++.exe  -o C:\Users\Mike\Desktop\project3.exe C:\Users\Mike\Desktop\project3.o  
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
--- End code ---
I looked in the properties for each file, and under the advanced tab, there is nothing. The fields are grayed out and the drop down box under 'Custom Build' is empty

EDIT:
ok, what I said about the properties was when the files were just by themselves. When I opened the project3.c file with the project I set up for it, I had a different screen. The compiler variable is CC only. Looking at the build output, its running gcc. So I suppose I should keep things in project files. Is there a reason it would be running the g++ when the file is just by itself? I can only assume that having spaces in the path is invalid for gcc, so it choose g++ instead.

Jenna:
This seems to be a bug in C::B.
The c-file in quotes (it's quoted because of the spaces included) is not recognized as c-file, but as c++-file, if it is not in a project.

And you wrote, that the content of the advanced tab is inactive, so I guess you use the files without a project.

thomas:
Yes, looks that way, I'm getting the same behaviour when trying to compile C without a project (which admittedly was the first time ever).

Jenna:
Fixed in trunk (svn r5895),  debugger- (svn r5896) and scintilla-testbranch (svn r5897).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version