Author Topic: Projects will not build  (Read 10418 times)

Offline Andrew Cay

  • Multiple posting newcomer
  • *
  • Posts: 10
Projects will not build
« on: July 17, 2013, 09:59:16 pm »
I am sure I have a compiler, I completely installed the minimalist pack.
Sorry if I'm using wrong terms, or just not saying anything completely right; I am completely new to code blocks and c++.

I believe this is a code blocks error, but I am most likely wrong.

Problem: Whenever I build my project (clicking the red arrow or green arrow ) it always says "this project has not been built yet would you like to build it?" And I will click yes. THEN, the same message will pop up right after I click yes and will continue to do that looping until I press no. When I press no, the console comes up telling me
"
Process returned 1982264457 (0x7626F489)   execution time : 0.000 s
Press any key to continue.
"
And when it's done, I get the return highlighted red as: Process terminated with status 1982264457 (0 minutes, 5 of seconds )

Now, I have messed with the paths and files that are used to run the c++ code, which I did through setting > compiler > toolchain executeables > c++ , BUT I reinstalled code blocks with the compiler built in. So, I reset everything and now it should be back to normal.

Yet, I am still having the looping problem and my projects are not being built at all.

One other problem: I'm just running the basic console application, where it has "hello world" and code block is underlining both those words in a string, giving me options to find references to them as if they were functions, variables, and such.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Projects will not build
« Reply #1 on: July 17, 2013, 10:47:46 pm »
I am sure I have a compiler, I completely installed the minimalist pack.
Sorry if I'm using wrong terms, or just not saying anything completely right; I am completely new to code blocks and c++.

I believe this is a code blocks error, but I am most likely wrong.

Problem: Whenever I build my project (clicking the red arrow or green arrow ) it always says "this project has not been built yet would you like to build it?" And I will click yes. THEN, the same message will pop up right after I click yes and will continue to do that looping until I press no. When I press no, the console comes up telling me
"
Process returned 1982264457 (0x7626F489)   execution time : 0.000 s
Press any key to continue.
"
And when it's done, I get the return highlighted red as: Process terminated with status 1982264457 (0 minutes, 5 of seconds )

Likely do NOT have CB toolchain done correctly or have a bad or no compiler.

Now, I have messed with the paths and files that are used to run the c++ code, which I did through setting > compiler > toolchain executeables > c++ , BUT I reinstalled code blocks with the compiler built in. So, I reset everything and now it should be back to normal.

Yet, I am still having the looping problem and my projects are not being built at all.

You are wrong; re-installing CB does NOT change the past settings.
Edit: Link to past post http://forums.codeblocks.org/index.php/topic,18075.msg123587.html#msg123587

I suggest doing this step 4 in my directions.
Quote
4. Click on "Result Defaults"


One other problem: I'm just running the basic console application, where it has "hello world" and code block is underlining both those words in a string, giving me options to find references to them as if they were functions, variables, and such.


Disable or configure the spell checker plugin.
« Last Edit: July 17, 2013, 10:50: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 Andrew Cay

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Projects will not build
« Reply #2 on: July 17, 2013, 10:57:39 pm »
Quote
You are wrong; re-installing CB does NOT change the past settings.
When I said reset, I meant I went into the compiler settings and pressed reset defaults.

And I re-installed codeblocks using a different binary file, one that included the gnu compiler. - Even though I already installed the gnu compiler manually before, and I'm sure I have all the correct compiler paths, and executables in the right place.


Quote
Disable or configure the spell checker plugin.
I disabled the spell checker. That problem is not happening any more, thank you.


Quote
Likely do NOT have CB toolchain done correctly or have a bad or no compiler.
How could I possibly know? I installed it two different times, once from the actual site and all the files seemed to be correct. And I had no errors from code blocks saying it was missing a compiler.
On top of that, I reinstalled code blocks, this time the one that Included the compiler. I would have hoped that worked. I could only imagine the first one I downloaded was a bad compiler, and codeblocks didn't overwrite what I had previously.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
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 Andrew Cay

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Projects will not build
« Reply #4 on: July 18, 2013, 01:35:58 am »
I followed the steps 1 by 1, and everything apparently is enabled automatically for the newest version which I am using.

I think the problem was that It's not being executed. (built)

And when I used the build button, and not the build and run, an error showed up
"Execution of 'mingw32-g++.exe -Wall -fexceptions  -g     -c C:\Users\userName\Desktop\newProj\main.cpp -o obj\Debug\main.o' in 'C:\Users\userName\Desktop\newProj' failed."

meaning It is not building, and I have no idea why. Maybe a bad compiler?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Projects will not build
« Reply #5 on: July 18, 2013, 02:26:51 am »
Post the Full Compiler Re-build log in Code Tags.

After Compiler issues, The next obvious issues is Windows Security or Virus Scanner issues.

FYI: Building code on the desktop might NOT be allowed by Windows Security or the Virus scanner software!

Tim S.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_My_build_fails_in_the_compile.2Flink.2Frun_step_with_a_Permission_denied_error.3F
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 Andrew Cay

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Projects will not build
« Reply #6 on: July 18, 2013, 04:57:29 am »
All I have for code is : main.cpp
Code
#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}


This is what happens when I try building the project
Code
-------------- Build: Debug in proj (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions  -g     -c "C:\Program Files (x86)\CodeBlocks\projects\proj\main.cpp" -o obj\Debug\main.o
Execution of 'g++.exe -Wall -fexceptions  -g     -c "C:\Program Files (x86)\CodeBlocks\projects\proj\main.cpp" -o obj\Debug\main.o' in 'C:\Program Files (x86)\CodeBlocks\projects\proj' failed.
Nothing to be done (all items are up-to-date).

This is what happens when I try running a project ( it loops with a "no build, want to build it?" until I press no. )
Code
Checking for existence: C:\Program Files (x86)\CodeBlocks\projects\proj\bin\Debug\proj.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Program Files (x86)\CodeBlocks\projects\proj\bin\Debug\proj.exe"  (in C:\Program Files (x86)\CodeBlocks\projects\proj\.)
Process terminated with status -1073741510 (0 minutes, 3 seconds)

Same thing happens in a different location, from desktop to c drive.  An exe is never made for the project apparently. It must be a bad compiler, correct? I mean - I'm 100% sure my anti-virus isn't blocking anything- but I don't know about windows.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Projects will not build
« Reply #7 on: July 18, 2013, 06:43:58 am »
Quote
Execution of 'g++.exe -Wall -fexceptions  -g     -c "C:\Program Files (x86)\CodeBlocks\projects\proj\main.cpp" -o obj\Debug\main.o' in 'C:\Program Files (x86)\CodeBlocks\projects\proj' failed.
C::B can't find you compiler...

Check the settings in Settings->Compiler->Selected compiler="GNU gcc Compiler"->Toolchain Executables if the path is correct
If you are using mingw "g++" is definitively wrong... Have you removed the old compiler, before installing the new one?

greetings

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Projects will not build
« Reply #8 on: July 18, 2013, 06:59:04 am »
Another link to thread with related problem.
http://forums.codeblocks.org/index.php/topic,17030.0.html

It contains my post the checks the Compiler.

http://forums.codeblocks.org/index.php/topic,17030.msg116201.html#msg116201

FYI: You NEED to know what folder works in Windows 7; Please stop using special folders!
Windows 7 tend to block that.

A good location to contain CB project suggested by another poster.
ToApolytoXaos: A path inside "c:\Documents and settings\blabla" or the modern "c:\user\blabla"

Tim S.
« Last Edit: July 18, 2013, 07:00:40 am 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 Andrew Cay

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: Projects will not build
« Reply #9 on: July 18, 2013, 07:41:58 am »
Thank's so much for your help! It really means a lot to me guys.

The problem was that my old mingw was bad, BUT I did have the new mingw on my computer thanks to the codeblocks installation that included it. What I had to do was completely remove all my old mingw files. This way, it wasn't automatically finding the bad one, and now everything works.

Thank's stahta01, you're a great person! Also you too blueHazzard, you were right about the g++ - but I forgot to reset the compiler to defaults after testing a couple answers I found on stack overflow (which didn't work) .

Sorry for the hassle everyone, really.


Ps, I'd just like to add: Windows 7 is not blocking me from using special paths. Desktop, nor the programs x86. But if it does in the future, I'll know what to do!

Offline lazy_john

  • Single posting newcomer
  • *
  • Posts: 5
Re: Projects will not build
« Reply #10 on: July 18, 2013, 09:47:28 am »
glad you fixed it
whenever you need to reset C::B to defaults just erase C::B folder from ..\"User"\Application Data,
also at reinstall/version change, all settings are kept there

ex:(win xp) C:\Documents and Setings\"User"\Application Data\CodeBlocks