I am compiling my source codes with :
g++ -o bc main.cpp comm_lib.cpp mxnet_mtcnn.cpp utils.cpp -std=c++11 -o3 $(pkg-config --cflags --libs opencv)
-I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/include/ -I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/cpp-package/include -I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/tvm/nnvm/include/ -I/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/dmlc-core/include -L/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib -lmxnet
and resulting file working correctly , opens the camera etc.
when try to compile through CMakeList.txt . with :
> cmake_minimum_required(VERSION 2.8.9) project (BCFacev4)
> SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ")
>
> set(MXNET /Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib)
>
> find_package( OpenCV REQUIRED )
>
>
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/include/
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/cpp-package/include
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/tvm/nnvm/include/
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/3rdparty/dmlc-core/include
> )
> include_directories(/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib)
>
> SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
> -L/Users/xxx/Downloads/apache-mxnet-src-1.3.0-incubating/lib -lmxnet ")
>
>
>
> ADD_EXECUTABLE(main main.cpp comm_lib.cpp mxnet_mtcnn.cpp utils.cpp)
> TARGET_LINK_LIBRARIES(main ${OpenCV_LIBS} ${MXNET_LIBS} )
it also compiles and runs the program BUT exiting below error :
> OpenCV Error: Assertion failed (ny > 0 && nx > 0) in repeat, file
> /Users/xxx/Projects/opencv/modules/core/src/copy.cpp, line 864
> libc++abi.dylib: terminating with uncaught exception of type
> cv::Exception:
> /Users/xxx/Projects/opencv/modules/core/src/copy.cpp:864: error:
> (-215) ny > 0 && nx > 0 in function repeat
I didnt understand why cmake compiled binary gives this error ? Am I missing some configuration ?
Thanks
I found the sneaky problem :()
one of the files in the source compile file and the resulting binary found it and working.
Bur Cmake and CLion creating different build folder and running there so THE file silently not found and the misery starts.
Sorry for this.
I found the problem.
Best
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.