[cmake-developers] project file conflict;An ah-hah moment
J Decker
d3ck0r at gmail.com
Fri Apr 5 12:50:00 EDT 2013
for a while I've had an occasional issue something like....
LINK : fatal error LNK1104: cannot open file
'C:\general\build\vs10-x86\sack\debug_solution\video_link\Debug\video_link
_server.ilk'
[C:\general\build\vs10-x86\sack\debug_solution\video_link\video_link_server.vcxproj]
I usually get these on systems with bad virus detection software that holds
files open too long. This is a multiply-opened file.
I guess I can fix this by separating one of the projects into a
subdirectory which would change the name.
This is somewhat timing sensitive; and a second build always worked. The
initial build did not always fail.
Basically what I have is...
-------- Begin CMakeLists.txt ----------------
cmake_minimum_required(VERSION 2.8)
file( WRITE source.c "void f( void ){ printf( \"hello world\" ); }\n" )
file( APPEND source.c "void __stdcall WinMain( void*a,void*b,int c,int d ){
printf( \"hello world\" ); }" )
ADD_EXECUTABLE( video_link_server WIN32 source.c )
ADD_LIBRARY( video_link_server.isp SHARED source.c )
# commenting this out also makes it not happen; but should not affect the
incremental link file name...
SET_TARGET_PROPERTIES( video_link_server.isp PROPERTIES
SUFFIX ""
)
---------------- End ------------------------
Output
M:\tmp\cmake_crash\test5-overlapproject\build>cmake-gui ..
<click configure, generate>
M:\tmp\cmake_crash\test5-overlapproject\build>cmake --build .
Microsoft (R) Visual Studio Version 10.0.40219.1.
Copyright (C) Microsoft Corp. All rights reserved.
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32
------
1> Checking Build System
1> CMake does not need to re-run because
M:/tmp/cmake_crash/test5-overlapproject/build/CMakeFiles/generate.stamp is
up-
to-date.
2>------ Build started: Project: video_link_server, Configuration: Debug
Win32 ------
3>------ Build started: Project: video_link_server.isp, Configuration:
Debug Win32 ------
2> Building Custom Rule
M:/tmp/cmake_crash/test5-overlapproject/cmakelists.txt
2> CMake does not need to re-run because
M:\tmp\cmake_crash\test5-overlapproject\build\CMakeFiles\generate.stamp is
up-
to-date.
2> source.c
2>..\source.c(1): warning C4013: 'printf' undefined; assuming extern
returning int
3> Building Custom Rule
M:/tmp/cmake_crash/test5-overlapproject/cmakelists.txt
3> CMake does not need to re-run because
M:\tmp\cmake_crash\test5-overlapproject\build\CMakeFiles\generate.stamp is
up-
to-date.
3> source.c
3>..\source.c(1): warning C4013: 'printf' undefined; assuming extern
returning int
*
*
*3>LINK : fatal error LNK1104: cannot open file
'M:\tmp\cmake_crash\test5-overlapproject\build\Debug\video_link_server.il*k'
2> video_link_server.vcxproj ->
M:\tmp\cmake_crash\test5-overlapproject\build\Debug\video_link_server.exe
4>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32
------
4> Building Custom Rule
M:/tmp/cmake_crash/test5-overlapproject/cmakelists.txt
4> CMake does not need to re-run because
M:\tmp\cmake_crash\test5-overlapproject\build\CMakeFiles\generate.stamp is
up-
to-date.
4> Build all projects
========== Build: 3 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20130405/c780780f/attachment.html>
More information about the cmake-developers
mailing list