i have just understood where is the probelm:
When compiling a c++ project, C::B calls g++ two time:
a first time to create the object file with command
g++ -std=c++11 -static -c main.cpp -o main.o
(which is exactly the correct command we need)
and a second time to link the object file in an executable with the command
g++ -o programName.exe programName.exe
This is a normal behaviour since projects are, usually, composed by more than one single file
If Gcc has been build with (e g) --enable-shared, programs are by default linked with ... dll libraries version
As far as i know, it seems that there is a known problem when linking with shared libraries for stdc++ and winpthread.
But, as the problem can be resolved if linking is done with a command like
g++ -static -o programName.exe main.o
it would (maybe) be interresting to ensure that -static option (if present) is correctly passed when using g++ for linking.
What do you thing about ?