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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Amablue

Pages: [1]
1
Looks like there used to be an SFGUI forum but not anymore? If this is the wrong place to post this let me know and I'll post it elsewhere.

I'm a bit stuck with an issue trying to build a simple test program using SFML and SFGUI. This is on Windows, and I've used cmake to generate Visual Studio 2017 projects.

First I cloned SFML SFGUI from github and generated the solution files. I ran Visual Studio in administrator mode and build the INSTALL project with both release and debug targets so that they would all be built and dropped in C:\Program Files (x86)\SFML\ and C:\Program Files (x86)\SFGUI\ respectively. Everything built and installed fine right out of the box. I also added those two directories to my PATH environment variable. I can build and run the sample projects that come with SFGUI that show up in the solution file.

So now I go and create my own project, and things start to fall apart. Importing SFML itself works fine. I have a simple program that pops open a window and it works fine. When I add in find_package(SFGUI REQUIRED) CMake fails when the project tries to update. I get the following error:

2>CMake Error at C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake:78 (message):
2>  The imported target "SFGUI::SFGUI" references the file
2>
2>     "C:/Program Files (x86)/lib/SFGUI-d.lib"
2>
2>  but this file does not exist.  Possible reasons include:
2>
2>  * The file was deleted, renamed, or moved to another location.
2>
2>  * An install or uninstall procedure did not complete successfully.
2>
2>  * The installation package was faulty and contained
2>
2>     "C:/Program Files (x86)/SFGUI/cmake/SFGUITargets.cmake"
2>
2>  but not all the files it references.


Notice in the error, the file is "C:/Program Files (x86)/lib/SFGUI-d.lib" and not "C:/Program Files (x86)/SFGUI/lib/SFGUI-d.lib"

Looking at the SFGUI cmake files, it looks like the variable _IMPORT_PREFIX is being set to C:/Program Files (x86)/, when I think it should be setting set to C:/Program Files (x86)/SFGUI. I think that variable is getting set by the call to set_target_properties in SFGUITargets[-debug].cmake. I'm not sure if this is the core issue, or if it is, why it's getting set wrong. Any ideas what I did wrong?

Here is the entirety of my CMakeLists.txt in case it helps:

cmake_minimum_required(VERSION 3.1)

set(PROJECT_NAME TestProj)

project(${PROJECT_NAME})

set(SOURCES src/main.cpp)

find_package(OpenGL REQUIRED)
find_package(SFML 2.5 REQUIRED COMPONENTS graphics window audio network system)
find_package(SFGUI REQUIRED)

add_executable(${PROJECT_NAME} ${SOURCES})
set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER ${PROJECT_NAME})
target_link_libraries(${PROJECT_NAME}
                      sfml-graphics
                      sfml-window
                      sfml-audio
                      sfml-network
                      sfml-system)

2
General / error: format string argument not a string type
« on: September 28, 2012, 06:58:07 am »
I'm trying to compile my SFML project under OSX Snow Leopard. I get the following error when trying to build SFML:

Code: [Select]
[ 16%] Built target sfml-system
[ 17%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Context.cpp.o
[ 18%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/GlContext.cpp.o
[ 19%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/GlResource.cpp.o
[ 20%] Building CXX object src/SFML/Window/CMakeFiles/sfml-window.dir/Joystick.cpp.o
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:0,
                 from /System/Library/Frameworks/IOKit.framework/Headers/hid/IOHIDDevice.h:27,
                 from /Users/alexames/game/dev/src/extern/SFML/src/SFML/Window/OSX/JoystickImpl.hpp:33,
                 from /Users/alexames/game/dev/src/extern/SFML/src/SFML/Window/JoystickImpl.hpp:85,
                 from /Users/alexames/game/dev/src/extern/SFML/src/SFML/Window/JoystickManager.hpp:32,
                 from /Users/alexames/game/dev/src/extern/SFML/src/SFML/Window/Joystick.cpp:29:
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBundle.h:147:120: error: format string argument not a string type
make[2]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/Joystick.cpp.o] Error 1
make[1]: *** [src/SFML/Window/CMakeFiles/sfml-window.dir/all] Error 2
make: *** [all] Error 2

SFML is on revision 57f81d40518def673690f26c439bfd3ff1329a93

3
General / Problems compiling
« on: June 14, 2011, 10:13:56 pm »
d'oh, I'm a moron. You're right, doing a make clean and rebuilding SFML solves the problem.

Thanks.

4
General / Problems compiling
« on: June 14, 2011, 01:10:23 am »
I get the error when attempting to rebuild SFML.

5
General / Problems compiling
« on: June 13, 2011, 06:18:56 pm »
I take it no one else has had this problem after upgrading then? I've looked around for the past few days and haven't found any solutions, or even anyone else with this problem. I don't know what I did differently that caused this to happen  :(

6
General discussions / When official SFML 2.0 is going to be realised?
« on: June 08, 2011, 09:16:39 am »
You can go ahead and start using it today if you wanted. Right now it's perfectly usable, even if it's not "officially" released or whatever.

7
General / Problems compiling
« on: June 08, 2011, 08:53:01 am »
This is probably my fault, but I don't know how I screwed this up, so any help is appreciated.

I've been doing development of my game on an Ubuntu computer, and I just decided to do an upgrade the other day. During the upgrade, a bunch of packages that were not in use were uninstalled, and I think that's where I messed up. Today, when I go to compile my game, I get this error:

Code: [Select]
make[3]: *** No rule to make target `/usr/lib/libX11.so', needed by `lib/libsfml-window.so.2.0.0'.  Stop.

My first thought was to open synaptic and see if anything jumped out at me, but it's telling me that libx11 and libx11-dev are indeed installed, and that was my only decent guess as to what package I might be missing.

Does anyone know what piece of this puzzle I'm missing?

8
General / Trouble compiling sample files
« on: August 31, 2010, 06:33:18 am »
I installed SFML from scratch today. I downloaded the 1.6 source, ran make install, and tried compiling one of my old projects, and I couldn't get it to link properly. So I tried running a simpler project: one of the samples in the tutorials. I'm trying to compile this one specifically, but I get these errors:
 
g++ -o atest test.cpp -lsfml-graphics -lsfml-window -lsfml-system /tmp/ccaa86fR.o: In function `main':
test.cpp:(.text+0x1d2): undefined reference to `gluPerspective'
collect2: ld returned 1 exit status
make: *** [test] Error 1

Trying an even simpler project, the one in the initial tutorial, I don't run into problems compiling. However, when I try to run it, I get this error:

./atest: error while loading shared libraries: libsfml-graphics.so.1.6: cannot open shared object file: No such file or directory

I checked, and the files did install to /usr/local/lib/ which is where they're supposed to go as far as I know. [/url]

9
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: May 19, 2010, 05:38:06 pm »
Quote from: "Laurent"
Because you have OpenGL code in your application ;)


Nope :)

The only openGL code I had was the call to glClearColor and glClear, both of which have been removed. It complains about gl calls in sfml

http://pastebin.com/Ub0BQU4c

Quote from: "Laurent"
This one is definitely not necessary. I guess it links itself to the actual library that you need, so it works. What errors do you get without glfw?

If I include GL, then I just get these:

http://pastebin.com/24fDLs6M

to compile this, I'm just just the sample program from the tutorial:

Code: [Select]
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main()
{
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
    while (App.IsOpened())
    {
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }
        App.Clear();
        App.Display();
    }
}

10
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: May 19, 2010, 07:39:34 am »
I now have to link against GL, and I needed to install and link against glfw in my project. My makefile went from what you see in on of my previous posts to the following:

Code: [Select]
game : *.cpp *.h
g++ -o game \
main.cpp Border.cpp Game.cpp Widget.cpp \
-I/usr/local/include/luajit-2.0 -lluajit-5.1 \
-L/home/alex/src/cpp/sfml/lib/ -isystem/home/alex/src/cpp/sfml/include/ \
-lGL -lglfw \
-lsfml-graphics-s -lsfml-window-s -lsfml-system-s -Wall -Weffc++ -Wextra \
-Wshadow -Wformat-nonliteral -Wformat-security -Winit-self -Wundef


(I have -isystem instead of -I because otherwise I get a bunch of compiler warnings about things like destructors in sfml not being marked virtual and stuff)

11
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: May 18, 2010, 06:44:50 am »
So I removed the packages I was using from synaptic, and instead downloaded the trunk and built it from there, and now it seems to work. In order to get it to compile though I had to get a few extra libs that I didn't seem to have before. If I didn't have those libs, I don't see how the 1.5 packages could have run properly either (and they didn't include them as dependencies) so I wonder if that's the problem.

12
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: May 17, 2010, 05:21:32 pm »
While I was reimplementing the Clear method I noticed GLCheck was a macro that only does anything if SFML_DEBUG is defined. I omitted it in the code snipped I posted below though. When nothing I did crashed, I though "maybe the code the GLCheck calls is what's crashing" but GLCheck only did anything if SFML_DEBUG was defined, so I just threw in a quick check to see if it was:

Code: [Select]

#ifdef SFML_DEBUG
    std::cout << "Test!" << std::endl;
#endif


When I started running my program I was spammed with "Test!" After seeing that it was actually defined I tried copying and pasting the full contents of the GLCheck macro and wrapping the glClear and glClearColor calls in it, but that still didn't crash it.

Edit: Adding -DNDEBUG didn't have any effect. I'm going to try compiling the source and using those libraries when I get home from work today and see if that gives me better luck than the packages from synaptic. I'll let you know what happens.

13
Graphics / sf::RenderWindow::Clear() causing Unhandled exception
« on: May 17, 2010, 09:58:07 am »
I'm running with the 1.5 packages installed from synaptic on ubuntu and I'm getting the crash too. I'm not linking against the debug libraries, just the regular ol static libraries.

When I call window.Clear() I get a seg fault. When I call glClearColor(...) followed by glClear(GL_COLOR_BUFFER_BIT) it runs just fine. Until someone figures out why window.Clear() is dying on me I'll jsut use glClear as a workaround.

 :?

Edit:

I played around a little bit and have no idea what the problem is. I looked at the source and I can't see anything that could be going wrong. I tried remaking the exact code that Clear calls, but when I do that it runs fine.

Code: [Select]
bool Activate(sf::RenderWindow& App, bool Active)
{
    if (Active)
        return App.SetActive();
    else
        return false;
}

void Clear(sf::RenderWindow& App, const sf::Color& FillColor)
{
    if (Activate(App, true))
    {
        glClearColor(FillColor.r / 255.f, FillColor.g / 255.f, FillColor.b / 255.f, FillColor.a / 255.f);
        glClear(GL_COLOR_BUFFER_BIT);
        Activate(App, false);
    }
}

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        //App.Clear(sf::Color(0, 0, 0));
       
        // Uncommenting the line above crashes, yet the one below works fine.
        Clear(App, sf::Color(0, 0, 0));

        // Display window contents on screen
        App.Display();
    }


Baffling. I did notice that SFML_DEBUG was defined, even though I'm not linking against the debug libraries as far as I know.

Code: [Select]

game : *.cpp *.h
g++ -o game \
main.cpp Border.cpp Game.cpp Widget.cpp \
-I/usr/local/include/luajit-2.0 -lluajit-5.1 \
-lsfml-graphics -lsfml-window -lsfml-system -Wall -Weffc++ -Wextra \
-Wshadow -Wformat-nonliteral -Wformat-security -Winit-self -Wundef

Pages: [1]