Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6969215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:33:10+00:00 2026-05-27T16:33:10+00:00

I’ve just started learning C++, and to display the outputs of code I found

  • 0

I’ve just started learning C++, and to display the outputs of code I found this method. This worked when I first compiled Structure of a Programme.cpp:

#include <iostream>

using namespace std;

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

It gave me a .exe, which I opened, ran, and got a lovely ‘Hello World!’ appearing, but when I tried compiling a second one, Variables.cpp:

#include <iostream>
using namespace std;

int main ()
{
    int a, b;
    int result;

    a=5;
    b=2;
    a=a+1;
    result=a-b;

    cout << result;

    return 0;
}

I didn’t get a .exe at all, so couldn’t work out how to open it. I tried re-compiling Structure of a Programme.cpp (after deleting all the associated files), but now that won’t create a .exe anymore, either. The only files created are Structure of a Programme.o and Variables.o (in a sub-directory obj\Debug).

The only question I could find that seemed similar was this, but the problem seems to be slightly different, and I tried deleting one of the files (so there was only one of Structure of a Programme.cpp or Variables.cpp in the folder) and I still had the same result.

Also, there were no compiler errors with either file, and I don’t think I changed any options in Code Blocks between Structure of a Programme working and everything not working.

Thanks,

Dalkius

edit: Build logs:

Compiling: Structure of a Programme.cpp
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

Compiling: Variables.cpp
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings

edit 2: ‘Full Commandline’ build logs:

Build started on: 14-12-2011 at 07:57.39
Build ended on: 14-12-2011 at 08:01.03
-------------- Clean: Debug in cplusplus.com Tutorial ---------------
Done. 
mingw32-g++.exe -Wall -g -c "D:\My Documents\0HOME\Programming\C++\Code Blocks\cplusplus.com Tutorial\Structure of a Programme.cpp" -o "obj\Debug\Structure of a Programme.o"
Process terminated with status 0 (0 minutes, 1 seconds)
0 errors, 0 warnings
mingw32-g++.exe -Wall -g -c "D:\My Documents\0HOME\Programming\C++\Code Blocks\cplusplus.com Tutorial\Variables.cpp" -o obj\Debug\Variables.o
Process terminated with status 0 (0 minutes, 0 seconds)
0 errors, 0 warnings
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:33:10+00:00Added an answer on May 27, 2026 at 4:33 pm

    From looking at your updated build log, it appears the linking step isn’t being performed to generate the final executable. There are a couple of things you can check and some ideas to try out:

    • Make sure the linker executable and proper path is set so C::B can locate it. For MinGW the linker is invoked through the compiler driver named ‘g++.exe’.
    • Check that ‘Console application’ is selected under ‘Type’.
    • If everything looks okay but it still doesn’t link try creating a new blank console project. Add the existing files to that project and try building it.
    • Try building it manually from a ‘cmd’ command prompt to make sure the toolchain itself is functioning. You should find a ‘mingwvars.bat’ script under your mingw install. Run that script to open up a proper commandline environment. Do a simple test compile using this command:

    cd “D:\My Documents\0HOME\Programming\C++\Code Blocks\cplusplus.com Tutorial”
    g++.exe -Wall -g Variables.cpp -o Variables.exe

    Lastly, this is what your log should approximately look like when it’s building correctly:
    C::B build log

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
We're building an app, our first using Rails 3, and we're having to build
i want to parse a xhtml file and display in UITableView. what is the
Does anyone know how can I replace this 2 symbol below from the string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.