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

Author Topic: LNK1104 Error  (Read 8581 times)

0 Members and 1 Guest are viewing this topic.

SScagnetti

  • Newbie
  • *
  • Posts: 5
    • View Profile
LNK1104 Error
« on: October 02, 2009, 05:31:51 am »
So I am trying to learn SFML and I am understanding the code, but am having troubles compiling and running any programs.

I downloaded the simple window tutorial C++ file and linked it to the sfml-window.lib file, as the tutorial on the site said, but when I went to build the program I got the following error: "LINK : fatal error LNK1104: cannot open file 'sfml-window.lib'" Which I understand means that it cannot even find the sfml-window.lib file. I installed SFML how I was told to by the tutorial and I also did the Linker/Input thing how it said, but I keep getting this error.

I don't know if I should shuffle the files around to a different spot or if I'm not doing the Linker/Input thing right, but I am baffled as to how I can fix this error.

phear-

  • Jr. Member
  • **
  • Posts: 64
    • MSN Messenger - LOApokalypse@hotmail.com
    • View Profile
    • http://gtproductions.org
LNK1104 Error
« Reply #1 on: October 02, 2009, 06:57:39 am »
And your sure you put the files in the right places within your compiler?
Eugene Alfonso
GTP | Twitter

Mindiell

  • Hero Member
  • *****
  • Posts: 1261
    • ICQ Messenger - 41484135
    • View Profile
LNK1104 Error
« Reply #2 on: October 02, 2009, 01:58:13 pm »
System, EDI, compiler ?
Mindiell
----

SScagnetti

  • Newbie
  • *
  • Posts: 5
    • View Profile
LNK1104 Error
« Reply #3 on: October 02, 2009, 08:32:17 pm »
Quote from: "Mindiell"
System, EDI, compiler ?


Windows XP, Microsoft Visual C++ Express Edition.

And I am sure I installed it right, as it recognizes the sf:: codes. I took the folders from the zip I downloaded and put the proper folders with their contents into my VC and include file as I was told. That is, I did not remove the files from the folders in the zip, just moved the folder and all.

phear-

  • Jr. Member
  • **
  • Posts: 64
    • MSN Messenger - LOApokalypse@hotmail.com
    • View Profile
    • http://gtproductions.org
LNK1104 Error
« Reply #4 on: October 02, 2009, 08:55:19 pm »
*note* just because you can access sf:: (When you include the header) doesnt mean it is installed properly. Includes are only half of what you need. Try making sure that you are putting the /lib/ files into your compilers /lib/ folder.
Eugene Alfonso
GTP | Twitter

SScagnetti

  • Newbie
  • *
  • Posts: 5
    • View Profile
LNK1104 Error
« Reply #5 on: October 02, 2009, 11:14:26 pm »
I moved the /lib files around and now it builds successfully. Thanks all!

But now a new problem arises. Upon the launching of the program, the console crashes and I get the error: "This application has failed to start because sfml-window.dll was not found. Re-installing the application may fix the problem."

Does that mean I need to move the .dll file to my project folder? And if so where?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
LNK1104 Error
« Reply #6 on: October 02, 2009, 11:18:47 pm »
Quote from: "SScagnetti"
Does that mean I need to move the .dll file to my project folder?
Yes. Or into windows/system32. But if you choose the latter possibility, don't forget to think of delivering the DLLs in your executable's directory when you want applications to work on other systems.

Quote from: "SScagnetti"
And if so where?
Into the project folder. :)
If you see the .vcproj and .ncb files, you're right. It's neither of the subdirectories Release or Debug, even if the .exe file is located there.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

SScagnetti

  • Newbie
  • *
  • Posts: 5
    • View Profile
LNK1104 Error
« Reply #7 on: October 03, 2009, 12:47:59 am »
I feel so stupid. It still won't work and I don't know what I'm doing wrong. I have moved the dll to the same file as the cpp file and the project file, and I still get the same error. It's probably something extremely small, but for the life of me I can't get it.

phear-

  • Jr. Member
  • **
  • Posts: 64
    • MSN Messenger - LOApokalypse@hotmail.com
    • View Profile
    • http://gtproductions.org
LNK1104 Error
« Reply #8 on: October 03, 2009, 04:08:15 am »
You need to move the dll to the same folder as your exe.
Eugene Alfonso
GTP | Twitter

SScagnetti

  • Newbie
  • *
  • Posts: 5
    • View Profile
LNK1104 Error
« Reply #9 on: October 03, 2009, 04:46:55 am »
Thank you! It works! Finally. It ran into an error and crashed, but I'm pretty sure that's due to it not being a complete code so I'm not worried about that part at all.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
LNK1104 Error
« Reply #10 on: October 03, 2009, 09:46:03 am »
Quote from: "phear-"
You need to move the dll to the same folder as your exe.
If you start the application from the MSVC++ IDE, the DLL is required in the project directory, not the one of the executable. Otherwise (if you start it directly from windows explorer), it is advisable to move the .exe to the project directory because of other dependencies like resources.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

phear-

  • Jr. Member
  • **
  • Posts: 64
    • MSN Messenger - LOApokalypse@hotmail.com
    • View Profile
    • http://gtproductions.org
LNK1104 Error
« Reply #11 on: October 03, 2009, 09:53:32 pm »
Quote from: "Nexus"
Quote from: "phear-"
You need to move the dll to the same folder as your exe.
If you start the application from the MSVC++ IDE, the DLL is required in the project directory, not the one of the executable. Otherwise (if you start it directly from windows explorer), it is advisable to move the .exe to the project directory because of other dependencies like resources.


Thats not true. The exe needs the DLL to work. It doesnt matter what folder the exe is in, as long as it has the DLL to load.
Eugene Alfonso
GTP | Twitter

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
LNK1104 Error
« Reply #12 on: October 04, 2009, 12:55:32 pm »
Quote from: "phear-"
Thats not true. The exe needs the DLL to work. It doesnt matter what folder the exe is in, as long as it has the DLL to load.
Ah, you're right. But during the development, it doesn't make a lot of sense to put the DLLs into the exe folder because you have to duplicate them like this (once for Release and once for Debug). Placing them into the project directory is perfectly ok when starting from the IDE. Otherwise, rather move the .exe instead of other files, since additional dependencies like images or sounds are normally located relative to the project directory, too.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: