Code::Blocks

User forums => Embedded development => Topic started by: pramaykaruley on June 13, 2018, 07:04:25 pm

Title: How to set linker options for compiler file using source code
Post by: pramaykaruley on June 13, 2018, 07:04:25 pm
I have created new compiler.xml file and corresponding option.xml file with include and lib path in it.

I want to link external libraries to the compiler using source code, where should I put that?

For Ex: If I want to create a compiler to compile to opengl program, then I have to link -lglfw3 -lgdi32 -lopengl32 libraries

This I want to achieve with the help of source code.

Please help..

Thanks in advance!!
Title: Re: How to set linker options for compiler file using source code
Post by: stahta01 on June 13, 2018, 11:49:09 pm
Are you blind?

If no, please state a valid reason you do not wish to use the Code::Blocks GUI interface to set the libraries you wish to link?

Tim S.
Title: Re: How to set linker options for compiler file using source code
Post by: sodev on June 14, 2018, 01:34:07 am
Well, it looks like he is abusing the compiler definition system to define default compiler settings to deploy them to multiple projects or installations.

This is the poor mans method if you don't use a meta-project generator like PreMake or CMake where you can achieve that by using setup-scripts you store in a central location and import them into the projects. Or if you use an IDE that doesn't have an integrated feature for that like e.g. Visual Studio with its Property Pages ;).
Title: Re: How to set linker options for compiler file using source code
Post by: stahta01 on June 14, 2018, 02:01:48 am
Well, it looks like he is abusing the compiler definition system to define default compiler settings to deploy them to multiple projects or installations.

This is the poor mans method if you don't use a meta-project generator like PreMake or CMake where you can achieve that by using setup-scripts you store in a central location and import them into the projects. Or if you use an IDE that doesn't have an integrated feature for that like e.g. Visual Studio with its Property Pages ;).

Could CB project scripts be used to set link libraries values?

Tim S.
Title: Re: How to set linker options for compiler file using source code
Post by: pramaykaruley on June 14, 2018, 08:11:09 am
Are you blind?

If no, please state a valid reason you do not wish to use the Code::Blocks GUI interface to set the libraries you wish to link?

Tim S.

The configuration made by codeblocks GUI are saved locally. I want it to persist whenever I install codeblocks from a locally created .deb file
Title: Re: How to set linker options for compiler file using source code
Post by: oBFusCATed on June 14, 2018, 08:34:35 pm
Why?