Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: Alwayssnarky on May 23, 2014, 08:31:42 pm

Title: Command line style compile in Code::Blocks?
Post by: Alwayssnarky on May 23, 2014, 08:31:42 pm
I am attempting to complete a tutorial using codeblocks, and one of the instructions is to compile it with the commands " g++ src/*.cpp -o tuto -Iinclude -Llib -ltcod-mingw-static-libgcc -static-libstdc++ -Wall".  Is there a way to type that out to compile in codeblocks?  And if not, wat would I do instead?  Thanks!
Title: Re: Command line style compile in Code::Blocks?
Post by: oBFusCATed on May 23, 2014, 08:53:44 pm
Create a project and press build...

Or just open the file and press build or compile file...
Title: Re: Command line style compile in Code::Blocks?
Post by: Alwayssnarky on May 23, 2014, 09:34:12 pm
Returns the error "||=== Build: Debug in TestRL (compiler: GNU GCC Compiler) ===|
obj\Debug\main.o||In function `main':|
C:\coding\projects\TestRL\main.cpp|3|undefined reference to `_imp___ZN11TCODConsole8initRootEiiPKcb15TCOD_renderer_t'|
C:\coding\projects\TestRL\main.cpp|5|undefined reference to `_imp___ZN10TCODSystem13checkForEventEiP10TCOD_key_tP12TCOD_mouse_t'|
C:\coding\projects\TestRL\main.cpp|6|undefined reference to `_imp___ZN11TCODConsole4rootE'|
C:\coding\projects\TestRL\main.cpp|6|undefined reference to `_imp___ZN11TCODConsole5clearEv'|
C:\coding\projects\TestRL\main.cpp|7|undefined reference to `_imp___ZN11TCODConsole4rootE'|
C:\coding\projects\TestRL\main.cpp|7|undefined reference to `_imp___ZN11TCODConsole7putCharEiii17TCOD_bkgnd_flag_t'|
C:\coding\projects\TestRL\main.cpp|8|undefined reference to `_imp___ZN11TCODConsole5flushEv'|
C:\coding\projects\TestRL\main.cpp|4|undefined reference to `_imp___ZN11TCODConsole14isWindowClosedEv'|
||=== Build failed: 8 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|"
Title: Re: Command line style compile in Code::Blocks?
Post by: stahta01 on May 23, 2014, 09:48:01 pm
If you want help, please read and follow this FAQ.
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

This means post a "build log" NOT a message log!

Link to user docs that might help you.
http://wiki.codeblocks.org/index.php?title=User_documentation (http://wiki.codeblocks.org/index.php?title=User_documentation)

Tim S.
Title: Re: Command line style compile in Code::Blocks?
Post by: Alwayssnarky on May 23, 2014, 11:34:13 pm
Ok, I figured it out, I was misunderstanding how the linking and such worked, and confused myself.  Sorry to trouble you with my newbie mistakes.  Thanks for the help!