Entry Point Not Found (Looking for QString in wrong DLL)
-
Hello all,
To basically outline the project I'm working on, my project consist of a framework or a set of classes that I'm using Cmake to build this framework with. I'm exporting the package of this framework using cmake.
This framework has several classes that use Qt classes such as QString (mainly). After compiling all the libraries and dlls for this project -- Let's call this FooFramework, I also make sure to copy the necessary DLLs from Qt5s bin directory into my projects bin directory (Qt5Core(d), Qt5Gui(d), etc.) This project doesn't have any executables because as I said, it's just a set of classes. Everything compiles just fine.
The problem I'm having is when I'm trying to create another project, that imports this framework to use these sets of classes, everything seems like it should be working. I'm linking against all the libraries in FooFramework because I'm able to use the headers and I'm not getting any compile errors or linker errors. However, with this new project -- Let's call it BarApplication -- this has an executable. Whenever I try to run the executable I am greeted with this error:
bq. Entry Point Not Found
The procedure entry point
??0TestClass@Axl@@QAE@PBDABVQString@@H@Z could not be located in the dynamic link library AxlCore.dll"...@Axl@@..." in this syntax I'm pretty sure is the namespace.
However I'm completely stumped at this point because the only thing I know about this error and what it means is completely based on what I've been looking for as a solution to this issue (prior to making this thread). I'm a tad new to Qt so I'm a little ignorant as to what is happening here but it looks like it's trying to look for QString in AxlCore (which is a subproject in FooFramework). I made sure to wrap any and all Qt class prototypes in my header files in QtBegin/QtEnd so that it should be inside the Qt namespace (That is what that does correct?).
I've tried quite a few things.
-
Ensured that the bin folder in my FooFramework contained the dlls necessary for the classes that I used. (AxlCore.dll and Qt5Core.dll are a couple of them)
-
I didn't think it would be necessary but I even though I tried copying all the same DLLs into BarApplication's bin folder as well even though I configured CMake to include FooFrameworks bin directory just to be safe and that didn't work.
-
I only have one version installed on my computer 5.4 msvc2010. (I was using 5.2 before but I uninstalled it to use the latest; albeit the same exact errors).
-
I searched this forum for people with similar issues but their solutions had to deal with them having multiple installations and a DLL mismatch, but I'm positive that isn't the case because I specifically copied the dlls into BOTH projects bin folders and I only have one installation on my machine at the moment.
-
Windows x64, msvc2010
-
Followed the instructions for using Cmake with Qt5 from here: http://doc.qt.io/qt-5/cmake-manual.html (Underneath the Getting Started section because I am using Cmake 3.1) Which helped me get the libraries included correctly and I was able to actually compile using the Qt classes.
If there is anyone who can give me any kind of insight to what might be my problem, I would greatly appreciate it.
(I'm new to these forums and Qt sorry in advance if I didn't give enough information). -
-
Hi,
When you create a shared library with Qt Creator, it creates a DEFINE for you in the .pro file and puts it into the class definition that's automatically created for you when you exit the new project wizard. The class definition in a shared library look like this:
@
#include <shared_lib_name_global.h>class DEFINEDSYMBOL ClassName
{
public:
ClassName();
...
}
@You need to #include that header and add that symbol to each class and to the front of each function that need to be exported from the library.
Make sure that the classes and functions in your libraries match the above setup.
-
[quote author="ckakman" date="1421867009"]Hi,
When you create a shared library with Qt Creator, it creates a DEFINE for you in the .pro file and puts it into the class definition that's automatically created for you when you exit the new project wizard. The class definition in a shared library look like this:
@
#include <shared_lib_name_global.h>class DEFINEDSYMBOL ClassName
{
public:
ClassName();
...
}
@You need to #include that header and add that symbol to each class and to the front of each function that need to be exported from the library.
Make sure that the classes and functions in your libraries match the above setup.[/quote]
Hello,
Thank you for your response. I'm actually already doing that, however I'm not using QtCreator I'm using Visual Studio 2010.I'm exporting those classes (including the TestClass I have listed above as such:
@
//AxlCoreExports.h
#pragma once#if defined(_WINDOWS)
if defined(AxlCore_EXPORTS)
define AxlCore_API __declspec(dllexport)
else
define AxlCore_API __declspec(dllimport)
endif
#else
define AxlCore_API
#endif
@and in my TestClass.h file I have:
@#include <QString>
#include "AxlCoreExports.h"class AxlCore_API TestClass
{
TestClass(const QString &string = "Hello");
...
};@So I'm already exporting these functions and classes from the library. My problem however appears to be (based on the error that I'm getting) that it seems to be looking for QString inside of AxlCore.dll instead of Qt5Core.dll. That's my assumption on the issue, I just don't know how to fix that to make it look in the correct dll for QString.. Unless of course I didn't understand your post all the way. I'm trying to use the AxlCore library as well as Qt's library.
-
I can't see that QString is looked for in your library. Adding function parameters to mangled function names is done by all compilers I have used.
Are you sure that you have copied the Qt DLLs from the correct directory? For example, you shouldn't use the Qt DLLs in the Qt Creator's bin directory.
-
[quote author="ckakman" date="1421869137"]I can't see that QString is looked for in your library. Adding function parameters to mangled function names is done by all compilers I have used.
Are you sure that you have copied the Qt DLLs from the correct directory? For example, you shouldn't use the Qt DLLs in the Qt Creator's bin directory. [/quote]
I don't believe I'm using the QtCreator's bin directory..
I installed Qt on my machine at
C:/Projects/Qt/5.4 (installation directory)
From here, to get to the binaries I copied, I'm using the path:
C:/Projects/Qt/5.4/5.4/msvc2010_opengl/bin
In this folder is where I'm getting the dlls I need (Qt5Core/d, Qt5Gui/d), and then copying them up to my projects bin directory.
-
Hi, suggest to make your BarApplication run, first try to simplify, build it without using any functionality from your AxlCore library, for example just try some QStrings within the BarApplication.
Once BarApplication is running fine, then try to include stuff from AxlCore. If you now get QString DLL errors, you'll know it's because of something in AxlCore and not in BarApplication.
Also, you can download Dependency Walker, it's a useful tool for debugging DLL errors. -
[quote author="ckakman" date="1421870146"]Well, some Google results were about copying wrong DLLs. I don't have any more suggestions, maybe someone else here had that problem and can help you.[/quote]
Yes, I saw the same results and there were some of those same problems on this forum as well, I looked at about 50 different issues regarding this before I finally made this thread. Thanks for your help.
[quote author="hskoglund" date="1421870305"]Hi, suggest to make your BarApplication run, first try to simplify, build it without using any functionality from your AxlCore library, for example just try some QStrings within the BarApplication.
Once BarApplication is running fine, then try to include stuff from AxlCore. If you now get QString DLL errors, you'll know it's because of something in AxlCore and not in BarApplication.
Also, you can download Dependency Walker, it's a useful tool for debugging DLL errors.
[/quote]Yes, this I did do as well and I think you're right. I think it has something to do with AxlCore. I ran a simple stdout piece of code that outputs "Hello World" in BarApplication to the console by:
@#include <iostream>
int main(argc, char **argv)
{
QString str("Hello World");
std::cout << qPrintable(str)
return 0;
}@And this does indeed output Hello World. I saw a couple recommendations about this and I actually downloaded Dependency Walker as well. Turns out it helped me discover that I needed to also include:
icudt53.dll
icuin53.dll
icuuc53.dllWhich was good to know. Thanks for the tip. I'll try to see if I can try and use other classes in AxlCore and see if I can narrow in on the issue.
In the meantime if anyone else has any ideas they are greatly appreciated.