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.


Messages - stikykees

Pages: [1]
1
General / Re: SFML Setup with Visual Studio
« on: April 29, 2021, 06:55:08 am »
Ok, getting close now.
If we look at the first error:
sfml-window-s-d.lib(InputImpl.cpp.obj) : error LNK2019: unresolved external symbol __imp__GetAsyncKeyState@4 referenced in function "public: static bool __cdecl sf::priv::InputImpl::isKeyPressed(enum sf::Keyboard::Key)" (?isKeyPressed@InputImpl@priv@sf@@SA_NW4Key@Keyboard@3@@Z)

It's saying that the isKeyPressed function in sfml-windows-s-d can't find a function called __imp__GetAsyncKeyState@4.
GetAsyncKeyState is a windows sdk function. Checking it at https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getasynckeystate says it comes in user32.lib.
All the following errors look like they are user32.lib (or similar windows sdk lib) related too.

So for some reason your project isn't linking user32.lib. Usually it should be inherited in the linker settings:


My first guess would be your project is trying to use the wrong windows sdk.
Try right clicking on the project in the solution explorer and selecting Retarget Projects. Then choose one of the SDKs in the combo box and hit Ok.


My only available windows SDK was 10.0 (latest version) but I noticed that "Inherit from parent or project defaults was unchecked while it was it was on your screenshot. Checking it ended up fixing the problem. Thank you so much for the help working through this. I would've never gotten it otherwise. ;D

2
General / Re: SFML Setup with Visual Studio
« on: April 28, 2021, 11:30:22 pm »
Complete error message list:
(click to show/hide)

Code if it is relevant (just testing window and audio functionality):
(click to show/hide)

Seeing as though all error messages begin with "1>sfml-window-s-d.lib" I recopied this file from the download into the SFML directory. The error messages were identical after making this change.

3
General / Re: SFML Setup with Visual Studio
« on: April 28, 2021, 04:54:03 am »
It sounds like you have SFML_STATIC defined for release builds, but not for debug builds.
Go into project properties / C++ / Preprocessor / Preprocessor Definitions and make sure SFML_STATIC is there for debug builds.

Unfortunately, this is not the problem, I just double-checked it is defined. Very weird because I'm comparing all my settings to another project that functions and they are identical except adding the audio library to no avail.

4
General / SFML Setup with Visual Studio
« on: April 27, 2021, 10:54:37 pm »
Hello,

I have recently started using SFML for some projects to get practice with C++. I am using Visual Studio to run my program but sometimes get stuck while setting up SFML libraries.

Currently my release configuration runs the tutorial code perfectly however, the debug configuration gives 53 LNK errors of either 2019 or 2001. (I added the -d to the 4 main SFML libraries in debug config that I am using).

I am using Visual Studio 2019, SFML 2.5.1, C++, static SFML libraries.

Again, release configuration complies fine, debug config fails where all config settings are the same except the
-d added to the 4 main SFML libraries I'm using.


One of the 53 LNK errors
1>sfml-window-s-d.lib(InputImpl.cpp.obj) : error LNK2019: unresolved external symbol...

Debug dependencies:
(click to show/hide)


Edit (Solution):
Checking the "Inherit from parent or project defaults" in the Linker>>Input>>Add'l Dependencies fixed the problem. For some reason this happened by default in my debug configuration but not my release configuration.

Pages: [1]
anything