msvcrt

list available platform toolsets

家住魔仙堡 提交于 2019-12-22 05:40:13
问题 Is there any method to list platform toolsets available in VS2012? I mean a list that might contain v90, v100, v110, v110_xp and any externally provided platform toolset. Alternatively (should that be easier): is there a way to check if given platform toolset is installed or not? 回答1: Here is a console app utility (in C#) that dumps the list of toolset (for each available configuration). You need to add a reference to Microsoft.Build to be able to compile. Note the proper list of toolset is

How can fopen_s be more safe than fopen?

痞子三分冷 提交于 2019-12-22 01:40:58
问题 I'm working on legacy code for Windows platform. When I compile the code in VS2013 , it give following warning: error C4996: ' fopen ': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details." And it will also give samiliar warning for sprintf . I understand sprintf_s is more safe than sprintf because of buffer overflow. But how can be fopen_s be more safe than fopen , there is no chance of

Statically linking against library built with different version of C Runtime Library, ok or bad?

安稳与你 提交于 2019-12-21 09:19:00
问题 Consider this scenario: An application links to 3rd party library A. A is built using MSVC 2008 and is statically linking (ie. built with /MT) to the C Runtime Library v9.0. The application is built using MSVC 2005 and is statically linking to A and (using /MT) to the C Runtime Library v8.0. I can see trouble with this - for instance if types are changed in the headers between runtime library versions. Is care taken to keep the runtime library headers compatible between versions, or should

Statically linking against library built with different version of C Runtime Library, ok or bad?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 09:18:15
问题 Consider this scenario: An application links to 3rd party library A. A is built using MSVC 2008 and is statically linking (ie. built with /MT) to the C Runtime Library v9.0. The application is built using MSVC 2005 and is statically linking to A and (using /MT) to the C Runtime Library v8.0. I can see trouble with this - for instance if types are changed in the headers between runtime library versions. Is care taken to keep the runtime library headers compatible between versions, or should

Simple Assembly program on visual studio 2017

余生颓废 提交于 2019-12-21 05:39:07
问题 .386 .model flat, c .stack 100h printf PROTO arg1:Ptr Byte .data msg1 byte "Hello World!", 0Ah, 0 .code main proc INVOKE printf, ADDR msg1 ret main endp end main Hi, I am getting the below errors: I searched around and found someone said that it can be fixed by linking the microsoft runtime library Can anyone teach me how can I exactly fix it? Thanks Severity Code Description Project File Line Suppression State Error LNK2019 unresolved external symbol _printf referenced in function _main

Runtime Library mis-matches and VC++ - Oh, the misery!

孤街浪徒 提交于 2019-12-20 12:25:02
问题 It seems that all my adult life I've been tormented by the VC++ linker complaining or balking because various libraries do not agree on which version of the Runtime library to use. I'm never in the mood to master that dismal subject. So I just try to mess with it until it works. The error messages are never useful. Neither is the Microsoft documentation on the subject - not to me at least. Sometimes it does not find functions - because the name-mangling is not what was expected? Sometimes it

How to get location of needed runtime libraries for msvc

只愿长相守 提交于 2019-12-20 07:26:45
问题 I have custom wrapper over CMake, which perform configuring, compilation, and creating distrib for various platforms (win32, SunOS and so on) and different compilers. I need to put into distrib all needed runtime libraries (libgcc_s.so, libstdc++.so for *nix like OS. msvcr90.dll, msvcp100.dll for win32). For example, gcc has mechanism, which allows to get full names of these libraries: # get location of libgcc_s of default compiler bash-3.2$ g++ -print-file-name=libgcc_s.so /usr/local/lib/gcc

What's the name of the “create hard link” function in MSVCRT?

大城市里の小女人 提交于 2019-12-20 04:38:29
问题 To fix a bug in this answer: What's the correct name of the function to create a hard link in MSVCRT? 回答1: Oddly enough, there's a function called CreateHardLink. But it doesn't live in MSVCRT; it's part of Kernel32. 来源: https://stackoverflow.com/questions/6015006/whats-the-name-of-the-create-hard-link-function-in-msvcrt

Is there a fundamental difference between malloc and HeapAlloc (aside from the portability)?

十年热恋 提交于 2019-12-19 02:27:13
问题 I'm having code that, for various reasons, I'm trying to port from the C runtime to one that uses the Windows Heap API. I've encountered a problem: If I redirect the malloc / calloc / realloc / free calls to HeapAlloc / HeapReAlloc / HeapFree (with GetProcessHeap for the handle), the memory seems to be allocated correctly (no bad pointer returned, and no exceptions thrown), but the library I'm porting says "failed to allocate memory" for some reason. I've tried this both with the Microsoft

Why does my application require Visual C++ Redistributable package

可紊 提交于 2019-12-18 10:12:19
问题 I'm writing a simple C++ application in Visual Studio. It also has a setup project. It works well on my development machine, but when I'm installing this application on user's machine it requires Visual C++ Redistributable Package . I'm wondering why does my application require C++ Redistributable ? Standard C++ runtime library is shipped with Windows, isn't it? 回答1: The only version of the C runtime library which is shipped by Microsoft with most of 32 bit Windows versions is msvcrt.dll .