OpenCV link error

Sysprogs forums Forums VisualGDB OpenCV link error

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9113
    sette
    Participant

    Hi,

    I am currently following your tutorial for connecting a Raspberry Pi with a camera.

    http://visualgdb.com/tutorials/raspberry/camera/

    In step 21 I get an error though. The build output from Visual Studio 2015 community is given below:

    1>—— Build started: Project: OpenCv1, Configuration: Debug Win32 ——

    1>VisualGDB : warning : Cannot update the source file list in your Makefile: CMake source list updater: cannot find source list statement in CMakeLists.txt. Your may encounter strange build results.

    1> VisualGDB: Run “cmd.exe /c “C:\Program Files (x86)\Sysprogs\VisualGDB\make.exe”” in directory “C:\Users\A546491\Desktop\PI\Cam1\OpenCv1\..\..\..\..\..\..\PiCam\raspicam-0.1.3/Debug” on local computer

    1> [ 30%] Built target raspicam

    1> [ 34%] Linking CXX shared library libraspicam_cv.so

    1> C:/opencv-build/bin/Debug/opencv_videostab310d.dll: file not recognized: File format not recognized

    1>collect2.exe : error : ld returned 1 exit status

    1> make[2]: *** [src/libraspicam_cv.so] Error 1

    1> make[1]: *** [src/CMakeFiles/raspicam_cv.dir/all] Error 2

    1> make: *** [all] Error 2

    1> ————————————————————-

    1> Command exited with code 2

    1> Executable: cmd.exe

    1> Arguments: /c “C:\Program Files (x86)\Sysprogs\VisualGDB\make.exe”

    1> Directory: C:\Users\A546491\Desktop\PI\Cam1\OpenCv1\..\..\..\..\..\..\PiCam\raspicam-0.1.3/Debug

    1>VisualGDB : error : Command-line action failed

    1>EXEC : error : Build has failed. See the Output window for more details.

    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3073: The command “”C:\Program Files (x86)\Sysprogs\VisualGDB\VisualGDB.exe” /build “C:\Users\A546491\Desktop\PI\Cam1\OpenCv1\OpenCv1.vcxproj” “/solution:C:\Users\A546491\Desktop\PI\Cam1\Cam1.sln” “/config:Debug” “/platform:Win32″” exited with code 1.

    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

     

    Furthermore the screenshot in step 22 looks different from what I am seeing. The left panel in the tutorial says “Makefile settings” whereas mine is “CMake projects settings” and the options are somewhat different for the two.

    Can anyone please help me to solve the link error?

    Best regards

    Erik

    #9114
    support
    Keymaster

    Looks like the Raspicam library is picking up the Windows build of OpenCV.
    If you want to use it with OpenCV, please consider following this tutorial for build it for Raspberry Pi. If not, please edit the CMakeLists.txt of the raspicam library to remove references to OpenCV.

    The step 22 looks different because you have created your main project with CMake, not GNU Make. Both should work though, so it should not be a problem.

    #9116
    sette
    Participant

    Thank you for your answer.

    However, I get the same error when trying the tutorial you suggested. How can I set the directory for the Linux versions of the libraries? The contents of my CMakeLists.txt is attached below:

    cmake_minimum_required(VERSION 2.7)

    project(OpenCVDemo)

    find_package(OpenCV REQUIRED)

    ocv_include_directories(“${OpenCV_SOURCE_DIR}/include”)

    ocv_include_modules_recurse(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})

    set(LIBRARIES_FROM_REFERENCES “”)

    add_executable(OpenCVDemo OpenCVDemo.cpp)

    target_link_libraries(OpenCVDemo ${OpenCV_LIBS} “${LIBRARIES_FROM_REFERENCES}”)

    • This reply was modified 7 years, 7 months ago by sette.
    #9125
    support
    Keymaster

    Based on your build log, it looks like VisualGDB is not passing the toolchain definition to CMake. Normally the build command should look like this:

    1>  VisualGDB: Run "C:\Program Files (x86)\CMake\bin\cmake.exe -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_COLOR_MAKEFILE=OFF .. -DCMAKE_TOOLCHAIN_FILE=toolchain-Debug.cmake -DCMAKE_MAKE_PROGRAM="C:/SysGCC/raspberry/bin/make.exe"" in directory "c:\projects\LinuxProject8/Debug" on local computer

    Note the -DCMAKE_TOOLCHAIN_FILE part. Please try creating your VisualGDB project again and double-check that you select the correct cross-toolchain in the project wizard.

    #9150
    sette
    Participant

    I have changed computer to a one without the Windows version of the OpenCV libraries. Which resolved the previous issues. However, I get a new error now.

    What can be the problem now?

    VisualGDB: Run “C:\Program Files (x86)\CMake\bin\cmake.exe -DCMAKE_SYSTEM_PROCESSOR=armv8 -G “Unix Makefiles” -DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_COLOR_MAKEFILE=OFF .. -DCMAKE_TOOLCHAIN_FILE=toolchain-Debug.cmake -DCMAKE_MAKE_PROGRAM=”C:/SysGCC/raspberry/bin/make.exe”” in directory “C:\Users\Erik\Desktop\PI\RaspberryCameraTest\Raspicam\..\..\..\..\..\..\raspicam-0.1.3/Debug” on (unspecified)
    1>  CMake Error at CMakeLists.txt:110 (if):
    1>    if given arguments:
    1>
    1>      “MATCHES” “amd64*” “OR” “MATCHES” “x86_64*”
    1>
    1>    Unknown arguments specified

    #9152
    support
    Keymaster

    Hi,

    Looks like you forgot to specify the -DCMAKE_SYSTEM_PROCESSOR=armv71 as shown on step 18 of this tutorial. Explicitly specifying it in CMake command settings should solve the problem.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.