开发者

OpenCV static linking on 64 bit

开发者 https://www.devze.com 2023-02-21 00:06 出处:网络
I\'ve writ开发者_运维百科ten a simple application in OpenCV, and compiled it using the following command:

I've writ开发者_运维百科ten a simple application in OpenCV, and compiled it using the following command:

g++ -I ./include/opencv -Wall -o imageHash imageHash.h imageHash.cpp -lcv -lhighgui

What I'm trying to do next, is the following:

  • use static linking, so I can run this application without the need to install openCV on the traget machine

  • compile the app to a CPU independent form, so I can run this on 32 bit and 64 bit machines as well.

How do I modify the compilation command, to achive the following? Thanks, krisy


If you want it to run independently on 32 and 64 bit systems, compile in 32 bit mode. As for static linking, theoretically the way to do it is when you are building with cmake, under the build tab uncheck BUILD_SHARED_LIBS. The problem I faced is that this does not seem to work, so for right now you may be stuck with dynamic linking. To over-ride the install on other systems, just put the DLL's in the same directory as the exe.

0

精彩评论

暂无评论...
验证码 换一张
取 消