Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Failing to load textures and weird console output in Debug mode of VS2019  (Read 2072 times)

0 Members and 1 Guest are viewing this topic.

Yee7i

  • Newbie
  • *
  • Posts: 13
    • View Profile
I've rebuilt the SFML code, along with Thor's code, to use with VS2019 (Community, to be exact). I used CMake and NMake, referring to the tutorial on the forums.
The thing is, I can't load any textures, the output is buggy. I'll attach screenshots below.
I've got everything linked correctly (at least I think I do). -d libs in debug mode, normal ones in release mode, every path set correctly. I've built everything with CMake for NMake, 32-bit, changing the parameters to Release and Debug respectively.
Everything is working fine in Release mode, textures loading, no weird output.
I'm linking dynamically.
In both debug and release modes there are no missing libs or anything that Visual Studio would notify me of.

Below screenshots of linkers and console output.

« Last Edit: September 16, 2019, 10:41:25 pm by Yee7i »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Failing to load textures and weird console output in Debug mode of VS2019
« Reply #1 on: September 16, 2019, 10:45:33 pm »
That's usually an indication that you're linking release libraries in debug mode or the other way around.

Can you provide the verbose build command?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Yee7i

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Failing to load textures and weird console output in Debug mode of VS2019
« Reply #2 on: September 17, 2019, 01:49:21 pm »
I got to it, it says it succeeds, but console's output is the same as before
Now I'll try to fix most of the warnings, but still the release version works fine.

edit. now that I've noticed this part
2\freeglut.lib "sfml-window-d.lib" "sfml-main-d.lib" "sfml-graphics-d.lib" "sfml-audio-d.lib" "sfml-system-d.lib" "thor-d.lib" openal32.lib ogg.lib freetype.lib flac.lib vorbis.lib vorbisenc.lib vorbisfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib
I'm wondering what sfml's libraries in quotes mean.

1>------ Rebuild All started: Project: Ripoff, Configuration: Debug Win32 ------
1>Microsoft (R) C/C++ Optimizing Compiler Version 19.22.27905 for x86
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>cl /c /IC:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/include/ /I"C:\Users\Shadow\Documents\C++ libs\SFML\include" /I"C:\Users\Shadow\Documents\C++ libs\Thor\include" /ZI /JMC /W3 /WX- /diagnostics:column /sdl /Od /Oy- /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /permissive- /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Debug\\" /Fd"Debug\vc142.pdb" /Gd /TP /analyze- /FC /errorReport:prompt Animations.cpp Main.cpp Cameraworks.cpp Utilities.cpp
1>Animations.cpp
1>Main.cpp
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Animations.cpp(11,20): warning C4018:  '<': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:  'argument': conversion from 'double' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(385,183): warning C4244:         ]
1>Cameraworks.cpp
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:  'argument': conversion from 'double' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Main.cpp(384,183): warning C4244:         ]
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(68,19): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(70,18): warning C4018:  '<': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(75,18): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(81,19): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(83,18): warning C4018:  '<': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(88,18): warning C4018:  '>': signed/unsigned mismatch
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:  'argument': conversion from 'T' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         ]
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         and
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:             T=int
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,110): warning C4244:         ]
1>Utilities.cpp
1>Generating Code...
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:  'argument': conversion from 'T' to 'T', possible loss of data
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         with
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:             T=float
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         ]
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         and
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         [
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:             T=int
1>C:\Users\Shadow\source\repos\Ripoff\Ripoff\Cameraworks.cpp(95,63): warning C4244:         ]
1>Microsoft (R) Incremental Linker Version 14.22.27905.0
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>"/OUT:C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.exe" /INCREMENTAL "/LIBPATH:C:\Users\Shadow\Documents\C++ libs\SFML\libs" "/LIBPATH:C:\Users\Shadow\Documents\C++ libs\Thor\libs" C:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/lib/Win32\glew32.lib C:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/lib/Win32\glfw3dll.lib C:\Users\Shadow\source\repos\Ripoff\packages\nupengl.core.0.1.0.1\build\native\../..//build/native/lib/Win32\freeglut.lib "sfml-window-d.lib" "sfml-main-d.lib" "sfml-graphics-d.lib" "sfml-audio-d.lib" "sfml-system-d.lib" "thor-d.lib" openal32.lib ogg.lib freetype.lib flac.lib vorbis.lib vorbisenc.lib vorbisfile.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST "/MANIFESTUAC:level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG:FASTLINK "/PDB:C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.lib" /MACHINE:X86 Debug\Animations.obj
1>Debug\Main.obj
1>Debug\Cameraworks.obj
1>Debug\Utilities.obj
1>Ripoff.vcxproj -> C:\Users\Shadow\source\repos\Ripoff\Debug\Ripoff.exe
1>Done building project "Ripoff.vcxproj".
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
« Last Edit: September 17, 2019, 01:52:57 pm by Yee7i »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Failing to load textures and weird console output in Debug mode of VS2019
« Reply #3 on: September 17, 2019, 02:19:09 pm »
Why are you linking glew32, glfw3dll and freeglut?

Kind of hard to tell otherwise. Maybe you have somewhere a DLL which was renamed to have a -d suffix, but it actually is a release library?
Or maybe Thor was using the wrong SFML libraries?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Yee7i

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Failing to load textures and weird console output in Debug mode of VS2019
« Reply #4 on: September 17, 2019, 02:33:44 pm »
I believe OpenGL libs are linked by NuGet automatically, because I don't have them under input.

I'll rebuild both SFML and Thor again for Debug and get back with news.

By the way, does building for debug differ anyhow from buiding for release, other than changing the cmake option from Release to Debug in configuration?

Yee7i

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Failing to load textures and weird console output in Debug mode of VS2019
« Reply #5 on: September 17, 2019, 04:46:39 pm »
Okay, after trying for a bit, I'll just assume I'm doing something wrong while making debug libraries.

I'll ask a simple question, answer for which may or may not be so simple - in order to create debug libraries, do I need to change only CMAKE_BUILD_TYPE to Debug, or do I need to do something else? I can't seem to make them work, even though they generate as -d.

I'll attach a picture of CMake with settings I use