visual-c++-2010

The g++'s -g option equivalent to VS2010 cl compiler?

一个人想着一个人 提交于 2019-11-27 01:12:54
问题 With g++ with -g option, I can use gdb for debugging purposes. What's the equivalent to this option with Visual Studio 2010 cl.exe compiler? This page has different libraries (debug/release) for linking. If I compile with debugging option with cl.exe, do I have to use the corresponding library linking options (/MD/MT vs /MDd/MTd)? 回答1: There are a few separate pieces to this question: how to tell the compiler/linker to generate and preserve "debug information" (mapping between source code and

Visual Studio Express 2010 license

若如初见. 提交于 2019-11-26 23:05:57
问题 Can I use Visual C++ 2010 Express compiler for commercial use? As far as I know, it was always permitted prior to 2010 version, but now when I start IDE, it writes "For Evaluation Purposes Only". I can't find the full license file anywhere (not in installed files, not in Google), so I'm in doubt, should I use it, or should I downgrade to MSVC++2008 version. 回答1: I think you just need to register it. In the help menu click on register product. It will bring you on a web page where you can log

Embed assembler to manipulate 64-bit registers in portable C++

♀尐吖头ヾ 提交于 2019-11-26 21:56:39
问题 I have a simple (but performance critical) algorithm in C (embedded in C++) to manipulate a data buffer... the algorithm 'naturally' uses 64-bit big-endian register values - and I'd like to optimise this using assembler to gain direct access to the carry flag and BSWAP and, hence, avoid having to manipulate the 64-bit values one byte at a time. I want the solution to be portable between OS/Compilers - minimally supporting GNU g++ and Visual C++ - and between Linux and Windows respectively.

Cannot convert parameter from 'const char[20]' to 'LPCWSTR'

谁都会走 提交于 2019-11-26 21:06:56
When compiling this code: #include <windows.h> int WINAPI WinMain(HINSTANCE hInsance,HINSTANCE hPrevInstance,PSTR cmdLine,int showCmd){ MessageBox(0,"First Win32 Program","Window Tittle",MB_OK); } I get the compiler error: Error C2664: 'MessageBoxW': cannot convert parameter 2 from 'const char [20]' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast What am I doing wrong? You have UNICODE defined, so MessageBox is expecting a wide string. By default UNICODE is defined in Visual Studio 2010. Either call MessageBoxA instead

Error when installing windows SDK 7.1

隐身守侯 提交于 2019-11-26 19:13:30
问题 I've run into an error when installing the Windows SDK that I've seen posted around the Internet, but none of the solutions are working for me. Here is the log I'm getting 9:43:37 AM Monday, October 14, 2013: SFX C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\SFX\vcredist_x64.exe installation started with log file C:\Users\clarkbd\AppData\Local\Temp\Microsoft Windows SDK for Windows 7_c3c42538-8a3e-439d-be39-aee3078ca098_SFX.log 9:43:43 AM Monday, October 14, 2013: C:\Program Files

Visual Studio 2010's strange “warning LNK4042”

吃可爱长大的小学妹 提交于 2019-11-26 18:24:33
I've just been beaten (rather hardly) on the head by some non-trivial warning from Visual Studio 2010 (C++). The compilation gave the following output: 1 Debug\is.obj : warning LNK4042: object specified more than once; extras ignored 1 Debug\make.obj : warning LNK4042: object specified more than once; extras ignored 1 Debug\view.obj : warning LNK4042: object specified more than once; extras ignored 1 identity.obj : error LNK2019: unresolved external symbol void __cdecl test::identity::view(void) (?view@identity@test@@YAXXZ) referenced in function void __cdecl test::identity::identity(void) (

How do I fix warning MSB8012 in a static library project in Visual C++ 2010?

不想你离开。 提交于 2019-11-26 16:37:37
问题 I am trying to convert a static library from VC++2008 to VC++2010, and I get these warnings about TargetPath and TargetName. I have had a look into my configuration and I'm not sure how to make these go away. Is it serious or is it really just an ignorable warning, for a static library that I usually build once and rarely rebuild. I think it has something to do with the fact that the project is named itk32, but the debug version of the library is named itk32d.lib, and the old way that this is

How does switch compile in Visual C++ and how optimized and fast is it?

谁说我不能喝 提交于 2019-11-26 11:16:21
问题 As I found out that I can use only numerical values in C++\'s switch statements, I thought that there then must be some deeper difference between it and a bunch of if-else \'s. Therefore I asked myself: (How) does switch differ from if-elseif-elseif in terms of runtime speed, compile time optimization and general compilation? I\'m mainly speaking of MSVC here. 回答1: A switch is often compiled to a jump-table (one comparison to find out which code to run), or if that is not possible, the

Cannot convert parameter from &#39;const char[20]&#39; to &#39;LPCWSTR&#39;

﹥>﹥吖頭↗ 提交于 2019-11-26 07:49:16
问题 When compiling this code: #include <windows.h> int WINAPI WinMain(HINSTANCE hInsance,HINSTANCE hPrevInstance,PSTR cmdLine,int showCmd){ MessageBox(0,\"First Win32 Program\",\"Window Tittle\",MB_OK); } I get the compiler error: Error C2664: \'MessageBoxW\': cannot convert parameter 2 from \'const char [20]\' to \'LPCWSTR\' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast What am I doing wrong? 回答1: You have UNICODE defined, so

Visual Studio 2010&#39;s strange “warning LNK4042”

大城市里の小女人 提交于 2019-11-26 05:18:08
问题 I\'ve just been beaten (rather hardly) on the head by some non-trivial warning from Visual Studio 2010 (C++). The compilation gave the following output: 1 Debug\\is.obj : warning LNK4042: object specified more than once; extras ignored 1 Debug\\make.obj : warning LNK4042: object specified more than once; extras ignored 1 Debug\\view.obj : warning LNK4042: object specified more than once; extras ignored 1 identity.obj : error LNK2019: unresolved external symbol void __cdecl test::identity: