简体   繁体   中英

Compiling OpenCV / C++ application on server

I would like to create a c++ application, which uses OpenCV, running on a server. To do this, I need to compile the c++ application on my server. But, how can I get my OpenCV libraries (and other libraries) on the server? Or is there another way to get my c++ application running on my sever? ie compiling on my own computer instead of on a server.

I hope you can help me! Thanks!

If the server is the same architecture (eg both intel x86 32 bit or both PowerPC) you should be able to compile on your own box and run it on the server.

Also, as noted by jlengrand below, you can set your computer up with a cross-compiler for just about any target architecture. That basically lets you type in a one-liner command to set up your compilation environment, then when you invoke g++ or whatever you're using, it will build for the architecutre the cross compiler is made for.

I don't know much about OpenCV, but as long as you have it set up to " statically link " the libraries then they should be part of your resulting executable. So, the executable would have all the libraries and it would be runnable on any computer with your computer's architecture.

Watch out for dynamic linking as it would mean the libraries themselves had to be present and locatable on the server when you run the executable though (dynamic linking means shared libraries, where they're not part of the executable and have to be provided separately. While dynamic linking is really better as things can be shared and updated, it is more complex for deployment).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM