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.


Topics - hatfarm

Pages: [1]
1
General / Problem Linking when using Threads
« on: August 30, 2013, 02:28:22 am »
Hello all, I wasn't sure if I should put this here or in the System forum, but since this isn't a problem with the Thread class so much as linking, I decided it should go here.  The problem is that I'm trying to load resources from a separate thread, I've read a lot of the posts here and I think I have a working implementation, but I get a linking error when I try to build.  Here's the error:

ballswindow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Thread::~Thread(void)" (__imp_??1Thread@sf@@QAE@XZ) referenced in function "public: __thiscall LoadState::~LoadState(void)" (??1LoadState@@QAE@XZ)
3>loadstate.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Thread::~Thread(void)" (__imp_??1Thread@sf@@QAE@XZ)
3>loadstate.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall sf::Thread::launch(void)" (__imp_?launch@Thread@sf@@QAEXXZ) referenced in function "public: virtual void __thiscall LoadState::init(void)" (?init@LoadState@@UAEXXZ)
3>loadstate.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Context::~Context(void)" (__imp_??1Context@sf@@QAE@XZ) referenced in function "private: void __thiscall LoadState::loadFunc(void)" (?loadFunc@LoadState@@AAEXXZ)
3>loadstate.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall sf::Context::Context(void)" (__imp_??0Context@sf@@QAE@XZ) referenced in function "private: void __thiscall LoadState::loadFunc(void)" (?loadFunc@LoadState@@AAEXXZ)
3>C:\Users\hatfarm\GitHome\balls-to-the-walls\bin\Debug\Balls to the Walls.exe : fatal error LNK1120: 4 unresolved externals
3>

I'm building this in VS 2010 and I'm using CMake to put together my solution.  It worked fine until I decided to add a separate thread, so it's got to be something with that.  I've been using sf::Clock for a while now, so it's not a problem with the System library.  Anyone have any ideas?  I'm building against SFML 2.1.  If you need code, let me know and I'll get it here.  Thanks!

EDIT:  Also, here's my cmake for SFML:

IF(WIN32)
        set(SFML_STATIC_LIBRARIES TRUE)
        find_package(SFML 2.1 COMPONENTS main graphics window system REQUIRED)
        #set(GLEW_LIBRARIES $ENV{SFML_ROOT}/extlibs/libs-msvc/x86/glew.lib)
        #set(FREETYPE_LIBRARY $ENV{SFML_ROOT}/extlibs/libs-msvc/x86/freetype.lib)
ENDIF()

2
General / Linking in Linux
« on: August 15, 2013, 07:42:21 am »
Hey everyone.  I've been using SFML on Windows for the past 6 months, but I've been using CMake for my build system so that I could ensure that I could build it in Linux at least.  So, I've hit a milestone in my engine and I want to ensure that everything works in Linux as well, because I would like to be able to release Windows/Linux at least.  Anyway, I've fixed all the issues with my code, and I've even got the .a library linking, but unfortunately g++ is having issues linking the libraries linked to by SFML (for instance x11).  I build SFML with these directions:

http://sfmlcoder.wordpress.com/2011/08/16/building-sfml-2-0-with-make-for-gcc/

I added all of the libraries needed, but for whatever reason g++ isn't finding them when it goes to link my application.  Anyone have any ideas on how to possibly resolve this? 

Pages: [1]
anything