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

Author Topic: LNK1181: VS12  (Read 6591 times)

0 Members and 2 Guests are viewing this topic.

Luponius

  • Newbie
  • *
  • Posts: 22
    • View Profile
LNK1181: VS12
« on: January 24, 2014, 12:36:00 pm »
Followed the tutorial, went through all the other LNK1181 errors in the forums and I feel like I'm skipping something simple.  And I had this working before too, but now that I formatted and decided to get VS12, I'm stuck with:

1>------ Build started: Project: Project1, Configuration: Release Win32 ------
1>LINK : fatal error LNK1181: cannot open input file 'sfml-graphics.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

So what did I do?

Downloaded CMake, generated for Visual Studio 12 (2013) in the same directory "D:/Programming/SFML/SFML-2.1"

Went through the following tutorial: http://www.sfml-dev.org/tutorials/2.1/start-vc.php

And despite feeling like the error is something on my end (poor configuration) I just can't figure out what's wrong...

I also feel as if the folder structure has changed somewhat.  In the guide linked above it says:

Quote
Now compile the project, and if you linked to the dynamic version of SFML, don't forget to copy the SFML DLLs (they are in <sfml-install-path/bin>) to the directory where your compiled executable is. Then run it

And yet my SFML has no bin folder, I find my DLLs in <sfml-install-path>/lib/Release or <sfml-install-path>/lib/Debug

I placed my dll files in the <Projects>\Project1\Project1\Release folder and built as release, but that error typed out above happened.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Re: LNK1181: VS12
« Reply #1 on: January 24, 2014, 12:58:50 pm »
"cannot open input file" usual means "cannot find input file" which again means, that you've set the path the library files wrong or not at all. Post the full build command here. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Luponius

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: LNK1181: VS12
« Reply #2 on: January 24, 2014, 06:01:33 pm »
1>------ Build started: Project: Project1, Configuration: Release Win32 ------
1>  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x86
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  cl /c /I"D:\Programming\SFML\SFML-2.1\include" /Zi /W3 /WX- /sdl /O2 /Oi /Oy- /GL /D _MBCS /Gm- /EHsc /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo"Release\\" /Fd"Release\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt main.cpp
1>  
1>  main.cpp
1>  Microsoft (R) Incremental Linker Version 12.00.21005.1
1>  Copyright (C) Microsoft Corporation.  All rights reserved.
1>  
1>  "/OUT:D:\Programming\SFML\Projects\Project1\Release\Project1.exe" "/LIBPATH:D:\Programming\SFML\SFML-2.1\lib" "sfml-graphics.lib" "sfml-window.lib" "sfml-system.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 "/PDB:D:\Programming\SFML\Projects\Project1\Release\Project1.pdb" /OPT:REF /OPT:ICF /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT "/IMPLIB:D:\Programming\SFML\Projects\Project1\Release\Project1.lib" /MACHINE:X86 /SAFESEH Release\main.obj
1>LINK : fatal error LNK1181: cannot open input file 'sfml-graphics.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

The linker setting:


Actual directory it leads to:


Of course I did the input dependencies separately for Debug and Release as the guide explains it.

Lignum

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: LNK1181: VS12
« Reply #3 on: January 24, 2014, 06:10:15 pm »
In "Additional Library Directories" you need to refer to the "Debug" and "Release" folders accordingly, since MSVC is looking for the .lib files in the folder you specified but in your case it only finds the folders "Debug" and "Release" rather than the SFML libraries.

I.e.: In your debug configuration you should refer to:
        D:\Programming\SFML\SFML-2.1\lib\Debug

        and in release:
        D:\Programming\SFML\SFML-2.1\lib\Release

Luponius

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: LNK1181: VS12
« Reply #4 on: January 24, 2014, 06:45:08 pm »
Thanks, it worked.