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. How to statically link a lib file into your QT project. Need help. Have questions:
Forum Updated to NodeBB v4.3 + New Features

How to statically link a lib file into your QT project. Need help. Have questions:

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 222 Views
  • 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.
  • D Offline
    D Offline
    Davidm71
    wrote on last edited by
    #1

    Hi,

    Experimenting with creating a static library to link against a test program. Lets say I create a Factorial class with header and class files when I compile it (using MSVC compiler lets say in Windows) I get a lib file but QT Creator popsup a message that "executable not found". Not sure why thats happening.

    Second afterwards I create my test program widget QT doesn't autocomplete the header includer file. Maybe because path is wrong and I need header files besides not just the obj or dll files??

    So if anyone could please write up step by step instructions I would appreciate it.

    Thanks

    aha_1980A 1 Reply Last reply
    0
    • D Davidm71

      Hi,

      Experimenting with creating a static library to link against a test program. Lets say I create a Factorial class with header and class files when I compile it (using MSVC compiler lets say in Windows) I get a lib file but QT Creator popsup a message that "executable not found". Not sure why thats happening.

      Second afterwards I create my test program widget QT doesn't autocomplete the header includer file. Maybe because path is wrong and I need header files besides not just the obj or dll files??

      So if anyone could please write up step by step instructions I would appreciate it.

      Thanks

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi @Davidm71,

      Experimenting with creating a static library to link against a test program. Lets say I create a Factorial class with header and class files when I compile it (using MSVC compiler lets say in Windows) I get a lib file but QT Creator popsup a message that "executable not found". Not sure why thats happening.

      Because a library is not an executable. Creator just tells you, that it cannot execute a lib.

      Second afterwards I create my test program widget QT doesn't autocomplete the header includer file. Maybe because path is wrong and I need header files besides not just the obj or dll files??

      Sure, you need the headers to compile and the lib to link against your library - no matter if you link static or dynamic.

      The usual way is to set up a SUBDIRS project to have lib and app together.

      Regards

      Qt has to stay free or it will die.

      1 Reply Last reply
      2

      • Login

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