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

Author Topic: Works fine on one machine, crashes on the other?  (Read 3725 times)

0 Members and 1 Guest are viewing this topic.

Neo1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Works fine on one machine, crashes on the other?
« on: October 28, 2011, 05:42:06 pm »
So i've just finished a tiny hobby project that generates a random perfect maze using a randomized DFS. I coded it all on my laptop (Running Windows 7) using Code::Blocks 10.05 and MinGW with GCC 4.5.2, it's not quite finished and polished yet, but it works and runs. I use the dynamic libraries and i link against:

-lsfml-graphics-d
-lsfml-window-d
-lsfml-system-d

I define SFML_DYNAMIC and the proper DLLs are where they belong, so far so good.

So since the program runs quite slowly (I'm doing some stupid conversions and copies of some semi-large vectors in my main loop, as i said, not quite finished yet) i wanted to try it out on my significantly faster desktop.

First of i couldn't compile the code since the GCC version didn't have the proper dll (Something with exceptions and something called Dwarf2 i believe), so i fixed this error by just uninstalling C::B and MinGW, and then installing the newest version of MinGW seperately from C::B. I then set up the new project exactly as above, it compiles like a dream, but when i run it i just get an empty console window. No renderwindow, no nothing. If i set a breakpoint just at the start of main and run it through the debugger, GDB just crashes before it even reaches main.

This machine also runs Windows 7, both MinGW and C::B is the exact same version as on my laptop. I even tried copying the executable from my laptop to the desktop, and it still just gives me an empty console window, although the exact same executable works like a dream on the laptop, with a pretty much identical setup.

What is going on here? I can post the code if need be, it's not that long, but somehow i don't think this has anything to do with the code itself.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Works fine on one machine, crashes on the other?
« Reply #1 on: October 28, 2011, 07:43:04 pm »
Quote
What is going on here?

ATI graphics card I guess. That's a known bug with 1.6.
Linking SFML statically should solve the problem.
Laurent Gomila - SFML developer

Neo1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Works fine on one machine, crashes on the other?
« Reply #2 on: October 28, 2011, 10:05:35 pm »
Quote from: "Laurent"
Quote
What is going on here?

ATI graphics card I guess. That's a known bug with 1.6.
Linking SFML statically should solve the problem.


Correct, you're somewhat of a clairvoyant! The laptop has a tiny GMA somethingsomething, and the desktop is sporting an ATi card.

So i changed my linker options to the following:

-lsfml-graphics-s-d
-lsfml-window-s-d
-lsfml-system-s-d

I removed the SFML_DYNAMIC and i deleted the DLLs in my project folder. What else will i need to do to link statically? The program is now complaining about missing DLLs when i run it.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Works fine on one machine, crashes on the other?
« Reply #3 on: October 28, 2011, 10:10:13 pm »
Quote
The program is now complaining about missing DLLs when i run it.

Which one?
Laurent Gomila - SFML developer

Neo1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Works fine on one machine, crashes on the other?
« Reply #4 on: October 28, 2011, 10:15:35 pm »
Quote from: "Laurent"
Quote
The program is now complaining about missing DLLs when i run it.

Which one?


sfml-graphics-d.dll

keyforge

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Works fine on one machine, crashes on the other?
« Reply #5 on: October 28, 2011, 11:05:14 pm »
So you are using SFML 1.6 correct? If you're using SFML 2.0 you need to define SFML_STATIC.

If above isn't the problem, does the release version work?
Need a place to upload your code, files or screenshots? Use SFML Uploads!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Works fine on one machine, crashes on the other?
« Reply #6 on: October 29, 2011, 10:55:42 am »
sfml-graphics-d.dll can only be required if you have -lsfml-graphics or -lsfml-graphics-d in your linker options.
Laurent Gomila - SFML developer

Neo1

  • Newbie
  • *
  • Posts: 4
    • View Profile
Works fine on one machine, crashes on the other?
« Reply #7 on: October 29, 2011, 05:52:14 pm »
Quote from: "Laurent"
sfml-graphics-d.dll can only be required if you have -lsfml-graphics or -lsfml-graphics-d in your linker options.


Hmm, i changed the linker options to use the static libraries, and i got the DLL-missing error. After restarting C::B the linker options had reverted to the dynamic libraries. So i changed it again and it seems to stick now. However the code won't compile with the static libraries, i get a long list of undefined references similar to this one:

undefined reference to '_imp____ZN2sf8DrawableD2EV'

Is there something else i need to do to make it work with the static libraries?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Works fine on one machine, crashes on the other?
« Reply #8 on: October 29, 2011, 06:02:54 pm »
SFML 1.6: don't define SFML_DYNAMIC
SFML 2.0: define SFML_STATIC
Laurent Gomila - SFML developer

 

anything