Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Compiling 2.4.8 without shared libs

Is it still possible to compile OpenCV as static libraries?

I am trying to compile OpenCV 2.4.8 (Linux distribution) without producing dynamic libraries.

The command I use is the following one:

 cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/.../user/work/libs/opencv -D BUILD_SHARED_LIBS=off ..

When I compile, I got the following error:

 [19%] Generating precomp.hpp.gch/opencv_core_RELEASE.gch
 /usr/lib/../lib64/crt1.o: In function `_start':
 /usr/src/packages/BUILD/glibc-2.11.1/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
 collect2: error: ld returned 1 exit status
 make[2]: *** [modules/core/precomp.hpp.gch/opencv_core_RELEASE.gch] Error 1
 make[1]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error 2

which is clearly to static/dynamic.

Is there anyone who can tell me what I am doing wrong?

cheers

Compiling 2.4.8 without shared libs

Is it still possible to compile OpenCV as static libraries?

I am trying to compile OpenCV 2.4.8 (Linux distribution) without producing dynamic libraries.

The command I use is the following one:

 cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/.../user/work/libs/opencv -D BUILD_SHARED_LIBS=off ..

When I compile, I got the following error:

 [19%] Generating precomp.hpp.gch/opencv_core_RELEASE.gch
 /usr/lib/../lib64/crt1.o: In function `_start':
 /usr/src/packages/BUILD/glibc-2.11.1/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
 collect2: error: ld returned 1 exit status
 make[2]: *** [modules/core/precomp.hpp.gch/opencv_core_RELEASE.gch] Error 1
 make[1]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error 2

which is clearly to static/dynamic.related to static/dynamic linking.

Is there anyone who can tell me what I am doing wrong?

cheers

click to hide/show revision 3
retagged

updated 2014-03-12 08:34:14 -0600

berak gravatar image

Compiling 2.4.8 without shared libs

Is it still possible to compile OpenCV as static libraries?

I am trying to compile OpenCV 2.4.8 (Linux distribution) without producing dynamic libraries.

The command I use is the following one:

 cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/.../user/work/libs/opencv -D BUILD_SHARED_LIBS=off ..

When I compile, I got the following error:

 [19%] Generating precomp.hpp.gch/opencv_core_RELEASE.gch
 /usr/lib/../lib64/crt1.o: In function `_start':
 /usr/src/packages/BUILD/glibc-2.11.1/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
 collect2: error: ld returned 1 exit status
 make[2]: *** [modules/core/precomp.hpp.gch/opencv_core_RELEASE.gch] Error 1
 make[1]: *** [modules/core/CMakeFiles/pch_Generate_opencv_core.dir/all] Error 2

which is clearly to related to static/dynamic linking.

Is there anyone who can tell me what I am doing wrong?

cheers