User forums > Using Code::Blocks
Code::Blocks and clang on Debian
blauzahn:
You did not post your command line yet.
You should avoid to change anything within the advanced compiler options.
Just check the entries in settings| compiler | your llvm entry | Toolchain executables.
Do they point to the same ones you use from the commandline?
I have clang installed in /usr/local. So, I use:
compiler installation directory: /usr/local
c++ compiler: clang++
make program: make
To test your toolchain:
Can you create a new cb-project (command-line hello world)
select llvm/clang as compiler and build it?
To use c++11 features you have to use the compiler-flag -std=c++11
and neither -std=c++98 nor -std=c++0x
And remember to activate the compiler-flag -Wall
To see which clang++ you use, please enter on the commandline:
$ which clang++
$ clang++ -version
Poenikatu:
Have done as you suggested. I cleared out the Workspace directory and started a Hello project.
C::B successfully compiled and ran the program.
Now that I understand rather more about Clang, I see that the command issued by C::B is
dwarfed by the output from Clang calling its compiler cc1, and I now understand that the ld command
is also issued by Clang itself. One caveat: I only asked for -Wall, but C::B insisted on -Weverything. How do I switch off -Weverything? I did *not* select that option when configuring the compiler.
Poenikatu:
Is it possible to run a console program with arguments?
blauzahn:
Still neither compiler output nor its version?
Look into the projects menu.
for other clang related questions:
$man clang
Poenikatu:
There's no point putting compiler output 'cos I've now got Code::Blocks to compile and build successfully.
The output from "clang++ --version" is
clang version 3.4 (trunk 186654)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Note my reply in which I point out that there is an enormous difference between the commands that Code::Blocks issues and the
commands issued by the Clang++ driver module to run its compiler (cc1) and the GNU linker (ld).
In a previous post, I had confused the two kinds of commands. However, I still don't understand why Code::Blocks insists on specifying
-Weverything even though I have only asked for -Wall. Can you shed light on that?
I'm using Code::Blocks 12.11 svn9224, built on July 22 2013, 10:31:52 - wx2.8.12 (Linux,unicode) - 64 bit (taken from the
Code::Blocks About window.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version