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

Author Topic: Anoying problem  (Read 15741 times)

0 Members and 1 Guest are viewing this topic.

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #15 on: July 07, 2008, 08:27:02 am »
is it sure that not anyone have a clue? can for some reason dont do a thing in sfml with any kind of window:( been so for over a week now:(
Why can't things just work?

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Anoying problem
« Reply #16 on: July 07, 2008, 02:34:41 pm »
Hi Regen,

do you use SVN versions or the 1.3 ? Some threading stuffs in your app ? If you use visual, make you use the crt corresponding to your config (/MDd => debug, /MD else).

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #17 on: July 07, 2008, 03:12:23 pm »
hi!

I use the 1.3 versions, and it all worked great for some time, then i must have made somthing with my settings or so.

with threading, do you mean sf::tread? in that case, no.

i use VS2008 (and have tried the code with VS2005 to), so how do i change/check the setting you talked about?
Why can't things just work?

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Anoying problem
« Reply #18 on: July 07, 2008, 03:28:18 pm »
For runtime lib, see in your project properties (C/C++ => code generation), debug config must be /MDd (multithread debug DLL) and release /MD (multithread DLL).

Can you upload somewhere an archive with your project to see if we can reproduce the bug ? =)

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #19 on: July 07, 2008, 03:39:24 pm »
ah, well i found out that debug was on /MD but sadly.....it didnt help:(

hmm, i will try to find a way to upload it somewhere!

thanks for caring about me  :D

edit: project is here:
http://w17.easy-share.com/1700843849.html

(a lot of comersial and you have to see it for 15 secs....)
Why can't things just work?

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Anoying problem
« Reply #20 on: July 07, 2008, 04:26:20 pm »
I see that you don't use project properties to specify your library and include paths (additional lib and include paths are empty). Try to erase all paths related to SFML you have specified in visual studio global options (tools => options => project and solutions => vc++ directories), and fill, in your project settings, "C/C++ => General => other include directories" ([SFML_1.3_path]/include/), "Linker => general => other libraries directories" ([SFML_1.3_path]/lib/).

My point is ,maybe, you link against old version of SFML and use 1.3 DLL which could cause the bug.

Anyway, i tried your project, and i couldn't reproduce your problem.

PS : Not sure about settings name, I use VS in french. =p

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #21 on: July 08, 2008, 09:17:26 am »
I took away all settings in "tools -> options -> projects and solutions -> VC++ directories. All inc and lib have been taken away (even older inc/libs from other projects then SFML)

Not a thing changed :cry:  :cry:

I have been using other libraries such as delta3d and openscenegraph, when i did so I added som things in the path in windowssystem enviroment-variables..... can it have something to do with that? but if I only added?

thanks alot SirJulio for takin your time to test the thing! :D

edit: now I'm sick of this...resetting VS2008

edit again: I have now taken drastic messures and took another computer with a fresh copy of windows XP, installed VS2008, downloaded sfml 1.3.
I cheered when the code above worked and started to expand it, after about 15 i had some larger code to compile......then the error occured, so i took away everything i added the past 15 minutes, but the the error is STIL there! :evil: How is that even possible?!?!
Why can't things just work?

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
Anoying problem
« Reply #22 on: July 08, 2008, 12:23:13 pm »
Can you give us a sample code with this error ?

AMHA : The problem is between the keyboard and the chair  :wink:
Mindiell
----

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #23 on: July 08, 2008, 12:33:25 pm »
Quote from: "Mindiell"
Can you give us a sample code with this error ?

AMHA : The problem is between the keyboard and the chair  :wink:


The simple sample-code is on page one at the bottom of this thread.
and yup, no doubt the biggest problem with the code is between the keyboard and the chair :lol:
Why can't things just work?

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Anoying problem
« Reply #24 on: July 08, 2008, 02:45:39 pm »
Ok, some things :

- Could you try to compile your code with MinGW or another C++ compiler to see if you can reproduce the problem ?

- Make sure you use VS2008 library (and not the VS2005).

- Could you compile a very simple windows in WinApi

Code: [Select]
#include <windows.h>

LRESULT CALLBACK mainCallback(HWND mainWin, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;

        default:
            return DefWindowProc(mainWin, message, wParam, lParam);
    }
}

int WINAPI WinMain (HINSTANCE current, HINSTANCE previous, LPSTR comm, int mode)
{
    HWND mainWin;
    MSG message;
    WNDCLASS windowClass;

    windowClass.style = 0;
    windowClass.lpfnWndProc = mainCallback;
    windowClass.cbClsExtra = 0;
    windowClass.cbWndExtra = 0;
    windowClass.hInstance = NULL;
    windowClass.hIcon = NULL;
    windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
    windowClass.hbrBackground = (HBRUSH)(1 + COLOR_BTNFACE);
    windowClass.lpszMenuName =  NULL;
    windowClass.lpszClassName = "test";

    // On prévoit quand même le cas où ça échoue
    if(!RegisterClass(&windowClass)) return FALSE;

    mainWin = CreateWindow( "test", "SFML test", WS_OVERLAPPEDWINDOW,
                            CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
                            NULL, NULL, current, NULL);

    if (!mainWin) return FALSE;

    ShowWindow(mainWin, mode);
    UpdateWindow(mainWin);

    while (GetMessage(&message, NULL, 0, 0))
    {
        TranslateMessage(&message);
        DispatchMessage(&message);
    }
    return message.wParam;
}


Finally, if nothing worked, maybe you can try that. =D

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #25 on: July 08, 2008, 03:30:42 pm »
Tried the winApi prog, works verry well (exeptions of just boxes instead of text in the upper left corner)

And I checked once again so i used the 2008 libs, and.....I did.

Have tried minigw a little but hate those long commands to compile, so I guess i try with:
"The power of christ compels juh!" :wink:

the most annoying thing is that it works for a little while, then stops without me changing even one setting:(
Why can't things just work?

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
Anoying problem
« Reply #26 on: July 08, 2008, 04:28:53 pm »
Damn ! though one !

Forgot to ask but did you use static or dynamic libs ? Have you tried both ?

You said that debug config works but not the release. Try to deactivate all optimisations (C/C++ => optimisation) of release cfg to see if that changes something.

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #27 on: July 09, 2008, 09:45:53 am »
I maybe should tell you that now when i have my libs/includes in the VC-dir, when i refer to them both for the project additional and in the general extra includes/libs I still have a wierd problem... I still have to go to "controlpanel->system->EnviromentVariables", and there i have to add the searchpath to the sfml-dlls, if i dont do this...VS can't find them..'

but anyway, when i do that, I still get the other error, even if i have static/dynamic och both:S

Quote

You said that debug config works but not the release. Try to deactivate all optimisations (C/C++ => optimisation) of release cfg to see if that changes something.

When i took a new computer with a fresh copy of windows/VS2008 release works as good (read bad) as debug.
Why can't things just work?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Anoying problem
« Reply #28 on: July 09, 2008, 10:23:05 am »
Which version of Visual C++ 2008 are you using ?
Laurent Gomila - SFML developer

Regen

  • Newbie
  • *
  • Posts: 42
    • View Profile
    • Email
Anoying problem
« Reply #29 on: July 09, 2008, 10:24:08 am »
Quote from: "Laurent"
Which version of Visual C++ 2008 are you using ?


Version 9.0 is there some problems with that?
Why can't things just work?

 

anything