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

Author Topic: Dll fails to load when contains SFML opengl functions  (Read 1351 times)

0 Members and 2 Guests are viewing this topic.

Noah Klabo

  • Guest
Dll fails to load when contains SFML opengl functions
« on: July 23, 2014, 08:34:30 am »
Im working on an engine that loads a dll that contains all the GUI code, its works if I use
In DLL
 SFWindow = new sf::Window(sf::VideoMode(800, 600), Title);  
but will not load if I use
SFWindow = new sf::RenderWindow(sf::VideoMode(800, 600), Title);

the dll is compiled using
g++ -std=c++0x -shared -o Gui.x86.dll Gui/Gui_Interface.cpp  Gui/Gui_Gui.cpp Gui/Gui_Window.cpp  -Wl,-rpath,'$ORIGIN'  Common.x86.dll  
-lsfml-system -lsfml-graphics -lsfml-window -lOpengl32 -lGlu32


and loaded in main executable
                SharedLibrary GuiLib("Gui.x86","Init");
                InitGui = (GuiInterface (*)()) GuiLib.Function;
                Interface.Gui = InitGui();

I have no Idea why it is doing this thanks

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Dll fails to load when contains SFML opengl functions
« Reply #1 on: July 24, 2014, 01:48:01 am »
sf::Window needs the Window module; sf::RenderWindow needs the Graphics modules, which needs the window module so it must be the graphics module that is causing you a problem.
I would try to link them in the correct order. I'm not sure which way around it is in your compiler but it will probably be either:
-lGlu32 -lOpengl32 -lsfml-graphics -lsfml-window -lsfml-system
or
-lsfml-system -lsfml-window -lsfml-graphics -lOpengl32 -lGlu32
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Dll fails to load when contains SFML opengl functions
« Reply #2 on: July 25, 2014, 11:04:37 pm »
What does "will not load" mean? Is there an error?

On g++, dependent libraries have to be listed first, i.e. sfml-graphics before sfml-window before sfml-system.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: