g++ app with openCV in static
Hi
I use openCV without extra modules in shared mode install, it's easy to compile my application:
g++ -std=c++11 -stdlib=libc++ Main.cpp -o app `pkg-config --cflags --libs /Users/xxx/Applications/opencv-3.2.0/opencv/build/unix-install/opencv.pc` -I/System/Library/Frameworks/JavaVM.framework/Headers
But when I compile openCv with -DBUILD_SHARED_LIBS=OFF option my command doesn't work !
I tested to make my app with cmake it's work, but I realy need to compile with g++ command.
Thx cc
[edit] Ok second round:
here my Main.cpp and my command to compile:
#include <opencv2/core/core.hpp>
#include <iostream>
int main(int argc, char **argv){
std::cout << "hello" << std::endl;
cv::Mat img;
return 0;
}
g++ -std=c++0x Main.cpp -I /xxx/opencv/build/include -L /xxx/opencv/build/lib -lopencv_core -o Main
Command don't work and I had a very tall error:
Undefined symbols for architecture x86_64:
"_cblas_cgemm", referenced from:
lapack_gemm32fc(float const*, u ...
...
(many ... ...)
...
ld:
symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I dont' see one solution.
Obviously with cmake it's working, but here I need g++
can you take a look here ?
you can try to disable lapack :
cmake -DWITH_LAPACK=OFF
(when building the opencv libs)(hope, you do not mind my edit, but it would look "answered" else)
Thk, I try to reinstal openCV with :
cmake -DWITH_LAPACK=OFF
Here my new error message when I compile my own program:
Undefined symbols for architecture x86_64: "_clBuildProgram", referenced from: cv::ocl::Program::Impl::Impl(cv:
Here my cmake to compile my own program (it's important to say that with cmake it's work perfectly), I think g++ command is bad
EDIT: I move all my process with cmake
so, is it solved now ?
(and, if so, should i move your last comment to an answer ?)
Problem it solved for me because I move to cmake but I don't find solution to do a compilation with g++