Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: DeathByChocolate on January 19, 2009, 08:53:25 pm

Title: Noob question: C::B to gcc script
Post by: DeathByChocolate on January 19, 2009, 08:53:25 pm
I have a working CodeBlocks project with many includes and linked-in libraries.  I want to compile and link outside of CodeBlocks.  How can I get an equivalent gcc or g++  command or script that does the equivalent compile-and-link operation?
Title: Re: Noob question: C::B to gcc script
Post by: MortenMacFly on January 19, 2009, 09:11:24 pm
You can try the cbMakeGen (cbMakeFileGen?!) plugin (search the forums) - but it may not work for you.

Hence - do you know, that you can run C::B in batch mode? This means C::B compiles your project/workspace without opening the IDE. Check the command line arguments accordingly.
Title: Re: Noob question: C::B to gcc script
Post by: DeathByChocolate on January 19, 2009, 10:12:46 pm
Thanks, but I can't get cbmakegen to install. :(
Title: Re: Noob question: C::B to gcc script
Post by: stahta01 on January 20, 2009, 12:24:06 am
Other options include using

premake to create the project; but this requires work of creating an premake.lua script for for the project.

cmake to create the project; but this requires work of creating an cmake list file.

cmake takes less work to create build file, but only creates an Code::Blocks makefile project.

premake takes more work to create build file; and, it can create regular Code::Blocks project.

premake https://sourceforge.net/projects/premake/
Note: More examples exist for version 3; so, first time users should use version 3.

cmake http://www.cmake.org/

Edit: I use premake, but have not used cmake.

Tim S

Title: Re: Noob question: C::B to gcc script
Post by: rcoll on January 20, 2009, 05:34:40 am
If you just want a simple script to build everything (not a Makefile) turn on full command-line logging, then copy out the log file to a text file.  Edit that to create a simple script.

Ringo