Author Topic: build and rebuild in command promt  (Read 14931 times)

Offline sion005

  • Single posting newcomer
  • *
  • Posts: 3
build and rebuild in command promt
« 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.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: build and rebuild in command promt
« Reply #1 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

Tim S.
« Last Edit: July 13, 2011, 04:15:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: build and rebuild in command promt
« Reply #2 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).

Offline sion005

  • Single posting newcomer
  • *
  • Posts: 3
Re: build and rebuild in command promt
« Reply #3 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.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: build and rebuild in command promt
« Reply #4 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 !

Offline sion005

  • Single posting newcomer
  • *
  • Posts: 3
Re: build and rebuild in command promt
« Reply #5 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!

Offline Temtaime

  • Single posting newcomer
  • *
  • Posts: 4
Re: build and rebuild in command promt
« Reply #6 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 ?

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: build and rebuild in command promt
« Reply #7 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

Offline Temtaime

  • Single posting newcomer
  • *
  • Posts: 4
Re: build and rebuild in command promt
« Reply #8 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

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: build and rebuild in command promt
« Reply #9 on: June 12, 2021, 12:36:05 am »
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!]