Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 712793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:53:16+00:00 2026-05-14T04:53:16+00:00

I want to bring a .dll dependency into my Qt project. So I added

  • 0

I want to bring a .dll dependency into my Qt project.

So I added this to my .pro file:

win32 {
LIBS += C:\lib\dependency.lib
LIBS += C:\lib\dependency.dll
}

And then (I don’t know if this is the right syntax or not)

#include <windows.h>
Q_DECL_IMPORT int WINAPI DoSomething();

btw the .dll looks something like this:

#include <windows.h>
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, 
                                        LPVOID lpReserved)
{
    return TRUE;
}

extern "C"
{
int WINAPI DoSomething() { return -1; }
};

Getting error: unresolved symbol?

Note: I’m not experienced with .dll’s outside of .NET’s ez pz assembly architechture, definitely a n00b.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:53:17+00:00Added an answer on May 14, 2026 at 4:53 am

    Your “LIBS +=” syntax is wrong. Try this:

    win32 {
        LIBS += -LC:/lib/ -ldependency
    }
    

    I’m also not sure if having absolute paths with drive letter in your .pro file is a good idea – I usually keep the dependencies somewhere in the project tree and use relative path.

    EDIT:

    I suppose that something is wrong in your dll, i.e. the symbols are not exported correctly. I always use template provided by QtCreator:

    1. Inside dll project there is mydll_global.h header with code like that:

      #ifdef MYDLL_LIB
          #define MYDLL_EXPORT Q_DECL_EXPORT
      #else
          #define MYDLL_EXPORT Q_DECL_IMPORT
      #endif
      
    2. Dll project has DEFINES += MYDLL_LIB inside it’s pro file.

    3. Exported class (or only selected methods) and free functions are marked with MYDLL_EXPORT inside header files, i.e.

      class MYDLL_EXPORT MyClass {
      
      // ...
      
      };
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i.e. I want to bring this in my code: static BOOL MyConstantBool = YES;
how do i bring the tr value into .click event? i want to be
I want Flash to communicate directly with dll files. How can I do this?
I have a C# project that imports a C dll, the dll has this
Visual Studio 2008 I want to bring some localisation into my ASP.NET MVC site.
I'm currently attempting to integrate a DLL ( FooEmulation ) into an existing project.
I want to bring the cursor to a textbox when i clicked a button.
I have a couple of buttons where I want to bring up an html
I want to create a PDF that will bring up a typical OK/Cancel alert
How can I bring my RubyCocoa application to the front? Basically I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.