News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

build and rebuild in command promt

Started by sion005, July 13, 2011, 03:46:28 PM

Previous topic - Next topic

sion005

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.

stahta01

#1
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
--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

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]

Jenna

Please copy and paste the exact command you use (the commandline in your first post seems to contain at least one typo).

sion005

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.

Jenna

Again:
Quote from: jens 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).
This can not work:
Quote from: sion005 on July 13, 2011, 03:46:28 PM
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 !

sion005

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!

Temtaime

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 ?

BlueHazzard

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

Temtaime

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

oBFusCATed

Have you tried to pass the --log-to-file command option?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]