# Build on windows fails with "/" but works with "\" for /FI compiler option

Hello, I tried to build the most recent version of OpenCV under Windows using Visual Studio 10. Building of core fails with this message: cl : Command line error D8004: '/FI' requires an argument

If I replace the "/" (slash) to "\" (backslash) for the precompiled header file, the build works.

Is this known? How can I work around it?

Regards, Andreas

edit retag close merge delete

I have found a work around that I will post tomorrow as the forum does not allow me to answer my own question within 1 day.

( 2013-11-07 03:30:39 -0500 )edit

Sort by » oldest newest most voted

I found out how to work around this problem. The problem is that MS VC is usually able to cope with "/" but it seems to require an absolute path, i.e. a drive letter. One approach would be to somehow get CMAKE to use an absolute path when CMAKE_CURRENT_SOURCE_DIR is used, but I had not sufficient time to find a way to do this. Therefore, I reverted to the ugly hack of modifying the file

[..]\opencv-master\cmake\OpenCVModule.cmake


by changing line

ocv_add_precompiled_header_to_target(${the_target} "${CMAKE_CURRENT_SOURCE_DIR}/${pch_path}precomp.hpp")  to ocv_add_precompiled_header_to_target(${the_target} "C:/${CMAKE_CURRENT_SOURCE_DIR}/${pch_path}precomp.hpp")


Not nice, but it works.

Cheers, Andreas

more

This seems to be a problem when you are accessing source code on local network (shared folders) that start with "//". At least for me was that an issue and when copying source code to computer, it worked well.

more

Official site

GitHub

Wiki

Documentation