View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0013992 | CMake | (No Category) | public | 2013-03-08 17:14 | 2016-06-10 14:31 | ||||
Reporter | toby_toby_toby | ||||||||
Assigned To | Kitware Robot | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | moved | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake 2.8.10.2 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0013992: Source files with same name not building for VS 2010 | ||||||||
Description | Project has 2 files with the same name, but different directories. VS2010 project unbuildable in that case. | ||||||||
Steps To Reproduce | 1. configure and generate attached archive for VS2010 2. try build source.cpp - you should get this: badmake\subdirectory\source.cpp : fatal error C1083: Cannot open compiler generated file: 'project.dir\Debug\/subdirectory/source.cpp.obj': No such file or directory 3. now open generated vsproj in text editor and remove <ObjectFileName> from this: <ItemGroup> <ClCompile Include="..\badmake\source.cpp" > <ObjectFileName>$(IntDir)/source.cpp.obj</ObjectFileName> </ClCompile> <ClCompile Include="..\badmake\subdirectory\source.cpp" > <ObjectFileName>$(IntDir)/subdirectory/source.cpp.obj</ObjectFileName> </ClCompile> </ItemGroup> and you will get this <ClCompile Include="..\badmake\source.cpp" /> <ClCompile Include="..\badmake\subdirectory\source.cpp" /> 4. reload project is VS, it's buildable now! | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | ![]() ![]() ![]() | ||||||||
Relationships | |
Relationships |
Notes | |
(0032541) toby_toby_toby (reporter) 2013-03-08 17:23 |
Also found out that if I create folder 'subdirectory' in 'project.dir\Debug', then VS would build fine. |
(0032573) Brad King (manager) 2013-03-11 10:08 |
I cannot reproduce this with VS 10 (2010) or 11 (2012) professional versions. The source tree extracted from "badmake.zip" builds without error. What version are you using? |
(0032576) toby_toby_toby (reporter) 2013-03-11 11:35 edited on: 2013-03-11 11:38 |
badmake.zip is working, my bad. badmake2.zip IS BAD EXAMPLE ALSO, SORRY. I'm making new example. |
(0032577) Brad King (manager) 2013-03-11 11:56 |
With badmake2.zip I get: src\connection.cpp(1): fatal error C1083: Cannot open include file: 'common.hpp': No such file or directory which is not related. If I change common.hpp to connection.hpp in both .cpp files then it builds. |
(0032579) toby_toby_toby (reporter) 2013-03-11 12:10 |
Yes, error is unrelated. Real error was lost in precess =) Check out 3rd attempt. |
(0032580) Brad King (manager) 2013-03-11 12:36 |
Hmm. badmake3.zip also works for me. The build automatically creates the specified object output directory when needed. Do you have VS 10 Express or a commercial version? |
(0032581) toby_toby_toby (reporter) 2013-03-11 12:42 edited on: 2013-03-11 14:07 |
Express, installed 5 days ago. 10.0.30319.1 I will try different VS. Edit: It will take some time to install new virtual machine for that... Looks like problem in VS: http://stackoverflow.com/questions/3729515/visual-studio-2010-2008-cant-handle-source-files-with-identical-names-in-diff [^] Edit2: previous link just says that VS can't have files with same name, CMake solves this, but VS does not creates dirs for that... Strange. Edit3: I can't install VS 2012, because I have Windows XP, so I can't check that today, maybe next days... Workaround: rename source files, includes work OK. |
(0032619) Brad King (manager) 2013-03-13 20:40 |
badmake3.zip works for me in VS 2010 Express too. Microsoft Visual Studio 2010 Version 10.0.40219.1 SP1Rel Microsoft .NET Framework Version 4.5.50709 SP1Rel Installed Version: VC Express Microsoft Visual C++ 2010 01013-169-2610014-70153 Hotfix for Microsoft Visual C++ 2010 Express - ENU (KB2542054) KB2542054 Hotfix for Microsoft Visual C++ 2010 Express - ENU (KB2635973) KB2635973 Microsoft Visual C++ 2010 Express - ENU Service Pack 1 (KB983509) |
(0032627) toby_toby_toby (reporter) 2013-03-14 07:03 |
Hotfixes didn't help, BUT. Problem may be not in VS. I installed VirtualBox, made XP virtual machine (same distro), installed only VS2010 and cmake, no windows update or anything. Original badmake3\build errored: ------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug Win32 ------ The system cannot find the path specified. Checking Build System C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. ------ Rebuild All started: Project: project, Configuration: Debug Win32 ------ The system cannot find the path specified. Building Custom Rule C:/badmake3/src/project/CMakeLists.txt C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 3. ========== Rebuild All: 0 succeeded, 2 failed, 0 skipped ========== But if I regenerate inside virtual machine, then build succeded: ------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug Win32 ------ Checking Build System CMake does not need to re-run because C:/badmake3/build2/CMakeFiles/generate.stamp is up-to-date. CMake does not need to re-run because C:/badmake3/build2/project/CMakeFiles/generate.stamp is up-to-date. ------ Rebuild All started: Project: project, Configuration: Debug Win32 ------ Building Custom Rule C:/badmake3/src/project/CMakeLists.txt CMake does not need to re-run because C:\badmake3\build2\project\CMakeFiles\generate.stamp is up-to-date. source.cpp source.cpp project.vcxproj -> C:\badmake3\build2\project\Debug\project.lib ========== Rebuild All: 2 succeeded, 0 failed, 0 skipped ========== So, INSIDE virtual machine VS working good. On my non-virtual XP I have same system (2 weeks old), no windows updates also. No viruses, games, other versions of VS. Only MinGW, Python, Eclipse, CodeBlocks and drivers. 1) I will try to uninstall everything except VS, maybe some conflicts possible. 2) If it won't help, I will reinstall XP on another partition and will try clean VS. |
(0032628) toby_toby_toby (reporter) 2013-03-14 07:17 edited on: 2013-03-14 07:33 |
And another fun part, inside virtual machine (VM). Original 'badmake3\build' is not building, as I said in previous message, it happens if I rebuild 'project' or whole solution. But if I click on single file 'source.cpp', then I got original error: ------ Build started: Project: project, Configuration: Debug Win32 ------ source.cpp C:\badmake3\src\project\src\source.cpp : fatal error C1083: Cannot open compiler generated file: 'project.dir\Debug\/src/source.cpp.obj': No such file or directory ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== And there is no such problem in newly generated (inside VM) project: ------ Build started: Project: project, Configuration: Debug Win32 ------ source.cpp ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== I don't know, maybe it's normal for cmake that solution is not buildable if not generated on same PC. If you think this is strange - I can somehow send you image of this VM (it's 3Gig, but I can compress). If it's normal, then Brad please tell me, and I will continue with (1) and (2) from previous post. Edit: image compressed to 1Gig |
(0032629) toby_toby_toby (reporter) 2013-03-14 07:23 |
Also if you are not interested in VM image then I will try: 3) install windows/vs updates on virtual machine |
(0032630) Brad King (manager) 2013-03-14 10:07 |
Re 0013992:0032628: CMake generates build systems meant only for use in the exact same build and source trees on the exact same machine on which it generates them. |
(0032633) toby_toby_toby (reporter) 2013-03-14 17:03 edited on: 2013-03-14 17:03 |
Well, I will switch to another IDE/version... PS: I understand that cmake must generate only for same environment and that "cmd" not found is expected, but failed compilation of single file with C1083 in one project and successful compilation in other project on the same vm is strange, maybe later I will look at this. Thanks for help! |
(0032634) toby_toby_toby (reporter) 2013-03-15 06:31 |
Installed Windows 8 trial (downloaded from Microsoft, reformatted drive, all updates) and VS 2012 express, same error. Now I even don't have gcc, just clean PC. I think this is related to visual studio express.. I will try non-express VS trial.. |
(0032635) toby_toby_toby (reporter) 2013-03-15 08:07 edited on: 2013-03-15 08:08 |
I FOUND IT, ATLEAST IN WINDOWS 8 (and for sure everywhere else). Before single file becomes buildable, you need to click rebuild whole project, only this creates this directories. Oh my IQ, it's good that I'm not showing my real name |
(0042244) Kitware Robot (administrator) 2016-06-10 14:28 |
Resolving issue as `moved`. This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2013-03-08 17:14 | toby_toby_toby | New Issue | |
2013-03-08 17:14 | toby_toby_toby | File Added: badmake.zip | |
2013-03-08 17:23 | toby_toby_toby | Note Added: 0032541 | |
2013-03-11 10:08 | Brad King | Note Added: 0032573 | |
2013-03-11 11:34 | toby_toby_toby | File Added: badmake2.zip | |
2013-03-11 11:35 | toby_toby_toby | Note Added: 0032576 | |
2013-03-11 11:38 | toby_toby_toby | Note Edited: 0032576 | |
2013-03-11 11:38 | toby_toby_toby | Note Edited: 0032576 | |
2013-03-11 11:56 | Brad King | Note Added: 0032577 | |
2013-03-11 12:09 | toby_toby_toby | File Added: badmake3.zip | |
2013-03-11 12:10 | toby_toby_toby | Note Added: 0032579 | |
2013-03-11 12:36 | Brad King | Note Added: 0032580 | |
2013-03-11 12:42 | toby_toby_toby | Note Added: 0032581 | |
2013-03-11 12:43 | toby_toby_toby | Note Edited: 0032581 | |
2013-03-11 13:07 | toby_toby_toby | Note Edited: 0032581 | |
2013-03-11 13:10 | toby_toby_toby | Note Edited: 0032581 | |
2013-03-11 14:07 | toby_toby_toby | Note Edited: 0032581 | |
2013-03-13 20:40 | Brad King | Note Added: 0032619 | |
2013-03-14 07:03 | toby_toby_toby | Note Added: 0032627 | |
2013-03-14 07:17 | toby_toby_toby | Note Added: 0032628 | |
2013-03-14 07:23 | toby_toby_toby | Note Added: 0032629 | |
2013-03-14 07:33 | toby_toby_toby | Note Edited: 0032628 | |
2013-03-14 10:07 | Brad King | Note Added: 0032630 | |
2013-03-14 17:03 | toby_toby_toby | Note Added: 0032633 | |
2013-03-14 17:03 | toby_toby_toby | Note Edited: 0032633 | |
2013-03-15 06:31 | toby_toby_toby | Note Added: 0032634 | |
2013-03-15 08:07 | toby_toby_toby | Note Added: 0032635 | |
2013-03-15 08:08 | toby_toby_toby | Note Edited: 0032635 | |
2016-06-10 14:28 | Kitware Robot | Note Added: 0042244 | |
2016-06-10 14:28 | Kitware Robot | Status | new => resolved |
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved |
2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot |
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |