Hey everyone! I have sfml up and want to run the example based on the tutorial on how to run example with visual studio. I'm currently using VS Community 2022 and the using cmake, it has downloaded 2.5.1. I followed all the steps and when I try to run the example, I get an error saying cannot open file jpeg.lib.
There's already post on here but unfortunately, I had no luck within this issue. Does anyone here knows what I'm doing wrong or maybe I have to download the latest sfml which is 2.6.1?
SFML jpeg.lib?
Based on the information provided in the contexts, it seems like your issue might not be directly related to Spine or its integration with SFML, but rather with the SFML setup itself. However, considering the Spine-SFML examples and common issues encountered during setup, here are a few suggestions:
Ensure SFML is Correctly Linked: The error
cannot open file jpeg.lib
suggests that the SFML dependencies are not correctly linked in your project. SFML depends on several external libraries, including ones for handling JPEG images. When using CMake to generate your Visual Studio solution, make sure that all SFML dependencies are correctly found and linked. This includes ensuring that theFindSFML.cmake
script (if you're using one) correctly locates all SFML components and their dependencies.Check SFML Version Compatibility: Although you mentioned updating to SFML 2.6.1 might be a solution, it's important to ensure compatibility with the Spine-SFML runtime. If the Spine-SFML examples are confirmed to work with SFML 2.5.1, it might be safer to stick with that version unless you're comfortable adjusting the code for compatibility with newer versions of SFML.
Verify External Libraries: SFML uses external libraries for image, sound, and window management. If you're missing
jpeg.lib
, it might be due to an incomplete SFML setup or download. Ensure you have all the necessary binaries and libraries for your development environment and that they are accessible to your project.Consult SFML Documentation: For issues specifically related to SFML setup and its dependencies, consulting the SFML documentation and forums might provide more targeted advice, especially regarding setting up SFML with Visual Studio and handling external dependencies like
jpeg.lib
.
If after checking these points you still encounter issues, it might be helpful to revisit the steps for setting up the Spine-SFML example, ensuring all dependencies are correctly configured in your Visual Studio project.
OK, I tried again following the steps running the example and I still have the same issue. What's going on is that when I open cmake, and do everything that the setup tells me to do, it downloads sfml 2.5.1 along with the dependencies, clicked configure, then generate, open the sln file, then change projectdir to output dir, and I still get the same error. Do I need to download vs community 2015 for this to work?
- Изменено
It appears jpeg.lib is no longer part of VS 2022. Open the file spine-runtimes/spine-sfml/cpp/CMakeLists.txt
, then remove the line target_link_libraries(spine-sfml-cpp-testbed ${SFML_LIBS}/jpeg.lib)
. Then generate your CMake project files. That should do the trick.
Sorry for late response, I did do that, and I started generating make files and I got unresolved errors roughly 33 of them. Is there something I need to download to fix this?
Please always post the full error log. It's impossible to say what's going on without that.

Sorry, hope you don't mind but i ended up taking snapshots since I couldn't copy the errors
Any luck?
Mario is not in today, but will take a look at your issue very soon. We appreciate your patience and we'll try to help you as soon as possible.
Also, if possible, please go to the error list and do a Ctrl-A to select all the errors, right-click, and then select copy. You can then paste them to a text file so that we can parse the errors you're receiving.
Thanks for the error log. It appears you are not linking SFML itself. The linker complains that all of SFML is basically missing.
You have the target type set to x64, the 64-bit version of Intel's instruction set. However, the SFML libraries you have stored locally are for 32-bit Intel.
Two ways to solve this:
select 32-bit (not sure what the list item is called) here.
- Clone the spine-runtimes repository again and start fresh, you have old SFML binaries in your build tree. Alternatively, you can run
git clean -x -f -d
on the command line in your current clone of thespine-runtimes
OK just download sfml 2.5.1 and link them to the demo?
I would suggest setting up a SFML project without Spine, get that working, then add Spine to it.
Yes of course, you can use our example as a basis for your app. Though I feel that if setting up a vanilla project with a game toolkit is so hard for new users, that is probably not a great game toolkit in general. That's not your fault, that's SFML's fault. Why stick with SFML? There are many others that don't involve such pain. I'm partial to libgdx, which is what the Spine editor is written in.