Ask Your Question

Revision history [back]

Can you check the contents of your samples/gpu folder and make sure there are no other files present whose name starts e.g. with "cascadeclassifier", other than "cascadeclassifier.cpp"?

The way targets for samples are built, first all .cpp files are listed, and their basenames are used for constructing executable's name (example_gpu_${sample}, where ${sample} is the basename). Then, the list of sources is obtained by globbing ${sample}.*, which means that the errors such as described above could be triggered by presence of, for example, cascadeclassifier.cpp.bak or some such.

As you mentioned, it might be possible to suppress those errors by adding

set_target_properties(${the_target} PROPERTIES LINKER_LANGUAGE CXX)

to OPENCV_DEFINE_CUDA_EXAMPLE() macro in samples/gpu/CMakeLists.txt (for example, after the add_executable()), but it will likely just result in errors during compilation due to invalid source files.