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

Pages: [1]
1
General / Re: Android example fails to compile
« on: September 30, 2017, 03:17:37 pm »
Okay, thanks a lot!  ;D

2
General / Android example fails to compile
« on: September 29, 2017, 04:42:54 pm »
I followed the tutorial on the Github wiki and tried to compile SFML for Android. I got til the make command, but got the error '#include <ostream> No such file or directory'. The tutorial told me to include '-DANDROID_STL=stlport_shared' in that case and after doing that it compiled just fine. However, the example project fails to compile after 'ndk-build' with the following error:
Code: [Select]
jni/main.cpp:79: error: undefined reference to 'sf::String::String(char const*, std::__ndk1::locale const&)'
jni/main.cpp:82: error: undefined reference to 'sf::Texture::loadFromFile(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&, sf::Rect<int> const&)'
jni/main.cpp:90: error: undefined reference to 'sf::Music::openFromFile(std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char> > const&)'
D:/Android/android-ndk/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::basic_streambuf<char, std::char_traits<char> >::~basic_streambuf(): error: undefined reference to 'std::locale::~locale()'
D:/Android/android-ndk/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::basic_streambuf<char, std::char_traits<char> >::~basic_streambuf(): error: undefined reference to 'std::locale::~locale()'
D:/Android/android-ndk/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::priv::_Rb_tree<int, std::less<int>, std::pair<int const, sf::Vector2<int> >, std::priv::_Select1st<std::pair<int const, sf::Vector2<int> > >, std::priv::_MapTraitsT<std::pair<int const, sf::Vector2<int> > >, std::allocator<std::pair<int const, sf::Vector2<int> > > >::_M_erase(std::priv::_Rb_tree_node_base*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
D:/Android/android-ndk/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::priv::_Rb_tree<int, std::less<int>, std::pair<int const, sf::Vector2<int> >, std::priv::_Select1st<std::pair<int const, sf::Vector2<int> > >, std::priv::_MapTraitsT<std::pair<int const, sf::Vector2<int> > >, std::allocator<std::pair<int const, sf::Vector2<int> > > >::_M_erase(std::priv::_Rb_tree_node_base*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
D:/Android/android-ndk/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::priv::_Rb_tree<int, std::less<int>, std::pair<int const, sf::Vector2<int> >, std::priv::_Select1st<std::pair<int const, sf::Vector2<int> > >, std::priv::_MapTraitsT<std::pair<int const, sf::Vector2<int> > >, std::allocator<std::pair<int const, sf::Vector2<int> > > >::_M_erase(std::priv::_Rb_tree_node_base*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
D:/Android/android-ndk/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function std::priv::_Rb_tree<int, std::less<int>, std::pair<int const, sf::Vector2<int> >, std::priv::_Select1st<std::pair<int const, sf::Vector2<int> > >, std::priv::_MapTraitsT<std::pair<int const, sf::Vector2<int> > >, std::allocator<std::pair<int const, sf::Vector2<int> > > >::_M_erase(std::priv::_Rb_tree_node_base*): error: undefined reference to 'std::__node_alloc::_M_deallocate(void*, unsigned int)'
D:/Android/android-ndk/build//../sources/sfml/lib/armeabi-v7a/libsfml-main.a(MainAndroid.cpp.o):MainAndroid.cpp:function onDestroy(ANativeActivity*): error: undefined reference to 'std::locale::~locale()'
collect2.exe: error: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libsfml-example.so] Error 1
Tried on both Windows (Using minGW) and macOS, but both fail with the same error. Am I missing something?

3
Network / Re: Compile error on Linux
« on: September 29, 2016, 10:26:57 pm »
Yes, Status was already defined in some X11 header. I fixed it with #undef before the SFML stuff. None and BadRequest was also already defined. After undefining those as well, it compiles and runs just fine!

Thanks for the help, but this might be something that needs to be changed.
It seems to run fine though.

4
Network / Compile error on Linux
« on: September 28, 2016, 09:14:49 pm »
Hello!
Trying to compile my code on Linux, but it won't work. Same code used on Windows and Mac and both works just fine.
Here are the errors I'm getting:

/usr/include/SFML/Network/Socket.hpp:53:10: error: expected identifier before ‘int’
     enum Status
          ^

/usr/include/SFML/Network/Socket.hpp:54:5: error: expected unqualified-id before ‘{’ token
     {
     ^

/usr/include/SFML/Network/Ftp.hpp:74:14: error: expected identifier before ‘int’
         enum Status
              ^

/usr/include/SFML/Network/Ftp.hpp:75:9: error: expected unqualified-id before ‘{’ token
         {
         ^

/usr/include/SFML/Network/Ftp.hpp:146:41: error: ‘InvalidResponse’ was not declared in this scope
         explicit Response(Status code = InvalidResponse, const std::string& message = "");
                                         ^~~~~~~~~~~~~~~
/usr/include/SFML/Network/IpAddress.hpp:184:28: error: expected unqualified-id before numeric constant
     static const IpAddress None;      ///< Value representing an empty/invalid address
                            ^

/usr/include/SFML/Network/Http.hpp:201:14: error: expected identifier before ‘int’
         enum Status
              ^

/usr/include/SFML/Network/Http.hpp:202:9: error: expected unqualified-id before ‘{’ token
         {
         ^

Thanks! :)

5
System / Re: InputStream issue
« on: July 28, 2016, 06:34:44 pm »
Please, don't take this the wrong way, but you clearly need to review your C++ bases... If you don't know what an implementation is from a definition, you will not go anywhere. :-/

Take the time to learn how C++ really works before starting using libraries, especially if they require you to have advanced knowledge.

I'm fairly new to C++ so, but I can't find any sort of information of where I can read more about this...

6
System / Re: InputStream issue
« on: July 26, 2016, 03:08:57 am »
And where's the implementation of the function?
That code is in the main cpp file outside of main
Can you show this implementation?

The code I have is the code I posted before

7
System / Re: InputStream issue
« on: July 26, 2016, 02:49:29 am »
And where's the implementation of the function?

What do you mean? Where I have that code? That code is in the main cpp file outside of main and call it inside of the main

8
System / Re: InputStream issue
« on: July 25, 2016, 10:41:06 pm »
What's your code?

Just straight from the example pretty much

class ZipStream : public sf::InputStream
{
    public:
        ZipStream(string archive);
        bool openFile(string archive);
        bool open(string filename);
        sf::Int64 read(void* data, sf::Int64 size);
        sf::Int64 seek(sf::Int64 position);
        sf::Int64 tell();
        sf::Int64 getSize();
};

And then I call it from my main cpp file with

ZipStream stream("data.zip");

9
System / Re: InputStream issue
« on: July 25, 2016, 07:23:26 pm »
The ZipStream example is incomplete; so my guess is that you did implement it or you forgot to link your implementation file with the rest of your code.

I also tried following the tutorial on user data streams, but it doesn't explain much more. I included the file where the class is, do I need to do more?

10
System / InputStream issue
« on: July 25, 2016, 06:35:29 pm »
Hello!

So, I want to load files from a zip file. I tried following the example from http://www.sfml-dev.org/documentation/2.3.2/classsf_1_1InputStream.php, but I ran into multiple issues. Firstly, Int64 isn't a thing, but that was probably because it was missing sf::Int64, but when compiling, I get this error now instead when attempting to call "ZipStream stream("data.zip")"
undefined reference to `ZipStream::ZipStream(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
and
undefined reference to `vtable for ZipStream'
for the class

Thanks!

11
General / Re: Can't load files from Visual Studio
« on: June 16, 2016, 06:02:48 pm »
Yup, that was it! Thanks a lot :)

12
General / Can't load files from Visual Studio
« on: June 16, 2016, 05:34:36 pm »
Hello!

So just started using SFML, but when I try to load a file and debugging from Visual Studio 2015 it just gives an error that it "couldn't open stream". When launching the exe file directly, it can load the asset and use it just fine. No clue what's going on.

Thanks!

Pages: [1]
anything