Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: During startup program exited with code 0xc0000135  (Read 51202 times)

0 Members and 1 Guest are viewing this topic.

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
During startup program exited with code 0xc0000135
« on: June 25, 2012, 01:01:01 pm »
Hello,

I got SFML working and running. But when I add the following line to my code:

sf::Http http;

I get an error "The program has unexpectedly finished." in my Application output.
I tried using Breakpoints and #defines but no output is visible.

When I run it in "debug" mode I get a pop-up with the error as described in this topic title.

When I just run my game (without the Http code) everything works, runs, debugs and compiles just fine.
I tried Google but no solutions there, and I cannot find what is wrong.

The error only comes when I try to use the Http code.

Anyone knows any solution or anything I can try?

My .pro file:
QT       += core gui

TARGET = project
TEMPLATE = app


SOURCES += main.cpp

HEADERS  +=

LIBS += -L"C:\\SFML\lib" -lsfml-graphics -lsfml-window -lsfml-system -lsfml-network

INCLUDEPATH = "C:\\SFML\\include"

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #1 on: June 25, 2012, 01:05:25 pm »
Which version of SFML, and which archive precisely did you download? What is your version of MinGW (paste the output of "gcc -v")?
Laurent Gomila - SFML developer

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: During startup program exited with code 0xc0000135
« Reply #2 on: June 25, 2012, 01:11:05 pm »
Hey Laurent,

thanks for your reply! I am still learning so sorry if I fail to provide all the needed information.

- I am on a Windows 7 64-Bit machine
- I am using Qt SDK (newest version)
- I have Microsoft Visual Studio 2010 Professional installed as well
- I dowloaded the SFML 2.0 Snapshot.
- I am using (I think) the Mingw 4.4 (Qt SDK).

Not sure what you mean with "which archive precisely did you download", and neither I have a clue how to paste the output of gcc -v. I will try to find it on google, if I can find it I will edit my post :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #3 on: June 25, 2012, 01:18:43 pm »
There are many different versions of gcc (MinGW) on Windows, incompatible with each other:
- the threading model can be different (pthread vs Win32)
- the exception model can be different (SJLJ vs DW2)
- the ABI can be different (gcc 4.7 is not always compatible with previous versions)
- etc. (I don't even know all the potential sources of incompatibilities)

So it is very important to make sure that you use a version of SFML that was compiled with a gcc which is cmopatible with yours. It's a little complicated to figure out if you're a beginner, unfortunately. But if you open a console, type "gcc -v" and show me the output, I'll be able to tell you whether it's ok or not.

There's another solution: recompile SFML with your own gcc.

Quote
Not sure what you mean with "which archive precisely did you download"
What's the name of the SFML archive that you downloaded from the website?
« Last Edit: June 25, 2012, 01:20:39 pm by Laurent »
Laurent Gomila - SFML developer

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: During startup program exited with code 0xc0000135
« Reply #4 on: June 25, 2012, 01:23:17 pm »
Wow, that sounds like "abracadabra" to me hahaha.
Anyways, the following result came up when consulting my prompt:



And what I downloaded, if you go to http://www.sfml-dev.org/download.php you see a download link for "SFML 2.0 snapshot". That's the one I downloaded :)

When you unpack it, the folder is something with the name "Laurent Gomila" in it ;)
« Last Edit: June 25, 2012, 01:24:55 pm by GroundZero »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #5 on: June 25, 2012, 01:26:53 pm »
Quote
And what I downloaded, if you go to http://www.sfml-dev.org/download.php you see a download link for "SFML 2.0 snapshot". That's the one I downloaded
So you compiled it?? How? With which CMake options?

You should rather download the pre-compiled release candidate (below on the download page).
Laurent Gomila - SFML developer

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: During startup program exited with code 0xc0000135
« Reply #6 on: June 25, 2012, 01:33:45 pm »
I was thinking about that, but it says windows 32 bit only, and since I am running on a 64-bit system (CPU) I thought it might give problems in the future?

Anyways what I did (out of my head, dont shoot me if I dont tell it all right lol).

1. Unpacked it
2. Set my Path to my Qt Mingw folder (MS-DOS Prompt)
3. Started the cmake-gui.exe
4. Chose "MinGW Makefiles" and "Use default native compilers"

and that's basicly it, rest is known as just including it in your .pro file :)

I will download the pre-compiled version later today, to see if I can get that working if that is better :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #7 on: June 25, 2012, 01:36:44 pm »
Quote
I was thinking about that, but it says windows 32 bit only, and since I am running on a 64-bit system (CPU) I thought it might give problems in the future?
No no, it's safe to use 32-bits DLLs and programs on a 64-bits OS. The version of Qt that you downloaded is most likely a 32-bits one, by the way.
Laurent Gomila - SFML developer

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: During startup program exited with code 0xc0000135
« Reply #8 on: June 25, 2012, 01:52:22 pm »
Yeah just took the Qt SDK from the mainlink on the index, which is Qt 4.7.4 32-bit :)
I will try that pre-compiled version today, after I will let you know if that solved the problem :)

Update
Just used the RC version, but still the same error...   :'(

SFML 2.0 Release Candidate - Windows 32 bits - GCC DW2 (11.5 MB)
« Last Edit: June 25, 2012, 02:05:25 pm by GroundZero »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #9 on: June 25, 2012, 02:09:47 pm »
Make sure that you deleted everything from the previous version that you compiled, and that you completely rebuilt ("clean") your project with the new version.
Laurent Gomila - SFML developer

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #10 on: June 25, 2012, 02:10:54 pm »
By the way, what's around the code that you showed (is it in a function? at global scope? ...)? Can you show a complete and minimal code that reproduces this problem?
Laurent Gomila - SFML developer

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: During startup program exited with code 0xc0000135
« Reply #11 on: June 25, 2012, 02:20:59 pm »
I will rebuild everything in a bit, for now I just replaced the files from the by me compiled, with the release candidate one :) (different location though).

#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Network.hpp>
#include <iostream>
#include <string>

int main()
{
     // Create a new HTTP client
     sf::Http http;
     /*
     // We'll work on http://www.sfml-dev.org
     http.setHost("http://www.sfml-dev.org");

     // Prepare a request to get the 'features.php' page
     sf::Http::Request request("features.php");

     // Send the request
     sf::Http::Response response = http.sendRequest(request);

     // Check the status code and display the result
     sf::Http::Response::Status status = response.getStatus();
     if (status == sf::Http::Response::Ok)
     {
         std::cout << response.getBody() << std::endl;
     }
     else
     {
         std::cout << "Error " << status << std::endl;
     }
     */


    // end program
    return 0;
}

As you can see in the code above, the only thing which will be read (the rest is commented) is the command where we declare a new Http value.

That is where the error is generator (the program stops working).

My .pro file is as follow:
#-------------------------------------------------
#
# Project created by QtCreator 2012-06-24T16:09:39
#
#-------------------------------------------------

QT       += core gui

TARGET = project
TEMPLATE = app


SOURCES += main.cpp

HEADERS  +=

LIBS += -L"C:\\Users\Angelo\\Desktop\\SFML-2.0-rc\\lib" -lsfml-graphics -lsfml-window -lsfml-system -lsfml-network

INCLUDEPATH = "C:\\Users\\Angelo\\Desktop\\SFML-2.0-rc\\include"

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #12 on: June 25, 2012, 02:26:46 pm »
You should link to the debug SFML libraries when you build your app in debug mode.

CONFIG(debug, debug|release) {
    LIBS += -lsfml-graphics-d etc...
}
CONFIG(release, debug|release) {
    LIBS += -lsfml-graphics etc...
}
 
Laurent Gomila - SFML developer

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: During startup program exited with code 0xc0000135
« Reply #13 on: June 25, 2012, 04:30:22 pm »
Oh never knew (nor seen) that, going to try that out now :)

Update:
Still nothing...

Quote
Debugging starts
Debugging has finished

And a pop-up saying:

Quote
During startup program exited with code 0x0000135

My Pro file:
Code: [Select]
QT       += core gui

TARGET = project
TEMPLATE = app


SOURCES += main.cpp

HEADERS  +=

#LIBS += -L"C:\\Users\Angelo\\Desktop\\SFML-2.0-rc\\lib" -lsfml-graphics -lsfml-window -lsfml-system -lsfml-network

INCLUDEPATH = "C:\\Users\\Angelo\\Desktop\\SFML-2.0-rc\\include"

CONFIG(debug, debug|release) {
    LIBS += -L"C:\\Users\Angelo\\Desktop\\SFML-2.0-rc\\lib" -lsfml-graphics -lsfml-window -lsfml-system -lsfml-network
}
CONFIG(release, debug|release) {
    LIBS += -L"C:\\Users\Angelo\\Desktop\\SFML-2.0-rc\\lib" -lsfml-graphics -lsfml-window -lsfml-system -lsfml-network.
}

and in my main loop all I have is:

Code: [Select]
sf::Http http;
return 0;

All of SFML works great (so far) except the Http class :D

EDIT: Been using Google all day but no solution yet ;  ;

I made a fast movie so anyone can see my settings and code, probably easier then copy pasting it everytime... hope someone has some more tips which I can try out :)

Movie of my files (.mp4 format)
« Last Edit: June 25, 2012, 08:32:34 pm by GroundZero »

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: During startup program exited with code 0xc0000135
« Reply #14 on: June 26, 2012, 08:12:37 am »
You use the exact same settings in both debug and release...

And you don't need to duplicate things that don't change (like the library path), you can set it outside the debug/release blocks.
Laurent Gomila - SFML developer