visual-c++

Can I include a .targets file in a .props property sheet?

孤人 提交于 2020-01-15 07:12:27
问题 I'm developing in C++ using Visual Studio 2012; I have about 25 projects in a solution that all use the same property sheet ( .props file). I now need every project that uses said props file to also use a specific .targets file. Instead of editing each of the 25 .vcxproj files to add an import tag (or adding the import via the GUI for each project), I'd like to put an import statement in the .props file they all already use. Is this even possible? I've tried adding the import statement that

IsWindows10OrGreater() is failing on Windows 10

泪湿孤枕 提交于 2020-01-14 17:37:06
问题 I wrote a piece of code to retrieve windows major and minor version using GetVersionEx function, but this function always returns major version 6 and minor version 2. MSDN is saying to use Version Helper APIs to find the current OS. I built the project in windows 8.1 and referred Windows 8.1 kits path to include VersionHelpers header file. There is no IsWindows10OrGreater() function available in VersionHelpers header file. So I downloaded VersionHelper header file from GitHub and added into

What does this MSVC++ compile error mean

别来无恙 提交于 2020-01-14 12:58:07
问题 I have this compile error that I dont understand what is wrong. My Microsoft Visual Studio project is a Win32 Project (not console): 1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16 1>C:\Users\Soribo\Desktop\C++ Programming\Visual C++ Programming\KeyboardHook\Release\KeyboardHook.exe : fatal error LNK1120: 1 unresolved externals EDIT: After making #include "stdafx.h" as the 1st line the compile error is: 1>MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved

VC++ stack trace does not resolve function names on production

瘦欲@ 提交于 2020-01-14 12:35:11
问题 I recently implemented stack trace logging using boost's new stacktrace library: int debugErrorCallback(int status, const char* func_name, const char* err_msg, const char* file_name, int line, void* userdata) { boost::stacktrace::stacktrace stacktrace(4, 10); //skipped 4 frames include cv::error, this function and 2 in boost::stacktrace ctor std::cout << boost::stacktrace::detail::to_string(stacktrace.as_vector().data(), stacktrace.size()) << std::endl; } Having tested it on my development

Understanding why an ASM fsqrt implementation is faster than the standard sqrt function

前提是你 提交于 2020-01-14 10:26:29
问题 I have playing around with basic math function implementations in C++ for academic purposes. Today, I benchmarked the following code for Square Root: inline float sqrt_new(float n) { __asm { fld n fsqrt } } I was surprised to see that it is consistently faster than the standard sqrt function (it takes around 85% of the execution time of the standard function). I don't quite get why and would love to better understand it. Below I show the full code I am using to profile (in Visual Studio 2015,

Visual studio c++ Link1104 cannot open file MSVCURTD.lib

一个人想着一个人 提交于 2020-01-14 10:16:07
问题 I have opened a project made with visual studio 2012 express (written in c++) with visual studio 2017 community, when I try to compile I get the following mistake: LINK1104 cannot open file MSVCURTD.lib (I don't have this mistake if I compile with vs 2012) I am not a c++ expert so I don't know how to solve this problem Thanks for your help... 回答1: I had the same problem and I was able to fix it as suggested by MGetz. This answer just adds more detail. Open the project's property pages, via

VC++ SSE code generation - is this a compiler bug?

房东的猫 提交于 2020-01-14 09:11:56
问题 A very particular code sequence in VC++ generated the following instruction (for Win32): unpcklpd xmm0,xmmword ptr [ebp-40h] 2 questions arise: (1) As far as I understand the intel manual, unpcklpd accepts as 2nd argument a 128-aligned memory address. If the address is relative to a stack frame alignment cannot be forced. Is this really a compiler bug? (2) Exceptions are thrown from at the execution of this instruction only when run from the debugger , and even then not always. Even attaching

“function already has a body”

你。 提交于 2020-01-14 09:11:15
问题 What does this mean? 1>c:\users\vitali\documents\visual studio 2010\projects\salam\tools.cpp(107): error C2084: function 'bool readXMLInteger(xmlNodePtr,const char *,int &)' already has a body 1>c:\users\vitali\documents\visual studio 2010\projects\salam\tools.h(52) : see previous definition of 'readXMLInteger' tools.cpp(107): bool readXMLInteger(xmlNodePtr node, const char* tag, int32_t& value) { char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag); if(nodeValue) { value = atoi(nodeValue

VC++ SSE code generation - is this a compiler bug?

不想你离开。 提交于 2020-01-14 09:10:33
问题 A very particular code sequence in VC++ generated the following instruction (for Win32): unpcklpd xmm0,xmmword ptr [ebp-40h] 2 questions arise: (1) As far as I understand the intel manual, unpcklpd accepts as 2nd argument a 128-aligned memory address. If the address is relative to a stack frame alignment cannot be forced. Is this really a compiler bug? (2) Exceptions are thrown from at the execution of this instruction only when run from the debugger , and even then not always. Even attaching

“function already has a body”

家住魔仙堡 提交于 2020-01-14 09:10:09
问题 What does this mean? 1>c:\users\vitali\documents\visual studio 2010\projects\salam\tools.cpp(107): error C2084: function 'bool readXMLInteger(xmlNodePtr,const char *,int &)' already has a body 1>c:\users\vitali\documents\visual studio 2010\projects\salam\tools.h(52) : see previous definition of 'readXMLInteger' tools.cpp(107): bool readXMLInteger(xmlNodePtr node, const char* tag, int32_t& value) { char* nodeValue = (char*)xmlGetProp(node, (xmlChar*)tag); if(nodeValue) { value = atoi(nodeValue