Author Topic: Problem running and building projects  (Read 7314 times)

Borgel

  • Guest
Problem running and building projects
« on: August 05, 2009, 07:29:47 am »
im running windows whit CB 8,02.
i was following the tutorial provided by 3Dbuzz on how to make a small game. i was having some problem whit the game speed and started chanching stuff.
suddenly i weren't able to run or build the project anymore but if i did a debugg it worked fine. i tried to reset everything but where unsuccessful so i tried to reinstall CB. however this did not work. after a very long time of frustration and several other re installations i gave up and haven't done any programming for to long.

now when i try to pick it up aggain i now when i use the build and run function nothing happens then if i puch run the program runs and when i closes a second version of the program pops up.

i am also having a very strange problem whit my programs. i edited the code of my programs but when i build it then run it it is still the on edited program that runs. i tried to save the edited program and reopen it but it still runs the old program.

i am fairly new to programming but love it and this rely destroys my will to program. please help

highendman

  • Guest
Re: Problem running and building projects
« Reply #1 on: August 09, 2009, 01:23:38 pm »
Quote
i am also having a very strange problem whit my programs. i edited the code of my programs but when i build it then run it it is still the on edited program that runs. i tried to save the edited program and reopen it but it still runs the old program.

I have the same Problem.

Help! :D

Offline Seronis

  • Almost regular
  • **
  • Posts: 197
Re: Problem running and building projects
« Reply #2 on: August 09, 2009, 11:11:15 pm »
make sure you save the -file- before building.  The compiler reads the saved file, not the file as it appears in the CB editor. 

Borgel

  • Guest
Re: Problem running and building projects
« Reply #3 on: August 10, 2009, 02:08:58 pm »
i have saved it. this did not work and when i closed CB and reopened the program the edited version appeared in text but the unedited program appeared when i built it.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Problem running and building projects
« Reply #4 on: August 10, 2009, 02:21:03 pm »
Please switch on full commandline logging:
change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline",

then do a rebuild (clean and build not build and run) and post the output of the Build log,
then run the program from inside C::B and post the new output from the Build log.

Offline Rimdeker

  • Single posting newcomer
  • *
  • Posts: 5
Re: Problem running and building projects
« Reply #5 on: August 12, 2009, 02:26:19 pm »
I have a very similar problem

I do not know why but for some reason I cannot compile things properly anymore.
Everything began this early morning, I tried to compile something but the default output window would not pop-up and there were no messages or anything in the build log. So , I restarted Code::Blocks and tried it again. Now the funny thing is if I click build&run it compiles but does not run, when I click on run then the program runs twice. Like, I quit the first instance a second instance of the program pops up (Like in OP's case). And another thing: If I try to compile AGAIN after that it does not compile but runs the first few lines of the program WITHIN the build log, then the build and run buttons are greyed out and I have to restart Code::Blocks.
I tried reinstalling and all but nothing helped, I don't really want to switch to another IDE, either. Code::Blocks seems to be the best free one available and I never had any problems with but this problem is driving me nuts.
C++? I like that stuff!

Be nice , be cool.
A smile is like a boomerang, it'll eventually come back to you :).

Offline Rimdeker

  • Single posting newcomer
  • *
  • Posts: 5
Re: Problem running and building projects
« Reply #6 on: August 12, 2009, 02:31:36 pm »
Please switch on full commandline logging:
change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline",

then do a rebuild (clean and build not build and run) and post the output of the Build log,
then run the program from inside C::B and post the new output from the Build log.

I did as you said and got this for the first build:
mingw32-g++.exe    -c "D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.cpp" -o "D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.o"
mingw32-g++.exe  -o "D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.exe" "D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.o"   
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
 
Checking for existence: D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.exe
Executing: D:\Programme\CodeBlocks/cb_console_runner.exe "D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.exe" (in D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++)
Process terminated with status 0 (0 minutes, 19 seconds)
 
I think that's totally okay but when I try to build it again or any other program I get this:
mingw32-g++.exe    -c "D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.cpp" -o "D:\Dokumente und Einstellungen\Rimdeker\Eigene Dateien\C++\Rimdeker.o"
Welcome to Hangman. Good Luck!
You have 8 incorrect guesses left.
You've used the following letters:
So far, the word is:
---------
Enter your guess:

Lol, those are the first lines of output of the program I was working on before this problem occured. Of cours, I cannot type in the build log and the build , run and buil&run buttons are greyed out and unclickable.
C++? I like that stuff!

Be nice , be cool.
A smile is like a boomerang, it'll eventually come back to you :).

mau

  • Guest
Re: Problem running and building projects
« Reply #7 on: August 20, 2009, 02:49:04 am »
Good Night Everybody!

I'm having some issues with code blocks!
My code compiles in DEV, but not in code blocks... :(
It's a simple code:
#include <iostream>

using namespace std;

bool primo(int num){
    for(int cont = 0; cont <= num/2; cont++){
        if(num%cont == 0){
            return false;
        }
    }
    return true;
}


int main(){

    if(!primo(1)){
        cout<< "primo";
    }
    else
        cout << "nao";

    return 0;
}

And the return from code blocks is:
Process terminated with status -1073741676 (0 minutes, 3 seconds)

Can somebody give me some help about it?

ps: sorry about some language mistake, english is not spoken in my country!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Problem running and building projects
« Reply #8 on: August 20, 2009, 06:30:02 am »
Good Night Everybody!

I'm having some issues with code blocks!
My code compiles in DEV, but not in code blocks... :(
It's a simple code:
#include <iostream>

using namespace std;

bool primo(int num){
    for(int cont = 0; cont <= num/2; cont++){
        if(num%cont == 0){
            return false;
        }
    }
    return true;
}


int main(){

    if(!primo(1)){
        cout<< "primo";
    }
    else
        cout << "nao";

    return 0;
}

And the return from code blocks is:
Process terminated with status -1073741676 (0 minutes, 3 seconds)

Can somebody give me some help about it?

ps: sorry about some language mistake, english is not spoken in my country!

Please do not hijack threads, that have nothing to do with your problem !!

And be aware, that our forum is not a general programming forum, neither a mathmatical forum.

Your problem is mathmatical exception in the function primo, due to a logical (mathmatical) error.
That should be hint enough.

Offline blueshake

  • Regular
  • ***
  • Posts: 458
Re: Problem running and building projects
« Reply #9 on: August 20, 2009, 06:40:41 am »
as jens said.it is nothing with codeblock.
when you pass 1 to primo,the cont is 0,
and in this statement,num%cont ,error rise up.
it is simple problem,if you  do a debugger.
Keep low and hear the sadness of little dog.
I fall in love with a girl,but I don't dare to tell her.What should I do?