Code::Blocks Forums

User forums => Help => Topic started by: sion005 on July 13, 2011, 03:46:28 pm

Title: build and rebuild in command promt
Post by: sion005 on July 13, 2011, 03:46:28 pm
Greeting, I'm a new user of CodeBlocks and I'm developing a software that needs to call the CodeBlocks compiler using the command prompt. I checked the manual of CodeBlocks and I used this command:

C:\CodeBlocks>codeblocks.exe /na /nd --no-splash-screen --no-batch-window-close --rebuild C:\Users\Pedro\Desktop\teste\teste\teste.cbp --target='Debug'

When I run this I always get the message "Nothing to be done" and the project is not rebuild. The same happens if i use --build instead of --rebuild.
However, if i try to build using CodeBlocks (not in command prompt but in the application), the build works with no problems...

Probably is something simple that I'm missing here, but I would appreciate any help. Thanks.
Title: Re: build and rebuild in command promt
Post by: stahta01 on July 13, 2011, 04:10:19 pm
Code::Blocks version/SVN?
Also, I think the OS Name and version will be needed.

Note: I have no idea how to help; but, the above info is needed in nearly all cases.

Edit: Might try double quote
Code
--target="Debug"

Edit: the cbp needs to be the last thing in the line per this wiki:
http://wiki.codeblocks.org/index.php?title=Code::Blocks_command_line_arguments (http://wiki.codeblocks.org/index.php?title=Code::Blocks_command_line_arguments)

Tim S.
Title: Re: build and rebuild in command promt
Post by: Jenna on July 13, 2011, 04:12:51 pm
Please copy and paste the exact command you use (the commandline in your first post seems to contain at least one typo).
Title: Re: build and rebuild in command promt
Post by: sion005 on July 15, 2011, 10:47:31 am
The command that I used is exactly the one that is on my first post.

The CodeBlock version is 10.05 and the OS is Windows 7.
Title: Re: build and rebuild in command promt
Post by: Jenna on July 15, 2011, 11:00:15 am
Again:
Please copy and paste the exact command you use (the commandline in your first post seems to contain at least one typo).
This can not work:
C:\CodeBlocks>codeblocks.exe /na /nd --no-splash-screen --no-batch-window-close --rebuild C:\Users\Pedro\Desktop\teste\teste\teste.cbp --target='Debug'
and so it can not be the exact commandline !
Title: Re: build and rebuild in command promt
Post by: sion005 on July 15, 2011, 03:35:11 pm
I finally got it! Like Tim S. said, I replaced the quote by double quote and worked fine. Problem solved!

So, the command to use to build/rebuild in the command prompt is:

codeblocks.exe /na /nd --no-splash-screen --no-batch-window-close --rebuild C:\GameDev\GettingsStarted\teste\teste.cbp --target="Debug"

By the way jens, C:\CodeBlocks> is the path where I have my CodeBlocks installation, is not part of the command. :)

Anyway, thanks for your help guys!
Title: Re: build and rebuild in command promt
Post by: Temtaime on June 10, 2021, 12:59:46 pm
Hello.
Trying to build from command line, it works OK, but there's no console output from codeblocks, but the wiki states that it should output something.
How can i get the build log ?
Title: Re: build and rebuild in command promt
Post by: BlueHazzard on June 10, 2021, 02:15:25 pm
Do not resurrect old threads, create a new one...

The build log is in the build log tab at the bottom of codeblocks.
If it is not visible:
View->Logs->Build log
Title: Re: build and rebuild in command promt
Post by: Temtaime on June 11, 2021, 11:59:34 pm
Thanks for a reply, but i'm talking about command line build, so this topic suits perfectly.
I cannot get any console output of out of codeblocks, but wiki states that ona can redirect the output even to a file
Title: Re: build and rebuild in command promt
Post by: oBFusCATed on June 12, 2021, 12:36:05 am
Have you tried to pass the --log-to-file command option?