0

I was able to connect Qtwith OpenCV and the my application is working properly. But now would like that my .exe file does not have any dependencies with .dll files. I would like be able to use my application in another computer without concerns.

I tried to search in several forums but i didn´t find any solution to my problem.

Adding CONFIG += static to my .pro file is enough??

NelsonR
  • 35
  • 4
  • Did you already build Qt as a static library? Is this a commercial application? If so are you going to supply the object files so your customers can rebuild your application with a new static build of Qt? – drescherjm Sep 09 '14 at 08:26
  • @drescherjm I build `Qt` as a static library once, but when i did that `OpenCV` stop working with `Qt`. Then, with `Cmake`, i tried to build opencv with Qt [Stackoverflow Guide](http://stackoverflow.com/questions/15881913/how-to-link-opencv-in-qtcreator-and-use-qt-library). At the end of all this i reinstalled Qt and repeat the steps on the previous link, and it is working. I'm still not able to create files without any kind of `.dll` dependencies... (as a "standalone" version). This is a gui that i am developing for a course, there is no commercial purpose. – NelsonR Sep 09 '14 at 09:40

2 Answers2

1

You need to add the CONFIG += static indeed, besides that you need to create a static build of OpenCV, Qt, and statically link it all into an exe.

I shared my setup here.

Just clone the repo and follow the instructions :)

migas
  • 4,787
  • 3
  • 15
  • 15
-1

check out bin2h. it can convert your dll file to a header file that you import into your project. you can then write out to file the generated header and then dynamically link it to your executable

bustedware
  • 194
  • 1
  • 3
  • 18