SFML community forums

Help => General => Topic started by: MyFriendTre on July 19, 2023, 09:44:56 am

Title: LNK2001 Error for unknown reason
Post by: MyFriendTre on July 19, 2023, 09:44:56 am
I've been up all night trying to figure out whats causing this linker error. Never used SFML and new to c++, I need to be able to set this up for an assignment. Any help is welcome, I've been working at it for hours at this point.

My program recognizes the files but wont "link" to them?
Title: Re: LNK2001 Error for unknown reason
Post by: G. on July 19, 2023, 11:15:47 am
First, why are you posting a screenshot of you not linking the lib?
Looks nothing like the screenshot in the tutorial (https://www.sfml-dev.org/tutorials/2.6/start-vc.php)
(https://www.sfml-dev.org/tutorials/2.6/images/start-vc-link-libs.png)

It looks like you're compiling in x64 in your 2nd screenshot, but you show us your configuration for win32. Make sure you include the headers and link the lib for the x64 platform.

Follow the tutorial, pretty much.
Title: Re: LNK2001 Error for unknown reason
Post by: MyFriendTre on July 19, 2023, 05:40:28 pm
First, why are you posting a screenshot of you not linking the lib?
Looks nothing like the screenshot in the tutorial (https://www.sfml-dev.org/tutorials/2.6/start-vc.php)
(https://www.sfml-dev.org/tutorials/2.6/images/start-vc-link-libs.png)

It looks like you're compiling in x64 in your 2nd screenshot, but you show us your configuration for win32. Make sure you include the headers and link the lib for the x64 platform.

Follow the tutorial, pretty much.

When I do that I get LNK1181 error. I tried the tutorial way and I tried the way we did it in my course, my professor didnt need to include dependencies Regardless, Im still getting errors with dependencies and x64. 

Title: Re: LNK2001 Error for unknown reason
Post by: G. on July 19, 2023, 06:28:45 pm
Looks like you also skipped the step where you configure the directories, at least the lib one.

(https://www.sfml-dev.org/tutorials/2.6/images/start-vc-paths.png)
Title: Re: LNK2001 Error for unknown reason
Post by: MyFriendTre on July 19, 2023, 07:25:44 pm
Looks like you also skipped the step where you configure the directories, at least the lib one.

(https://www.sfml-dev.org/tutorials/2.6/images/start-vc-paths.png)

I fixed that but im still getting the same one error.
Title: Re: LNK2001 Error for unknown reason
Post by: G. on July 20, 2023, 04:05:00 pm
That's literally not the same error though.

In one screenshot your path is c/libraries/sfml2.6, in the other one it's c/sfml2.6, is that right? ???