News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Noob question: C::B to gcc script

Started by DeathByChocolate, January 19, 2009, 08:53:25 PM

Previous topic - Next topic

DeathByChocolate

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?

MortenMacFly

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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

DeathByChocolate

Thanks, but I can't get cbmakegen to install. :(

stahta01

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

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

rcoll

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