Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building a library with Visual Studio that can be linked to a Qt project?

Right now I have some libraries that link easily to Visual Studio projects but I can't figure out how to link them with Qt. My idea is to write a VS project that wraps the functionality I need from the libraries, then compile that to a library which can be linked to Qt. From my understanding, VS and Qt use compilers that create incompatibile libraries. My questions are:

  1. Can I modify VS or Qt in a way that I can compile a library in VS which can be linked to Qt?
  2. Is there a simpler solution to this problem?

The specific library I'm using is Nitro-Nitf. For my Qt project I'm using Qt Creator and for Visual Studio I'm using VS 2008.

like image 618
Graphics Noob Avatar asked Aug 10 '09 20:08

Graphics Noob


People also ask

How does Qt integrate with Visual Studio?

In Microsoft Visual Studio, select Extensions > Manage Extensions > Online, and search for Qt Visual Studio Tools to install or update Qt VS Tools.

Can you open Qt Project in Visual Studio?

pro projects into Visual Studio. To do that, select the Qt VS Tools > Open Qt Project File (. pro) to let the extension create a VS solution and project from your existing Qt . pro file.

How do I create a Qt library?

alternatively you can right-click your project in Qt Creator and select "Add Library...", choose "External library" and browse for your library file: For libraries compiled with MSCV compiler in windows, you look for . lib or . dll.

How do I add an external library to Qt?

Select File > New Project > Library > C++ Library.


1 Answers

Yes, the Windows binaries provided by Qt are built using MinGW. If you build Qt from source using Visual Studio, then your libraries will be compatible.

Although I haven't tried it, Qt Creator 1.2 introduces support for MS compilers, so you should be able to continue to develop your Qt projects in Creator.

like image 200
swongu Avatar answered Nov 15 '22 07:11

swongu