0

So well, I'm fighting with WINE and MinGW32 right now. So I have a file, sortem.cpp which is compiled with a Makefile and linked and all from that Makefile.

sortem.cpp

#include <windows.h>
#include <iostream>
#include <string>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>

int main ()
{
    sf::RenderWindow window;
    window.create(sf::VideoMode(720,480),"Sort 'em!");
    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
            {
                window.clear();
                switch (event.type)
                {
                    case sf::Event::Closed:
                        window.close();
                }
                window.display();
            }
    }
    return 0;
}

Makefile

LD = ../bin
LIBS= $(LD)/sfml-window-2.dll $(LD)/sfml-system-2.dll $(LD)/sfml-graphics-2.dll $(LD)/sfml-network-2.dll $(LD)/sfml-audio-2.dll
OBJECTS= sortem.o
CXX= i586-mingw32msvc-g++
all: sortem.exe

sortem.exe: $(OBJECTS)
     $(CXX) -o ../bin/sortem.exe $(OBJECTS) $(LIBS)

%.o: %.cpp 
    $(CXX) -c $<

clean:
     rm *.o 

So the program compiles perfectly, but when running sortem.exe with WINE, it says the program must exit. I click "Show details" and this pops up. Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0046f4c6).and a lot of hexdumps. I really don't know what I'm doing wrong, maybe the SFML libraries aren't up to date? But that'd give me a compile error, not a runtime error... Thanks a lot for the help, guys.

ChemiCalChems
  • 477
  • 1
  • 4
  • 14

1 Answers1

0

At last, I just figured out the best solution was to install MinGW on Wine and run the g++.exe from Wine. It works like a charm really and never gives a single problem once the setup is finished.

ChemiCalChems
  • 477
  • 1
  • 4
  • 14