Author Topic: Program that worked in Win XP doesn't work on Win 8.1  (Read 8773 times)

Offline peter

  • Single posting newcomer
  • *
  • Posts: 4
Program that worked in Win XP doesn't work on Win 8.1
« on: March 13, 2014, 09:43:31 am »
I bought a new computer with Windows 8.1 and downloaded codeblocks (codeblocks-13.12mingw-setup.exe). A program that I wrote with codeblocks on Win XP now doesn't work. It starts but somewhere along the line it stops and gives the following error: Process terminated with status 255.

The standard Hello World program does work.

How can I solve this?

Thanks,
Peter

Offline Vuki

  • Multiple posting newcomer
  • *
  • Posts: 41
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #1 on: March 13, 2014, 11:06:58 am »
It's impossible to tell without knowing your code. Windows 8 is much more restrictive in user access rights than XP. Maybe you run a program which tries to write to a restricted directory.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #2 on: March 13, 2014, 11:44:45 am »
Where is the relation to C::B ?
Note Code::Blocks is not a compiler "just" an IDE.

If there is no relation, this thread violates our forum rules.

Offline peter

  • Single posting newcomer
  • *
  • Posts: 4
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #3 on: March 13, 2014, 05:34:19 pm »
Since it worked on XP and doesn't on Windows 8 I assume it has to do with the installation of codeblocks right? Maybe there is some setting that I missed. If not, I apologise for posting here. Where do I then go?

For what it's worth, the code of the file where it stops is

Code
#include "Data.h"

#include <string>
#include <iostream>
#include <fstream>

using namespace std;

size_t Data::getLines(string map, string name, string lines[])
{
    size_t i = 0;
    string fileName = map + "-" + name + ".txt";  // here it stops
    ifstream teksten(fileName.c_str());
    while (!teksten.eof())
    {
        getline(teksten, lines[i]);
        i++;
    }
    teksten.close();
    return i;
}

Online stahta01

  • Lives here!
  • ****
  • Posts: 7679
    • My Best Post
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #4 on: March 13, 2014, 05:42:33 pm »
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 peter

  • Single posting newcomer
  • *
  • Posts: 4
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #5 on: March 13, 2014, 06:21:08 pm »
I read them already. I'm not asking a programming question because the program I wrote worked and I changed nothing about that. It's not a compiler question because it compiles, it just stops running at some point. The only thing I changed is I downloaded Codeblocks on windows 8 instead of XP so that's why I'm posting in this forum ( There's the "Using CodeBlocks" board to help newbies set up their compilers and change their configuration). It seems to me this question belongs in this forum. If not, point me to where it does and I gladly go there.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7679
    • My Best Post
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #6 on: March 13, 2014, 06:26:18 pm »
http://wiki.codeblocks.org/index.php?title=FAQ-Issues_and_Workarounds#Q:_I_posted_on_the_forums_that_Code::Blocks_was_not_working.2C_but_no_one_could_help_me.3F

After that fails to help you please go to a website that supports your OS, Compiler and C++.
I suggest http://cboard.cprogramming.com/ remember to post the full "build log".
Edit: I am just guessing it will fail; but, who knows there might be a problem shown if you post the information.

Tim S.
 
« Last Edit: March 13, 2014, 08:25:38 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

Online stahta01

  • Lives here!
  • ****
  • Posts: 7679
    • My Best Post
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #7 on: March 13, 2014, 08:27:23 pm »
Something I was planning to put on the Wiki; but, I have NOT yet done it.

Using MinGW GCC in Code::Blocks (CB) problems types:
   1. Toolchain configuration issues
       See link for things to try to fix Toolchain http://forums.codeblocks.org/index.php/topic,18075.0.html
   2. Compiler Installation issues
      a. Compiler not installed
      b. Compiler only partly installed
      c. Compiler installation damaged
   3. Compiler Conflict issues
      a. Cygwin in the system path
      b. MSys in the system path
      c. Special folder exists on your computer.
   4. CB project settings issues
      a. Project/target is not using the correct Compiler
      b. Project is using more than one Compiler
   5. Security related issues
      a. Windows security
      b. Anti-Virus caused issues

Your problem is likely caused by a part 5 "Security related issues".

Tim S.
« Last Edit: March 13, 2014, 08:32:08 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: 7252
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #8 on: March 13, 2014, 08:56:54 pm »
Might also be a different path in "Project -> Properties -> Build targets -> [actual target] -> {Execution working dir and/or Output filename}", so the file can not be found.
Unfortunately this is a very common error.

Both are not C::B but configuration errors, but more or less (more less than more  ;) ) related to C::B.

Offline peter

  • Single posting newcomer
  • *
  • Posts: 4
Re: Program that worked in Win XP doesn't work on Win 8.1
« Reply #9 on: March 17, 2014, 10:01:41 am »
Thanks all for your responses. I just got it to work by just rebuilding the project. You're probably facepalming for this, but all I ever used was the Build and Run button.