Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linkage error for sf::InputStream with MinGW #100

Closed
Groogy opened this issue Sep 20, 2011 · 1 comment
Closed

Linkage error for sf::InputStream with MinGW #100

Groogy opened this issue Sep 20, 2011 · 1 comment
Assignees
Milestone

Comments

@Groogy
Copy link

Groogy commented Sep 20, 2011

SFML gives me a linkage error on sf::InputStream when trying to link application against shared library that has been compiled using MinGW. The error output is:

obj/system/InputStream.o: In function `~InputStream':
/rbSFML/includes/SFML/System/InputStream.hpp:48: undefined reference to `_imp___ZTVN2sf11InputStreamE'
/rbSFML/includes/SFML/System/InputStream.hpp:48: undefined reference to `_imp___ZTVN2sf11InputStreamE'
/rbSFML/includes/SFML/System/InputStream.hpp:48: undefined reference to `_imp___ZTVN2sf11InputStreamE'
/rbSFML/includes/SFML/System/InputStream.hpp:48: undefined reference to `_imp___ZTVN2sf11InputStreamE'
/rbSFML/includes/SFML/System/InputStream.hpp:48: undefined reference to `_imp___ZTVN2sf11InputStreamE'
collect2: ld returned 1 exit status

Minimal example that doesn't use rbSFML.

#include <SFML/System.hpp>

class MyInputStream : public sf::InputStream
{
public:
    MyInputStream() {}
    ~MyInputStream() {}

protected:
    virtual sf::Int64 Read( char *aDataBuffer, sf::Int64 aSize )
    {
        return 0;
    }

    virtual sf::Int64 Seek( sf::Int64 aPosition )
    {
        return 0;
    }

    virtual sf::Int64 Tell()
    {
        return 0;
    }

    virtual sf::Int64 GetSize()
    {
        return 0;
    }
};

int main()
{
    sf::Clock clock;
    MyInputStream stream;
    return 0;
}

This generates these errors in codeblocks:

obj\Debug\main.o||In function `~InputStream':|
C:\Program Files\SFML\include\SFML\System\InputStream.hpp|48|undefined reference to `_imp___ZTVN2sf11InputStreamE'|
C:\Program Files\SFML\include\SFML\System\InputStream.hpp|48|undefined reference to `_imp___ZTVN2sf11InputStreamE'|
obj\Debug\main.o||In function `InputStream':|
C:\Program Files\SFML\include\SFML\System\InputStream.hpp|41|undefined reference to `_imp___ZTVN2sf11InputStreamE'|
||=== Build finished: 3 errors, 0 warnings ===|

Everything else compiles, links and works just fine.

@LaurentGomila
Copy link
Member

Thanks. It will be fixed this evening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants