Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

g++ app with openCV in static

Hi I use openCV without extra modules in shared on 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-v003/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 dosent work !

I tested to make my app with cmake it's work, but I realy need to compile with g++ command.

Thx cc

g++ app with openCV in static

Hi Hi

I use openCV without extra modules modules in shared on install 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-v003/opencv/build/unix-install/opencv.pc` /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 dosent 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 cc

click to hide/show revision 3
None

updated 2017-09-26 04:53:23 -0600

berak gravatar image

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 command 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++

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 command 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:

ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

invocation)

I dont' see one solution.

Obviously with cmake it's working, but here I need g++

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 command 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++