News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

noob problems

Started by AidanSana, March 05, 2015, 09:35:48 PM

Previous topic - Next topic

AidanSana

Hello everyone. I just started studying C++ and am having troubles with CodeBlocks. It was working fine for me at first but now every time I try to build a new program it keeps asking me over and over again if I want to build it when I click yes. When I click no it just returns a bunch of random numbers. Here is the code I'm using.

// listing 2.2 using std::cout
#include <iostream>
int main()
{
std::cout << "Hello there. \";
std::cout << "Here is 5: " << 5 << "\n";
std::cout << "The manipulator std::endl ";
std::cout << "Writes a new line to the screen.";
std::cout << std:: endl;
std::cout << "Here is a very big number:\t" << 70000;
std::cout << std::endl;
std::cout << "Here is the sum of 8 and 5:\t";
std::cout << 8+5 << std::endl;
std::cout << "here's a fraction:\t\t";;
std::cout << (float 5/8 << std::endl;
std::cout << "And a very very big number: \t";
std::cout << (double) 7000 * 7000 << std::endl:
std::cout << "Don't forget to replace Jesse Liberty ";
std::cout << "With your name...\n";
std::cout << "Jesse Liberty is a C++ programmer!\n";
return 0;
}

stahta01

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]

AidanSana

-------------- Run: Debug in 4 (compiler: GNU GCC Compiler)---------------

Checking for existence: C:\Users\Stephen\Work\4\bin\Debug\4.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Users\Stephen\Work\4\bin\Debug\4.exe"  (in C:\Users\Stephen\Work\4\.)
Process terminated with status -1073741510 (0 minute(s), 4 second(s))

Jenna

Quote from: AidanSana on March 05, 2015, 10:15:23 PM
-------------- Run: Debug in 4 (compiler: GNU GCC Compiler)---------------

Checking for existence: C:\Users\Stephen\Work\4\bin\Debug\4.exe
Executing: "C:\Program Files (x86)\CodeBlocks/cb_console_runner.exe" "C:\Users\Stephen\Work\4\bin\Debug\4.exe"  (in C:\Users\Stephen\Work\4\.)
Process terminated with status -1073741510 (0 minute(s), 4 second(s))

Please do what the link Tim posted says:
Quote from: http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3FDo a re-build instead of build in order to get a full build log.
Just rebuild (or lean and build), do not (yet) run and copy and paste the content of the build-log.

AidanSana

ok this is what I got now

mingw32-g++.exe -Wall -fexceptions -g  -c E:\Programs\3.cpp -o obj\Debug\E\Programs\3.o
E:\Programs\3.cpp:5:14: warning: missing terminating " character [enabled by default]
E:\Programs\3.cpp:5:1: error: missing terminating " character
E:\Programs\3.cpp: In function 'int main()':
E:\Programs\3.cpp:15:15: error: expected primary-expression before 'float'
E:\Programs\3.cpp:15:15: error: expected ')' before 'float'
E:\Programs\3.cpp:17:47: error: found ':' in nested-name-specifier, expected '::'
E:\Programs\3.cpp:17:43: error: 'std::endl' is not a class or namespace

Jenna

What about fixing your code ?
The error-messages are quiet clear.

AidanSana

Wow I really should of checked my typing. I thought I had copied it exactly as it was in the book. Thank you.