ImageSplicingDetection icon indicating copy to clipboard operation
ImageSplicingDetection copied to clipboard

macOS - Linking issue when trying to build vole

Open jtlz2 opened this issue 6 years ago • 2 comments

Hi - I get as far as:

cd source/illuminants/build make [ 2%] Linking CXX executable vole Undefined symbols for architecture x86_64: "cv::imwrite(cv::String const&, cv::_InputArray const&, std::__1::vector<int, std::__1::allocator > const&)", referenced from: lille::CommandLocalGrayworld::execute() in command_lgrayworld.cpp.o lille::CommandLocalIebv::execute() in command_liebv.cpp.o vole::CommandFelzenszwalb::execute() in commandfelzenszwalb.cpp.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[2]: *** [vole] Error 1 make[1]: *** [CMakeFiles/vole.dir/all] Error 2 make: *** [all] Error 2

Are you able to assist with getting it working? Thanks!

jtlz2 avatar Dec 12 '18 10:12 jtlz2

OK I made some progress as follows:

  1. Edited source/illuminants/CMakeLists.txt a la https://stackoverflow.com/questions/47822547/non-default-compilers-gcc-or-vanilla-clang-on-macos-high-sierra-linking-issue/50313990#50313990 - giving the below. In CMakeLists.txt, OpenCV_LIBS was populated using pkg-config --cflags --libs opencv

  2. brew install llvm

  3. [avoided ccmake :\ ] mkdir build; cd build; cmake ..

  4. make

  5. [unnecessary?] export DYLD_LIBRARY_PATH=/usr/local/Cellar/opencv/3.4.3_1/lib

  6. brew install glog

  7. Hey presto! ./vole


          =x= vole image forensics toolkit =x=  

                _.---._..-""""""-.        
             .-" o   -.           `.           
             `._     -'             \          
               _`";`                 |         
              '-'__\  \     _.-'     /__      
                '-'---'--'``\__, _.-'--""-.  
           jgs               (.-'        ,-`    


Usage: ./vole [--help] command [configfile] [options ...]

All options can also be given in the specified config file.
Options given in the command line will overwrite options from the file.

Available commands:
  felzenszwalb:	Superpixel segmentation by Felzenszwalb and Huttenlocher.
  lgrayworld:	Locally applied illuminant estimator, using the generalized Gray World algorithm.
  liebv:	Locally applied illuminant estimator, using IEBV.

Updated CMakeLists.txt:

cmake_minimum_required(VERSION 2.8) project(Vole)

set(CMAKE_PREFIX_PATH "/usr/local/Cellar/opencv/3.4.3_1/")

set(OpenCV_INCLUDE_DIRS "/usr/local/Cellar/opencv/3.4.3_1/include/") set(OpenCV_LIBS "-I/usr/local/Cellar/opencv/3.4.3_1/include/opencv -I/usr/local/Cellar/opencv/3.4.3_1/include -L/usr/local/Cellar/opencv/3.4.3_1/lib -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_dnn_objdetect -lopencv_dpm -lopencv_face -lopencv_photo -lopencv_fuzzy -lopencv_hfs -lopencv_img_hash -lopencv_line_descriptor -lopencv_optflow -lopencv_reg -lopencv_rgbd -lopencv_saliency -lopencv_sfm -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_surface_matching -lopencv_tracking -lopencv_datasets -lopencv_dnn -lopencv_plot -lopencv_xfeatures2d -lopencv_shape -lopencv_video -lopencv_ml -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_flann -lopencv_xobjdetect -lopencv_imgcodecs -lopencv_objdetect -lopencv_xphoto -lopencv_imgproc -lopencv_core")

find_package( OpenCV REQUIRED )

set(CMAKE_C_COMPILER "/usr/local/Cellar/llvm/7.0.0_1/bin/clang") set(CMAKE_CXX_COMPILER "/usr/local/Cellar/llvm/7.0.0_1/bin/clang++")

find_package( Boost 1.68.0 COMPONENTS program_options )

include_directories(${Boost_INCLUDE_DIRS}) include_directories( ${OpenCV_INCLUDE_DIRS} ) add_definitions(-DWITH_BOOST -DWITH_BOOST_PROGRAM_OPTIONS)

include_directories(${OpenCV_DIR}/../opencv-Build/install/include) include_directories( shell rbase superpixels superpixels/felzenszwalb/implementation/ illumestimators lille )

set(PROJECT_FILES shell/command.h shell/modules.h shell/modules.cpp shell/config.h shell/config.cpp illumestimators/common/statistics.h illumestimators/common/mask.h illumestimators/common/derivative.cpp illumestimators/common/mask.cpp illumestimators/common/derivative.h illumestimators/common/statistics.cpp illumestimators/common/color.cpp illumestimators/common/color.h illumestimators/illuminantestimator.cpp illumestimators/illuminantestimator.h illumestimators/fusion/fusion.h illumestimators/fusion/histogramVotingFusion.cpp illumestimators/fusion/config_histogram_voting_fusion.h illumestimators/fusion/config_histogram_voting_fusion.cpp illumestimators/fusion/histogramVotingFusion.h illumestimators/fusion/fusion.cpp illumestimators/iic/config_iebv.cpp illumestimators/iic/config_iebv.h illumestimators/iic/iic.h illumestimators/iic/iic.cpp illumestimators/iic/iebv.cpp illumestimators/iic/iebv_estimator.h illumestimators/iic/iebv_estimator.cpp illumestimators/iic/iebv.h illumestimators/grayworld/grayworldestimator.h illumestimators/grayworld/grayworldestimator.cpp lille/commands/command_lgrayworld.cpp lille/commands/command_liebv.h lille/commands/command_liebv.cpp lille/commands/command_lgrayworld.h lille/paint_superpixel.h lille/liebv_config.cpp lille/lgrayworld_config.h lille/liebv_config.h lille/lgrayworld_config.cpp lille/paint_superpixel.cpp superpixels/felzenszwalb/implementation/image.h superpixels/felzenszwalb/implementation/misc.h superpixels/felzenszwalb/implementation/segment-image.h superpixels/felzenszwalb/implementation/filter.h superpixels/felzenszwalb/implementation/segment-graph.h superpixels/felzenszwalb/implementation/disjoint-set.h superpixels/felzenszwalb/implementation/convolve.h superpixels/felzenszwalb/implementation/imconv.h superpixels/felzenszwalb/felzenszwalbsegmentation.h superpixels/felzenszwalb/felzenszwalbsegmentation.cpp superpixels/normal_image.h superpixels/commands/commandfelzenszwalb.cpp superpixels/commands/patchesconfig.cpp superpixels/commands/patchesconfig.h superpixels/commands/commandfelzenszwalb.h superpixels/commands/felzenszwalbconfig.cpp superpixels/commands/felzenszwalbconfig.h superpixels/superpixel.h superpixels/superpixelsegmentation.h superpixels/patches/patchessegmentation.h superpixels/patches/patchessegmentation.cpp superpixels/normal_image.cpp superpixels/superpixelsegmentation.cpp rbase/illum.h rbase/illum.cpp rbase/color_space.h rbase/color_space.cpp rbase/img_read_config.h rbase/img_read.h rbase/img_read.cpp rbase/img_read_config.cpp rbase/color.cpp rbase/color.h )

add_executable( vole shell/main.cxx ${PROJECT_FILES} ) target_link_libraries(vole ${OpenCV_LIBS} ${Boost_LIBRARIES})

jtlz2 avatar Dec 12 '18 13:12 jtlz2

I have encountered the same problem. Have you solved it?

guopifen avatar Jun 10 '19 06:06 guopifen