Cmake Visual Studio 2013 error - visual-studio-2012

I am trying to run a simple program through cmake gui and I receive the following output. I am not really sure what the problem is and forgive me, because I am quite new to this. I have also uninstalled and installed visual studio 2012 and 2013 to see if that would make a difference. I am using Visual Studio 2013 as the compiler and get the following configuration error.
My environment is :
Windows 7 enterprise 64 bit
Cmake gui 2.8.12.2
Visual Studio 2013 Professional
The C compiler identification is MSVC 18.0.21005.1
The CXX compiler identification is MSVC 18.0.21005.1
Check for working C compiler using: Visual Studio 12
Check for working C compiler using: Visual Studio 12 -- broken
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/cl.exe" is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/PM&R/Desktop/CMakeFiles/CMakeTmp
Run Build Command:C:\PROGRA~2\MSBuild\12.0\Bin\MSBuild.exe
cmTryCompileExec3676669247.vcxproj /p:Configuration=Debug
/p:VisualStudioVersion=12.0
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.18444]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 3/31/2014 2:27:43 PM.
Project
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
on node 1 (default targets).
C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85):
error MSB4025: The project file could not be loaded. An error occurred
while parsing EntityName. Line 60, position 85.
Done Building Project
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
(default targets) -- FAILED.
Build FAILED.
"C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj"
(default target) (1) ->
C:\Users\PM&R\Desktop\CMakeFiles\CMakeTmp\cmTryCompileExec3676669247.vcxproj(60,85): error MSB4025: The project file could not be loaded. An error occurred while parsing EntityName. Line 60, position 85.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.02
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeOutput.log".
See also "C:/Users/PM&R/Desktop/CMakeFiles/CMakeError.log".

Try to generate build system in the folder C:/Tmp to test if the problem is related to corrupted cache or path issues. To build it to the folder stated in the question:
Check that you do have write permission in "PM&R" personal folders
Remove cmake cache when you change the generator

Related

Visual C++ 2017 link error due to -Ot flag?

I am trying to get a Visual Studio 2017 project to link, but I'm stuck on the following linker error:
LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
I've read questions on what the cause could be, but I couldn't come to a solution for my project.
The details are that, due to an external component we have no control over (component A), this Visual Studio 2017 project is forced to use the v14.13 version of the C++ toolchain, i.e. not the latest one (v14.14). However, the latest release of another external precompiled static lib we have no control over either (component B), is built with the v14.14 version (I checked via a dumpbin extract of the debug version of the lib). Switching my project over to the v14.14 toolchain indeed makes the link error go away on component B, but this unfortunately isn't a solution for me due to component A. Taking an earlier version of component B isn't desirable either, since we need the functionality in the latest release...
However, what strikes me, is that the /Ot ("optimize for speed") flag has been around since the middle ages... Why wouldn't v14.13 recognize it? Or is it just an (awkwardly manifested) matter of a mismatched obj file layout due to the version differences? And, probably related, what does the 'p2' stand for anyway?
Update
I've checked the linker output by using the /verbose flag, and all seems normal (3600 lines of Searching <lib>, Found <function>, Referenced in <obj> and Loaded <lib>).
Right up until the end that is, where I get the following 6 lines:
1> Searching C:\PathToExternalLib\TheirStatic.lib:
1> Found UsedFunctionName
1> Referenced in MyOwnStatic.lib(MyOwnCompileUnit.obj)
1>LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
1>LINK : fatal error LNK1257: code generation failed
1>Done building project "MyProject.vcxproj" -- FAILED.
And that's that.
When visiting the command line setting of the link properties of the project, the only thing listed is (broken up in separate lines for convenience):
/OUT:"MyProject.dll"
/MANIFEST
/NXCOMPAT
/PDB:"MyProject.pdb"
/DYNAMICBASE "C:\PathToMyStatic.lib"
/IMPLIB:"MyProject.lib"
/DLL
/MACHINE:X64
/PGD:"MyProject.pgd"
/MANIFESTUAC:"level='asInvoker' uiAccess='false'"
/ManifestFile:"MyProject.prm.intermediate.manifest"
/ERRORREPORT:PROMPT
/NOLOGO
/LIBPATH:"C:\PathToExternalStaticLib"
/LIBPATH:"C:\PathToAnotherExternalStaticLib"
/TLBID:1
So no trace of any -Ot flag there as well...?
I had this problem. LINK : fatal error C1007: unrecognized flag '-Ot' in 'p2'
while building a project with Visual Studio 2015.
I had to rebuild any library or sub library the project linked to which were built with Visual Studio 2017.
Once I rebuild the dependent libraries with Visual Studio 2015 the first project was able to link against them.
project
--------\
---------lib1(unable to rebuild lib1 until its dependencies were also rebuilt with VS2015
--------------\lib_linked_by_lib1_which_was_build_with_VS2017_and_had_to_be_rebuilt
--------------\another_lib_which_had_to_be_rebuilt_for_lib1_with_VS2015
--------\lib2
--------\lib3

Build message - Unknown compiler version, for dealii-4.8.1 library on visual studios

My build output gives many error messages of:
"Unknown compiler version - please run the configure tests and report the results"
...when attempting to build INSTALL for the dealii-8.4.1 library (open source, finite element library - graphics library) on Visual studios 14.0 (v 2015) c++.
A portion of the build is shown below.
Can anyone advise on what this means? and how to: "run the configure tests and report the results?" I Configured dealii-8.4.1 using cmake to start with.
Using deal.II on native Windows (dealii webpage and instructions)
https://github.com/dealii/dealii/wiki/Windows
PORTION OF BUILD OUTPUT on Visual Studios
44> vector_tools_point_value.cc
44> Unknown compiler version - please run the configure tests and report the results
44>C:\dealii-8.4.1\source\numerics\vector_tools_point_value.cc(22): fatal error C1083: Cannot open include file: 'vector_tools_point_value.inst': No such file or directory
44> vector_tools_point_gradient.cc
44> Unknown compiler version - please run the configure tests and report the results
44>C:\dealii-8.4.1\source\numerics\vector_tools_point_gradient.cc(22): fatal error C1083: Cannot open include file: 'vector_tools_point_gradient.inst': No such file or directory
44> vector_tools_project.cc
44> Unknown compiler version - please run the configure tests and report the results
44>C:\dealii-8.4.1\source\numerics\vector_tools_project.cc(22): fatal error C1083: Cannot open include file: 'vector_tools_project.inst': No such file or directory
44> vector_tools_rhs.cc
44> Unknown compiler version - please run the configure tests and report the results
44>C:\dealii-8.4.1\source\numerics\vector_tools_rhs.cc(83): fatal error C1083: Cannot open include file: 'vector_tools_rhs.inst': No such file or directory
The issue may be due to deal.II on native Windows, as for the windows version it states:
"Warning: please be aware that the following is experimental and you will likely encounter bugs in compilers and deal.II itself. Only continue if you are willing to experiment."
https://github.com/dealii/dealii/wiki/Windows
And: "deal.II is mostly developed on Linux using the GCC compiler."
http://www.dealii.org/8.4.1/readme.html
So it may be better to install Linux (Ubuntu) to see if that solves it.

Unable to build NDK project from latest Android Studio (version 2.1.2, Windows 64 bit)

I am unable to build a NDK project from the Android Studio environment but can build it manually using the command console.
I get the following error after building:
Error:Execution failed for task ':xxxxxx:compileReleaseNdk'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\xxxxx\AppData\Local\Android\SDK\android-sdk\ndk-bundle\ndk-build.cmd'' finished with non-zero exit value 2
I got a similar error while invoking ndk-build.cmd manually using the console from the jni directory where my NDK project is stored.However I fixed it by modifying the following in my Application.mk file as follows:
NDK_TOOLCHAIN_VERSION := 4.9
since 4.9 is the tool chain available on my install. I suspect from the Android Studio environment, the toolchain version is being picked incorrectly, and yet I do not know where to set this option in the GUI.
The build.gradle file has the following NDK block:
ndk{
moduleName "xxxxxx"
ldLibs "log"
cFlags "-std=c++11 -fexceptions"
stl "gnustl_static"
abiFilters "arm64-v8a armeabi armeabi-v7a mips mips64 x86 x86_64"
}
Please advise me on how to go about solving this problem.
Just out of curiosity, I moved my project directory to the desktop and tried to build that project. The build was successful.
Finally narrowed down the problem to the NDK compiler not being able to create the following intermediate object file inside my project folder:
C:\Users\xxxxx\GitRepos\REVIEWS\xxx\SMART-xxx\xxxx-xxx-androidnative\xxxLibraries\xxxlibrary\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/natXXXX/C_\Users\xxxxx\GitRepos\REVIEWS\xxx\SMART-xxxx\xxxx-xxx-androidnative\xxxLibraries\xxxlibrary\src\main\jni\NativeXXXX.o.d
The reason was the well known windows path cannot exceed 255 characters issue. As you can see above the NDK-Build utility tries to append a deep folder hierarchy like "C_\Users\xxxxx\GitRepos\REVIEWS\xxx\SMART-xxxx\xxxx-xxx-androidnative\xxxLibraries\xxxlibrary\src\main\jni\" which exceeds MAX_PATH.

Release Build Linker Failure

I just finished my project and tried building it in Release for the first time. I've had previous issues with the Windows 7 SDK and the Common7 stuff located in program files(ie they were missing and I had to install them from msdn).
The build is complaining :
1>LINK : fatal error C1350: error loading dll 'msobj110.dll': dll not found
1>Block.obj : fatal error LNK1000: unknown error at 00A14372; consult documentation for technical support options
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Yet I looked at :
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
I have the same folder under C:\Program Files..., and IDE is almost empty; doesn't have the ms libraries.
How can I know where Visual Studio picks these dll from? I'm using VS2012.

Install Shield LE - Error 6058 ... merging Visual C++ 10.0 CRT in 64bit

I'm trying to compile an install shield project. It's a 64 bit program.
I keep getting this error, although it does compile OK and installs OK:
Error 16 -6058: Error merging Visual C++ 10.0 CRT (IA64) with module ID C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm ISEXP : error : -6058: Error merging Visual C++ 10.0 CRT (IA64) with module ID C:\Program Files (x86)\Common Files\Merge Modules\Microsoft_VC100_CRT_ia64.msm
Any idea how can tell it NOT to try and merge ? (I can let it install the CRT ad a redistributable instead)
Ok, so it's like this:
Was detected as a dependency by mistake:
Adding merge module 'Visual C++ 10.0
CRT (IA64)' that is a dependency of
component
'MyProjectName.Primary_output'
So you go to:
Specify application Data -> Files
Right click on the specified project that had the dependency.
Choose Dependencies from scan at build.. find that unwanted file, and uncheck it.
Some Installshield products (2010, 2011 at least) appear to have an issue scanning managed (/clr) c++ modules that use the 10.0 CRT, even for 32-bit-only projects. In those cases the IA64 msm gets added to the project, producing "error -5008: Intel64 or AMD64 must be specified in the template of the Summary Stream". Yochai's fix cured that too. I have not seen this issue for native c++ code.

Resources