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

Author Topic: LNK1104: cannot open file 'sfml-window.lib'  (Read 8534 times)

0 Members and 1 Guest are viewing this topic.

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
LNK1104: cannot open file 'sfml-window.lib'
« on: June 21, 2012, 09:36:41 pm »
Dear readers,

I reinstalled my computer and reinstalled Qt and SFML.
I keep getting the error as described in the title when saving and running the program.

My .pro file at this moment:

QT          += core gui

TARGET      = Crystallibrium
TEMPLATE    = app


SOURCES     += main.cpp

HEADERS     +=

FORMS       +=

LIBS        += -L"C:\Program Files (x86)\SFML\lib" -lsfml-window -lsfml-graphics -lsfml-system
INCLUDEPATH = "C:\Program Files (x86)\SFML\include"

#include <SFML/Graphics.hpp>

int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");

    // Start the game loop
    while (window.isOpen())
    {
        // Process events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Close window : exit
            if (event.type == sf::Event::Closed)
                window.close();
        }

        // Clear screen
        window.clear();

        // Update the window
        window.display();
    }

    return 0;
}
 

The error(s) I am receiving:

Quote
:-1: error: LNK1104: cannot open file 'sfml-window.lib'

Quote
21:30:25: Running build steps for project Crystallibrium...
21:30:25: Configuration unchanged, skipping qmake step.
21:30:25: Starting: "C:\QtSDK\QtCreator\bin\jom.exe"
LINK : fatal error LNK1104: cannot open file 'sfml-window.lib'
   link /LIBPATH:"c:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /MANIFEST /MANIFESTFILE:"debug\Crystallibrium.intermediate.manifest" /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /OUT:debug\Crystallibrium.exe @C:\Users\Angelo\AppData\Local\Temp\Crystallibrium.exe.4392.0.jom
   C:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug
jom: C:\Users\Angelo\Desktop\Projecten\Crystallibrium\Crystallibrium-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK__Debug\Makefile.Debug [debug\Crystallibrium.exe] Error 1104

jom 1.0.8 - empower your cores

jom: C:\Users\Angelo\Desktop\Projecten\Crystallibrium\Crystallibrium-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK__Debug\Makefile [debug] Error 2
21:30:25: The process "C:\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
Error while building project Crystallibrium (target: Desktop)
When executing build step 'Make'

The files in my lib/ folder are called (example):
libsfml-window.a
libsfml-window.a
....
....

The files in my include/sfml/ folder are called (example):
Graphics
System
....
....




I am using the newest Qt SDK, running on Windows 7 Professional 64-bit.

Hope someone can help me out :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: LNK1104: cannot open file 'sfml-window.lib'
« Reply #1 on: June 21, 2012, 10:44:27 pm »
As far as I can tell you're trying to compile with the MSVC (*.lib) compiler but you want to use the GCC libraries (*.a). This obviously doesn't work.

You either need to adjust the Qt Creator or take the other SFML libs. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: LNK1104: cannot open file 'sfml-window.lib'
« Reply #2 on: June 21, 2012, 11:00:34 pm »
Can you please tell me how I change it in Qt?

Cause if I click on "Projects" and change "Qt version" from "MSVC2010" to "Qt 4.8.1 for Desktop - MinGW" I get the error:

The program has unexpectedly finished.

I am so confused now lol...



What I exactly did:

1. I downloaden the SFML 2.0 Snapshot.
2. Unpacked it on my desktop.
3. Opened a MS-DOS Box and added my Cmake path (inside Qt folder) to the DOS Box.
4. Let Cmake unpack everything into a new folder
5. Browse to that "new" folder (build folder) through the DOS Box.
6. Give the command: mingw32-make.exe (went through without problems)
7. Give the command: mingw32-make.exe install (went through without problems)
8. Added (what is below) code to my .pro file

Quote
LIBS += -L"C:\Program Files (x86)\SFML\lib"
INCLUDEPATH = "C:\Program Files (x86)\SFML\include" -lsfml-window -lsfml-graphics -lsfml-system

Then I added this test code to my .cpp file:

Quote
#include <SFML/Graphics.hpp>
 
int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
 
    // Start the game loop
    while (window.isOpen())
    {
        // Process events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Close window : exit
            if (event.type == sf::Event::Closed)
                window.close();
        }
 
        // Clear screen
        window.clear();
 
        // Update the window
        window.display();
    }
 
    return EXIT_SUCCESS;
}

When I click on (left side of screen) Project button in Qt (Qt SDK newest version) I have:

Edit build configuration: Qt 4.8.1 for Desktop - MSVC2010 (Qt SDK) Debug
Qt version: Qt 4.8.1 for Desktop - MSVC2010 (Qt SDK)
Tool chain: Microsoft Visual C++ Compiler 10.0 (x86)

I now get the error:
Quote
:-1: error: LNK1104: cannot open file 'sfml-window.lib'

When I change the Qt version to (for example) MinGW, it says something about backslashes when I try to save and run the program.

Hope you (or anyone) can help me out :)

Never had this problem in the past ;  ;
« Last Edit: June 21, 2012, 11:55:36 pm by GroundZero »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: LNK1104: cannot open file 'sfml-window.lib'
« Reply #3 on: June 22, 2012, 12:27:07 am »
Can you please tell me how I change it in Qt?

Cause if I click on "Projects" and change "Qt version" from "MSVC2010" to "Qt 4.8.1 for Desktop - MinGW" I get the error:

The program has unexpectedly finished.

I am so confused now lol...

I've actually no idea about Qt Creator...
I guess it should like you've described it and that it crashes isn't nice at all.

When I change the Qt version to (for example) MinGW, it says something about backslashes when I try to save and run the program.

Does that now mean that you still anyways can switch to MinGW, I though it just crashes.  :o
Anyway, then try to change all the backslashes \ into forward slashes / (e.g. C:\Program... -> C:/Program...)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: LNK1104: cannot open file 'sfml-window.lib'
« Reply #4 on: June 22, 2012, 01:03:02 am »
yeah I tried that, didnt work lol, tells me it cannot find bla bla bla (what I first posted) lol :)

GroundZero

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: LNK1104: cannot open file 'sfml-window.lib'
« Reply #5 on: June 22, 2012, 10:14:47 pm »
Oke, again one day later... still not working grr.... what I tried and have so far (someone please help me LOL)

my Tool chain says "Microsoft Visual C++ Compiler 10.0 (x86). I tried changing it to Mingw but that is impossible, it will only accept the MSVC Compiler.

I made a new project and now the settings are this by default:



Now it does not tell me it cannot find the SFML items, but it gives me the following error:

Quote
Starting C:\Users\Angelo\Desktop\Projecten\Test\untitled-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug\debug\untitled.exe...
testC:\Users\Angelo\Desktop\Projecten\Test\untitled-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug\debug\untitled.exe exited with code 0

Starting C:\Users\Angelo\Desktop\Projecten\Test\untitled-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug\debug\untitled.exe...
The program has unexpectedly finished.
C:\Users\Angelo\Desktop\Projecten\Test\untitled-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug\debug\untitled.exe exited with code -1073741515

The Compile output:
Quote
22:01:38: Running build steps for project untitled...
22:01:38: Configuration unchanged, skipping qmake step.
22:01:38: Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe"
c:\qtsdk\desktop\qt\4.8.1\mingw\bin\qmake.exe -spec c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\win32-g++ CONFIG+=declarative_debug -o Makefile ..\untitled\untitled.pro
WARNING: c:\Users\Angelo\Desktop\Projecten\Test\untitled\untitled.pro:11: Unescaped backslashes are deprecated.
WARNING: c:\Users\Angelo\Desktop\Projecten\Test\untitled\untitled.pro:11: Unescaped backslashes are deprecated.
WARNING: c:\Users\Angelo\Desktop\Projecten\Test\untitled\untitled.pro:11: Unescaped backslashes are deprecated.
C:/QtSDK/mingw/bin/mingw32-make.exe -f Makefile.Debug
mingw32-make.exe[1]: Entering directory `C:/Users/Angelo/Desktop/Projecten/Test/untitled-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\QtGui" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include" -I"c:\Program Files (x86)\SFML\include" -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"..\untitled" -I"." -I"c:\QtSDK\Desktop\Qt\4.8.1\mingw\mkspecs\win32-g++" -o debug\main.o ..\untitled\main.cpp
g++ -mthreads -Wl,-subsystem,windows -o debug\untitled.exe debug/main.o  -L"c:\QtSDK\Desktop\Qt\4.8.1\mingw\lib" -lmingw32 -lqtmaind "-LC:\Program Files (x86)\SFML\lib" -lsfml-window -lsfml-graphics -lsfml-system -lQtGuid4 -lQtCored4
mingw32-make.exe[1]: Leaving directory `C:/Users/Angelo/Desktop/Projecten/Test/untitled-build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug'
22:01:40: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited normally.

Can anyone tell me what the hell is wrong? im getting so frustrated after 4-5 days now pfff...

 

anything