Author Topic: Noob question: C::B to gcc script  (Read 4307 times)

Offline DeathByChocolate

  • Single posting newcomer
  • *
  • Posts: 4
Noob question: C::B to gcc script
« 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?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Noob question: C::B to gcc script
« Reply #1 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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline DeathByChocolate

  • Single posting newcomer
  • *
  • Posts: 4
Re: Noob question: C::B to gcc script
« Reply #2 on: January 19, 2009, 10:12:46 pm »
Thanks, but I can't get cbmakegen to install. :(

Online stahta01

  • Lives here!
  • ****
  • Posts: 7787
    • My Best Post
Re: Noob question: C::B to gcc script
« Reply #3 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

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

Offline rcoll

  • Almost regular
  • **
  • Posts: 150
Re: Noob question: C::B to gcc script
« Reply #4 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