Code::Blocks Forums
User forums => Help => Topic started by: eckard_klotz on December 12, 2014, 12:29:33 pm
-
Hello Everybody.
Currently I try to compile the sources of the following project : http://www.mcternan.me.uk/mscgen/
Since this project is using the bison-tool to generate grammar-files I already installed bison and flex as well as the libintl-dlls. Thus the grammar-files will be generated as desired.
Since the project it self is written in c and not in c++ they will be compiled with the c-compiler (MinGw tdm-gcc-4.8.1-3). But for the auto generated files Code::Blocks forces to use the c++ compiler and the adjustment that normally allows to change this is not accessible. Even all files will be compiled the linker is not able to find all symbols since the c++ compiler is using name-mangling and the c-compiler not.
I think the long-lasting strategy should be to transfer the project to cpp but for the beginning I wish to keep it as provided since a lot of changes have to be done to make the sources acceptable for the c++ compiler (own boolean-type, forbidden pointer-conversion, ...) . Thus my problem is to ensure that all files will be compiled with the c-compiler.
How can I adjust that attachments like .cc .y .l will be compiled with CC and not with CPP ?
Best regards,
Eckard.
-
One idea would be to create a special compiler for this kind of project.
Copy the compiler you use now and use the c-compiler for c++-files also, and use this compiler for the project/targets.
Other way would be to change the file-ending of the bison-created files in the advanced settings of the compiler.
It might also be possible to make bison create header-files that prevents name mangling with an extern "C" statement.
-
Hello Jens.
Thanks for your quick response and please excuse my late one.
Other way would be to change the file-ending of the bison-created files in the advanced settings of the compiler.
In the case you talk about an adjustment in Code::Blocks, where do I find the advanced settings of the compiler ?
Best regards,
Eckard.
-
In the case you talk about an adjustment in Code::Blocks, where do I find the advanced settings of the compiler ?
Menu->Settings->Compiler->Other settings page. You will see it is a right bottom button named "advanced options"
-
Hello Ollydbg.
Thanks for the hint. After cleaning my glasses I have found. But I think it will take a while to understand how to force compiling a file with the ending cc with the MinGW c compiler instead with the c++ compiler.
How ever I think I have now enough possibilities to try out now. Thus Jens and Ollydbg, thank you very much.
Best regards,
Eckard.