Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MSVC fatal error LNK1181: cannot open input file
Forum Updated to NodeBB v4.3 + New Features

MSVC fatal error LNK1181: cannot open input file

Scheduled Pinned Locked Moved Unsolved General and Desktop
16 Posts 3 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jsulmJ jsulm

    @Bremenpl Really strange. Try to delete the *.pro.user file, delete build directory, run qmake and build.

    B Offline
    B Offline
    Bremenpl
    wrote on last edited by
    #7

    @jsulm Ok, disabling the Qt Quick Compiler solved the problem. What does it do anyways? Its disabled in the Debug build. Does it attempts to compile the QML code so the QML files are not needed?

    lprzenioslo.zut.edu.pl

    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • B Bremenpl

      @jsulm Ok, disabling the Qt Quick Compiler solved the problem. What does it do anyways? Its disabled in the Debug build. Does it attempts to compile the QML code so the QML files are not needed?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #8

      @Bremenpl See https://doc.qt.io/QtQuickCompiler/
      Not sure why it breaks the build. Maybe you have to do something in your pro file to use it properly (I never used it, so don't know).

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      B 1 Reply Last reply
      0
      • B Bremenpl

        @jsulm Ok, disabling the Qt Quick Compiler solved the problem. What does it do anyways? Its disabled in the Debug build. Does it attempts to compile the QML code so the QML files are not needed?

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #9

        @Bremenpl said in MSVC fatal error LNK1181: cannot open input file:

        @jsulm Ok, disabling the Qt Quick Compiler solved the problem. What does it do anyways? Its disabled in the Debug build. Does it attempts to compile the QML code so the QML files are not needed?

        It indeed takes your qml files, precompiles them to usable binary. In end effect makes the startup process of your application much faster, as the interpreter does not have to parse your QML files before each start.

        I'm using it all the time, and have had never this problem.

        Can you check if the problem persists, if you define a specific directory for the generated files inside your *pro file ?
        using:

        OBJECTS_DIR 
        MOC_DIR 
        RCC_DIR 
        UI_DIR 
        QMLCACHE_DIR
        

        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        B 1 Reply Last reply
        1
        • jsulmJ jsulm

          @Bremenpl See https://doc.qt.io/QtQuickCompiler/
          Not sure why it breaks the build. Maybe you have to do something in your pro file to use it properly (I never used it, so don't know).

          B Offline
          B Offline
          Bremenpl
          wrote on last edited by
          #10

          @jsulm Ok, I thought I was missing qtquickcompiler in the pro file CONFIG section but that did not change anything... On linux side using GCC everything works without unckecing the qt quick compiler, maybe its a windows only thing.

          lprzenioslo.zut.edu.pl

          1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @Bremenpl said in MSVC fatal error LNK1181: cannot open input file:

            @jsulm Ok, disabling the Qt Quick Compiler solved the problem. What does it do anyways? Its disabled in the Debug build. Does it attempts to compile the QML code so the QML files are not needed?

            It indeed takes your qml files, precompiles them to usable binary. In end effect makes the startup process of your application much faster, as the interpreter does not have to parse your QML files before each start.

            I'm using it all the time, and have had never this problem.

            Can you check if the problem persists, if you define a specific directory for the generated files inside your *pro file ?
            using:

            OBJECTS_DIR 
            MOC_DIR 
            RCC_DIR 
            UI_DIR 
            QMLCACHE_DIR
            
            B Offline
            B Offline
            Bremenpl
            wrote on last edited by
            #11

            @J.Hilk Which DIR(s) should I set exactly?

            lprzenioslo.zut.edu.pl

            J.HilkJ 1 Reply Last reply
            0
            • B Bremenpl

              @J.Hilk Which DIR(s) should I set exactly?

              J.HilkJ Offline
              J.HilkJ Offline
              J.Hilk
              Moderators
              wrote on last edited by J.Hilk
              #12

              @Bremenpl since it's the *.obj files that make the problems, OBJECTS_DIR ?

              but the quick compiler generated files fall in the QMLCACHE_DIR category


              Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


              Q: What's that?
              A: It's blue light.
              Q: What does it do?
              A: It turns blue.

              B 1 Reply Last reply
              0
              • J.HilkJ J.Hilk

                @Bremenpl since it's the *.obj files that make the problems, OBJECTS_DIR ?

                but the quick compiler generated files fall in the QMLCACHE_DIR category

                B Offline
                B Offline
                Bremenpl
                wrote on last edited by
                #13

                @J.Hilk said in MSVC fatal error LNK1181: cannot open input file:

                @Bremenpl sinds it's the *.obj files that make the problems, OBJECTS_DIR ?

                Of course, had to make sure...
                Ok, so I added this entry to the pro file:

                OBJECTS_DIR = K:\obj
                

                And for some reason it works now, nice call!
                The generated Makefile.Release is no longer corrupted.

                lprzenioslo.zut.edu.pl

                jsulmJ 1 Reply Last reply
                1
                • B Bremenpl

                  @J.Hilk said in MSVC fatal error LNK1181: cannot open input file:

                  @Bremenpl sinds it's the *.obj files that make the problems, OBJECTS_DIR ?

                  Of course, had to make sure...
                  Ok, so I added this entry to the pro file:

                  OBJECTS_DIR = K:\obj
                  

                  And for some reason it works now, nice call!
                  The generated Makefile.Release is no longer corrupted.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #14

                  @Bremenpl said in MSVC fatal error LNK1181: cannot open input file:

                  OBJECTS_DIR = K:\obj

                  Just a note: you should use / instead of \ in pro files even on Windows.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  B 2 Replies Last reply
                  1
                  • jsulmJ jsulm

                    @Bremenpl said in MSVC fatal error LNK1181: cannot open input file:

                    OBJECTS_DIR = K:\obj

                    Just a note: you should use / instead of \ in pro files even on Windows.

                    B Offline
                    B Offline
                    Bremenpl
                    wrote on last edited by
                    #15

                    @jsulm It would be best for me to use something like:

                    OBJECTS_DIR = config_name/obj
                    

                    But for over half hour I cannot figure out what is the variable name in pro file storing the current build config name...

                    lprzenioslo.zut.edu.pl

                    1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Bremenpl said in MSVC fatal error LNK1181: cannot open input file:

                      OBJECTS_DIR = K:\obj

                      Just a note: you should use / instead of \ in pro files even on Windows.

                      B Offline
                      B Offline
                      Bremenpl
                      wrote on last edited by
                      #16

                      @jsulm Btw, I have removed the OBJECTS_DIR entry and now the compilation is correct. All obj files are placed in the default location...

                      lprzenioslo.zut.edu.pl

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved