User forums > Help

Code Blocks using wrong compiler [Linux]

<< < (2/5) > >>

Jenna:
Please change "Settings -> Compiler and Debugger -> Global Compiler Settings -> Other Settings (it's the rightmost tab)  -> Compiler Logging" to "Full command line" and try to compile again.
Then you can post the compilers commandline and/or try the same instruction from console.
Your project compiles fine after adding the source file.

killerbot:
yes, do what Jens says, that was my next advice, but now I don't have to type it myself ;-)

When I added the cpp file to the project you had attached it worked for me.

Taedrin:
No change in the error output, though I did find out something interesting.  When I right click on the file and select "build file", no output is produced at all.  It makes me think that instead of the wrong compiler being used, I am simply not adding the file to the project properly.  The way I do this is right-clicking on the project in the navigation pane on the left, and selecting "add file...", selecting "test.cpp", and then selecting both the "Debug" and "Release" build targets.

Am I doing that right?

And as for on the command line, using

'gcc test.cpp -o test' produces a bunch of undefined references to std::ios (since gcc does not compile C++ programs).
'g++ test.cpp -o test' is successful, and running 'test' produces the expected "Hello World!" output.

killerbot:
you adding is correct, put paste the log from cb in the build pane

You should have something like :


--- Quote ---
-------------- Build: Debug in Test ---------------

g++ -Wall  -g    -I/usr/bin/include  -c /home/ldc/Desktop/DelMe/test.cpp -o obj/Debug/test.o
g++ -L/usr/bin/lib  -o bin/Debug/Test obj/Debug/test.o   
Output size is 63.67 KB
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings
Build log saved as:
file:///home/ldc/Desktop/DelMe/Test_build_log.html
 

--- End quote ---

Taedrin:
Build log when building the project:


--- Quote ---"Test - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Skipping...
Nothing to be done.

--- End quote ---

Build log when building the file only:

--- Quote ---
--- End quote ---

(yes, it shows literally *nothing* when building the file only)

/edit: and just to note, I did set the compiler logging to full command-line

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version