Giter Club home page Giter Club logo

Comments (9)

fallahn avatar fallahn commented on September 24, 2024

If you're using precompiled binaries for tmxlite and sfml then they were probably compiled with different settings. Recompile one or the other (or both) so that the settings match, then make sure your own project settings match too.

from tmxlite.

fishyperil avatar fishyperil commented on September 24, 2024

Could you give me an example of how to do that with the tmxlite stuff you uploaded ?

I'm sorry if this seems noobish but I don't actually know how to do it myself... I'm completely self thought and I've only been programming for about a year so sometimes I don't know things that come as a given to most people.

from tmxlite.

fallahn avatar fallahn commented on September 24, 2024

It sounds like you're using Visual Studio so that's what I'll assume.
Clone or download the tmxlite repository to your computer. Open the visual studio solution, right click on the tmxlite project and choose properties. Make sure the configuration is set to DebugStatic, and set the runtime library as you were on your project. Do the same for ReleaseStatic.
At the top of VS where the drop down contains the selection for Release and Debug builds, select configuration manager. For the release configuration set the tmxlite project to ReleaseStatic. Do the same for Debug. You can also choose here if you're building for x86 or x64. You should be able to hit build and get the compiled tmxlite library. If you get a build failure it may be because the v140 compiler tools are not installed - either upgrade the project to v141 (project properties) or install the tools from the VS2017 installer program.

For SFML it's pretty much the same, only you first have to create the VS solution with CMake. There are instructions on the SFML site. When you have the solution created you can set the runtime libraries in the same way. It's also worth noting that if you want to use static SFML libraries your project needs to define SFML_STATIC in the preprocessor options of the project properties. You also need to link a set of further libraries, listed on the SFML site (under setting up SFML for visual studio). This isn't necessary when using dll/shared libraries but you will get errors if you accidentally mix the two up.

from tmxlite.

fishyperil avatar fishyperil commented on September 24, 2024

Ok, great explanation, it sounds like I'll be able to figure it out. I know about SFML's usual requierments , I've been playing around with it for a few months now, learning to build a pretty basic game framework.

I'll give it a try tomorrow, I've already spent like 5 hours today trying to get it all up and running..... thanks a lot for helping out :)

from tmxlite.

fallahn avatar fallahn commented on September 24, 2024

No problem, we've all been there :)

from tmxlite.

fishyperil avatar fishyperil commented on September 24, 2024

I've compiled both the tmxlite and the SFML libs manually and linked them together for the most part, however I'm still left with this :

1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__joyGetPosEx@8 referenced in function "public: static bool __cdecl sf::priv::JoystickImpl::isConnected(unsigned int)" (?isConnected@JoystickImpl@priv@sf@@SA_NI@Z)

1>sfml-window-s-d.lib(JoystickImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__joyGetDevCapsW@12 referenced in function "public: bool __thiscall sf::priv::JoystickImpl::open(unsigned int)" (?open@JoystickImpl@priv@sf@@QAE_NI@Z)

1>sfml-system-s-d.lib(SleepImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__timeGetDevCaps@8 referenced in function "void __cdecl sf::priv::sleepImpl(class sf::Time)" (?sleepImpl@priv@sf@@YAXVTime@2@@z)

1>sfml-system-s-d.lib(SleepImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__timeBeginPeriod@4 referenced in function "void __cdecl sf::priv::sleepImpl(class sf::Time)" (?sleepImpl@priv@sf@@YAXVTime@2@@z)

1>sfml-system-s-d.lib(SleepImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__timeEndPeriod@4 referenced in function "void __cdecl sf::priv::sleepImpl(class sf::Time)" (?sleepImpl@priv@sf@@YAXVTime@2@@z)

I've tried linking manually compiled libraries as well as linkining manually compiled tmxlite against my usual sfml settings and I still get these same errors.... Do you know what the issue could be ?

Sorry to keep bugging :)

from tmxlite.

fallahn avatar fallahn commented on September 24, 2024

These are sfml errors, probably because you're statically linking it:

Starting from SFML 2.2, when static linking, you will have to link all of SFML's dependencies to your project as well. This means that if you are linking sfml-window-s.lib or sfml-window-s-d.lib for example, you will also have to link opengl32.lib, winmm.lib and gdi32.lib. Some of these dependency libraries might already be listed under "Inherited values", but adding them again yourself shouldn't cause any problems.

As the errors are from sfml-system and sfml-window at a guess I'd say you're missing winmm.lib. Check the table in the link for the full list of libs :)

from tmxlite.

fishyperil avatar fishyperil commented on September 24, 2024

It looks like it really was the winmm.lib file ! I actually checked the lib files in my other sfml project to see if I'm missing something, and somehow I skipped that one , even though I can see that it's there now .

Well , thanks a lot man, it's up and running now - time to get down to the interesting stuff :)

from tmxlite.

fallahn avatar fallahn commented on September 24, 2024

You're welcome, have fun!

from tmxlite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.