Author Topic: Win7 (x64) B5 Unable to Compile Single File (SHIFT+F10) in Visual Studio Project  (Read 1574 times)

Slow Learner

  • Junior Community Member
  • Posts: 7
  • Hero Points: 0
A Visual Studio solution (sln) file was created by CMake with many C++ files. The solution can be opened and built in Visual Studio under Windows 7 without any problems using F7.  The individual C++ files can also be compiled in Visual Studio using CTRL+F7.

Multiple Visual Studio versions are installed on this Windows Ultimate x64 machine (2010, 2012 and 2013). The solution file can be opened using Slicked Edit 2014 x64 Beta 5 without any problems. The solution can be built from within SlickEdit (using CTRL+M). SlickEdit selects the correct compiler version for the solution file in question (VS 2013, x64 compiler). Everything works fine.

However, the single-file compile appears to be broken. It is not possible to edit a file from the project and compile just that file.  For example, it is not possible to compile a single project C++ file by viewing the file in SlickEdit and using SHIFT+F10 to run the compile against the file.  SlickEdit appears to run through the motions. It creates a response file in the temporary directory which it then passes to the Microsoft msbuild application. However, msbuild never finds anything to do and ends without actually running the compiler. It appears that msbuild thinks that the target is up-to-date. However, in this instance the project has been cleaned and all the object files have been deleted so the target is definitely out-of-date. If the source file is altered to insert an intentional C++ syntax error, the compile will fail under Visual Studio if the file is compiled using CTRL+F7. However, if the same test is tried with SlickEdit, the file is never compiled although msbuild is called to do it. msbuild never appears to run the compiler in response to SHIFT+F10 but it does run and the compiler detects the manually inserted error in the C++ file if CTRL+M is used.

Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1217
  • Hero Points: 119
Can you post a sample solution and project generated by your tools?  A simple hello world should do fine, I will give it test to see if I can reproduce.

Slow Learner

  • Junior Community Member
  • Posts: 7
  • Hero Points: 0
The attached ZIP file contains three (3) Visual Studio Projects that were created by CMake. Each project contains one C++ file with the classic “Hello World!” message. The three projects are identical except that they were configured using CMake for three different Visual Studio versions as follows:

Test 1 - VS 2013 X64
Test 2 - VS 2012 X64
Test 3 - VS 2010 X32

The three projects were successfully compiled and linked under Visual Studio on a desktop machine that has all three versions of Visual Studio IDE Professional installed. The projects were built and cleaned. Then the single project source file was viewed in the IDE text editor and compiled without linking. When double-clicking on the three project files, the correct instance of the Visual Studio IDE was started in all cases. Behaviour is all normal under Visual Studio.

The three projects were then built using SlickEdit 2014 B5. The same sequence of commands was applied for each of the three projects.

1. From the Toolbar, Project | Open Other Workspace | Visual Studio .NET Solution ...
2. From the Toolbar, Build | Build
3. From the Toolbar, Build | Clean Solution
4. From Projects Window, highlight source file, right-click, Compile from context menu

For all three projects, the first two commands within SlickEdit worked fine. That is, the build and clean of the entire solution did as expected. However, the single-file-compile failed in two of the cases (Test 1 [VS 2013] and Test 2 [VS2012]). Test 3 [VS2010] compiled the single-file as expected with no errors. Test 1 failed as described in the first posting to this topic with no error indication. However, Test 2 failed with a hard error (source file not found ....).

LOG AND RESPONSE FILES:   
The ‘src’ directory contains the SlickEdit build window output for the three tests and the response file that SlickEdit used to call msbuild (copied from the temp directory).

SUMMARY:
VS2010: SlickEdit compiles single-files from project OK
VS2012: SlickEdit fails single-file-compile from project with “file not found” error
VS2013: SlickEdit Fails single-file-compile from project quietly with no error


Lee

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1217
  • Hero Points: 119
Thank you the sample and the details. I was able to reproduce exactly as you describe.  I will work on a workaround or fix for this in one of the next drops.