Code::Blocks Forums

User forums => Help => Topic started by: iQChange on February 17, 2015, 07:19:59 pm

Title: [not SOLVED] How do I change specific files compiling policy from Code::Blocks?
Post by: iQChange on February 17, 2015, 07:19:59 pm
I have a project. For some files, instead of standard compilation process, I want to build them with some other flags. How do I do it?
Title: Re: How do I change specific files compiling policy from Code::Blocks?
Post by: MortenMacFly on February 17, 2015, 07:35:37 pm
Right click on the file, properties and have a look how to adjust.
Title: Re: How do I change specific files compiling policy from Code::Blocks?
Post by: iQChange on February 18, 2015, 12:34:34 am
Thank you so much!
Title: Re: [not SOLVED] How do I change specific files compiling policy from Code::Blocks?
Post by: iQChange on February 18, 2015, 01:17:08 am
My wish is to get a dll from one file and with the other's code, call functions inside it (dynamic loading).
Anyway, I must change the way it's built. It runs
Code
g++.exe -shared -std=c++14 C:\proj\cpp\test\test_project\test.cpp -Wall -fexceptions -o test.dll
g++.exe  -o bin\Debug\test_project.exe obj\Debug\main.o obj\Debug\test.o   

But I don't want to create an invalid test_project.exe. I want to get the rid of test.o. How do I do it?
Title: Re: [not SOLVED] How do I change specific files compiling policy from Code::Blocks?
Post by: stahta01 on February 18, 2015, 03:08:18 am
Create a separate CB target to create the DLL.

Tim S.
Title: Re: [not SOLVED] How do I change specific files compiling policy from Code::Blocks?
Post by: BlueHazzard on February 18, 2015, 08:47:20 am
Look in project->settings under build targets (or something with target)
Title: Re: [not SOLVED] How do I change specific files compiling policy from Code::Blocks?
Post by: oBFusCATed on February 18, 2015, 08:49:06 am
iQChange:
You can disable linking of test.cpp. It is not recommended to do it this way, because this is not the way the build system is designed to work.
You are abusing it. So it is better to have two targets one for the dll and one for the executable as stahta01 suggested.