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 - Xilen

Pages: [1]
1
General / Re: Thor undefined reference to sf::Image destructor.
« on: September 01, 2014, 12:06:50 pm »
Alright, I hadn't even looked into that. Turns out, the I had the repository version of sfml installed which is apparently extremely dated. I removed those and rebuilt from source and everything works fine.

2
General / [SOLVED] Thor undefined reference to sf::Image destructor.
« on: September 01, 2014, 03:28:39 am »
I'm having trouble getting thor to work on Ubuntu 14.04.
I compiled both SFML and Thor from source using the github repositories.

Example code:
#include <iostream>
#include <stdio.h>
#include <SFML/Graphics.hpp>
#include <Thor/Input.hpp>
using namespace std;
int main()
{
        sf::RenderWindow window(sf::VideoMode(640,480,32), "RPG Thing(?)",
                                                    sf::Style::Titlebar | sf::Style::Close);
        window.setVerticalSyncEnabled(false);
        window.setFramerateLimit(60);
        thor::ActionMap<string> map;
        map["quit"] = thor::Action(sf::Event::Closed);
        while (window.isOpen())
        {
                map.update(window);
                if (map.isActive("quit"))
                        window.close();
                window.clear();
                window.display();
               
        }
        return 0;
}

Here's the error:
Code: [Select]
//usr/local/lib/libthor.so: undefined reference to `sf::Image::~Image()'
//usr/local/lib/libthor.so: undefined reference to `sf::operator/(sf::Time, sf::Time)'
Compilation failed.
collect2: error: ld returned 1 exit status

Here's my compile command:
Code: [Select]
g++ -Wall -std=c++0x -c *.cpp -lthor -lsfml-graphics -lsfml-window -lsfml-systemAnd finally here's my build command:
Code: [Select]
g++ -Wall -std=c++0x -o main *.o -lthor -lsfml-graphics -lsfml-window -lsfml-system
I'm not entirely sure what's wrong. Could it possible be a version mismatch with Thor and SFML?

3
General / Re: Undefined references with MinGW 4.9.0
« on: July 13, 2014, 02:28:47 am »
IT WORKS! Thanks for all the help! I recompiled from source and it worked.

4
General / Re: Undefined references with MinGW 4.9.0
« on: July 13, 2014, 01:58:52 am »
Thanks for that! But the thing is, now when I launch the app I get this:
The program can't start because libgcc_s_sjlj-1.dll is missing from your computer.

Edit: I've tried -static and -static-libgcc but neither worked, same error.

5
General / Undefined references with MinGW 4.9.0
« on: July 13, 2014, 01:05:31 am »
I really dislike posting here about all my problems but I've been having this one all day.
I just get a bunch of undefined references to everything in SFML.
I'm using the latest nightly build of SFML and MinGW.

Command line:
g++ main.cpp -DSFML_STATIC -IC:\SFML\include -LC:\SFML\lib

Minimal code
#include <iostream>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(640,480), "Test", sf::Style::Titlebar);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }
    }

}

No idea what's wrong, help?

6
I was able to get it to compile (there we a couple warnings about macros) but it asks for libgcc_s_sjlj-1.dll which doesn't exist with MinGW32 4.8.1.

7
Ok, I got it linked but it throws a new error (another undefined reference but this time it's all kinds of weird)
C:\Users\Xilen\AppData\Local\Temp\ccPIt8f4.o:main.cpp:(.text+0xa0): undefined reference to `_imp___ZN4thor6ActionC1EN2sf5Event9EventTypeE'
C:\Users\Xilen\AppData\Local\Temp\ccPIt8f4.o:main.cpp:(.text$_ZN4thor9ActionMap
ISsEC1Ev[__ZN4thor9ActionMapISsEC1Ev]+0x27): undefined reference to `_imp___ZN4t
hor6detail11EventBufferC1Ev'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\Xilen\AppData\Local\Temp\ccPIt8f4.o: bad reloc address 0x27 in section `.text$_Z
N4thor9ActionMapISsEC1Ev[__ZN4thor9ActionMapISsEC1Ev]'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link
 failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
My new command line
g++ ../main.cpp -o thor.exe -static -std=c++11 -lsfml-graphics -lsfml-window -lsfml-system -lthor-s
I have to use "-lthor-s" because "ld.exe cannot find -lthor".
And "-static" is so that I don't get the "libgcc_s_sjlj-1.dll is missing from this computer" error.

I tried getting MinGW 4.9 but that just breaks all my includes.

8
If you grabbed my latest Nightly Build of Thor, you should probably also grab the latest SFML Nightly Build, then usually get always compiled at the same time and thus guarantee to work.

Where did you get your MinGW version from? Because currently I've only TDM builds with the version 4.8.1. Personally I'd advice you to grab the MinGW Builds compiler which is at version 4.9.0 (see "Download Compiler").

It's also helpful if you provide the full build command.

Ok, I downloaded the nightly builds of both but still no luck. I then downloaded MinGW 4.9 and then this happened
../main.cpp:1:20: fatal error: iostream: No such file or directory
 #include <iostream>
I'm going to completely reinstall MinGW and hopefully that will fix it.

As for the linking, I have no idea what you mean, I installed the library the same way I do everything else; put all the files in the mingw folder.

Here's my command line
g++ ../main.cpp -o output.exe -std=c++11 -DSFML_STATIC -lsfml-graphics -lsfml-window -lsfml-system

9
Hi there,
(I'm not sure if this topic belongs here or if I should contact the Thor dev directly)
I've built SFML using cmake and MinGW 4.8.1 and I'm using the latest nightly build of Thor but it crashes. I've read the documentation on it and I've searched the forums but no one seems to have the same problem as I do.

Here's the code
#include <iostream>
#include "SFML/Graphics.hpp"
#include "SFML/System.hpp"
#include "Thor/Input.hpp"

int main()
{
        thor::Action c(sf::Event::Closed);
        thor::ActionMap<std::string> map;
        map["exit"] = c;

        sf::RenderWindow window(sf::VideoMode(640,480,32), "Hello", sf::Style::Close | sf::Style::Titlebar);

        while (window.isOpen())
        {
                map.update(window);
                if (map.isActive("exit"))
                        window.close();

                window.display();
        }

}
 

And here's the entire error:
C:\Users\Xilen\AppData\Local\Temp\ccVwUy6F.o:main.cpp:(.text+0xe4): undefined reference to `thor::Action::Action(sf::Event::EventType)'
C:\Users\Xilen\AppData\Local\Temp\ccVwUy6F.o:main.cpp:(.text$_ZN4thor9ActionMap
ISsEC1Ev[__ZN4thor9ActionMapISsEC1Ev]+0x63): undefined reference to `thor::detail::EventBuffer::EventBuffer()'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: C:\Users\Xilen\AppData\Local\Temp\ccVwUy6F.o: bad reloc address 0x63 in section `.text$_Z
N4thor9ActionMapISsEC1Ev[__ZN4thor9ActionMapISsEC1Ev]'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link
 failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
 

Is there a MinGW command line arg that I have to use to get it working?

10
General / Re: Crash when using Font
« on: July 06, 2014, 11:39:42 am »
Thanks a bunch for the help, I finally gave in and downloaded the nightly builds of SFML and it works fine. I'm not sure exactly why or how but the window.clear() line was crashing the program.

11
General / Re: Crash when using Font
« on: July 06, 2014, 11:15:35 am »
I'm actually completely wrong about this. It gets to the clearing of the screen and THEN it crashes.

12
General / Re: Crash when using Font
« on: July 06, 2014, 10:29:12 am »
There are no errors when compiling only when I actually launch the exe that's created.
I'm using MinGW 4.8.
SFML Version 2.1
I compiled SFML myself using cmake and MinGW.

13
General / Re: Crash when using Font
« on: July 06, 2014, 08:54:16 am »
Just tried that; same error.
Side node: Why avoid "using namespace"? Is there a specific reason?

14
General / Crash when using Font
« on: July 06, 2014, 08:26:24 am »
I created a font the same way as the wiki said and it just crashes with "whatever.exe Has Stopped Working". Is this a bug with SFML or am I just doing something wrong?

#include <iostream>
#include "SFML/Graphics.hpp"

using namespace std;

sf::Font font;

int main()
{

        sf::RenderWindow window(sf::VideoMode(640, 480, 32), "Test Window");


        if (!font.loadFromFile("AriBlk.ttf"))
                cout << "Error Loading Font" << endl;


        sf::Text text("Hello, World", font, 20);
        text.setColor(sf::Color(100,100,100));


        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                        window.close();
                }
                window.clear();
                window.draw(text);
                window.display();
        }


        return 0;
}

 
And yes, it IS Font and not Text and the font file is in the same directory as the exe. I'm not using any IDE, just a text editor (Sublime Text 3 to be specific).

Pages: [1]