Use a Qt library in Visual studio
-
Hi and welcome,
@lmenale said:
Hi all,
I would like to use a library created with Qt in a Microsoft project.This means that the object in the Qt library have to follow the windows interface.
I'm not sure to understand what you mean... Qt is no compiler, therefore which compiler did you use? Is your library a shared one?
You need to compile your library with MSVC first.
Then simply add the path to your headers in the new project include path, add the path of the .lib file to the new project library directory and don't forget to add the .lib to the "additional dependencies". -
I use visual studio express so MSVC.
This means that I can use a Class in my qt shared library from a VB code?
@lmenale said:
This means that I can use a Class in my qt shared library from a VB code?
I'm afraid I have no clue if using a C++ dll in a VB project works. My knowledge is limited to C++ as far as Visual Studio is concerned. Maybe you can use marshalling as in C#?
-
Ok,
please give more info about "marshalling as in C#"I found this:
http://doc.qt.io/qt-5/activeqt-server.html -
I use visual studio express so MSVC.
This means that I can use a Class in my qt shared library from a VB code?
It seems you're asking a question that has nothing to do with Qt, honestly. It seems what you're really asking, is whether you can call into a shared library, which presumably was build using MSVC (you didn't quite answer that crucial question yet), from a VB code, which you also compile in MSVC.
If that is correct, it seems to me you'll need to look into some MS documentation, like this: https://msdn.microsoft.com/en-us/library/dt232c9t.aspx
There is nothing special about a shared library built on top of Qt, compared to any other library (except for some runtime dependencies on Qt dlls). Whatever is true for any shared (c++) library compiled using MSVC, will be true for your library as well.
-
It seems you're asking a question that has nothing to do with Qt, honestly. It seems what you're really asking, is whether you can call into a shared library, which presumably was build using MSVC (you didn't quite answer that crucial question yet), from a VB code, which you also compile in MSVC.
If that is correct, it seems to me you'll need to look into some MS documentation, like this: https://msdn.microsoft.com/en-us/library/dt232c9t.aspx
There is nothing special about a shared library built on top of Qt, compared to any other library (except for some runtime dependencies on Qt dlls). Whatever is true for any shared (c++) library compiled using MSVC, will be true for your library as well.