crt

Should I link to the Visual Studio C runtime statically or dynamically?

僤鯓⒐⒋嵵緔 提交于 2019-12-17 08:30:57
问题 I have read arguments on both sides about whether one should link to the C runtime library statically or dynamically in Visual Studio projects, and I'm still not entirely sure what to think. My project pulls in some third-party libraries (Python, HDF5, Trilinos, and Microsoft MPI), each of which has to be built with the same runtime library as my final executable (otherwise they cannot be linked together). When linking statically, each of these libraries will contain a copy of the C runtime.

研究下vc++的abort函数

▼魔方 西西 提交于 2019-12-13 18:13:28
最近在调试几个问题时,发现跟abort函数有关,以前只是简单使用,现在却发现不简单,就多留意了下。 简介 abort中止当前进程并返回错误代码。异常终止一个进程。中止当前进程,返回一个错误代码。错误代码的 缺省值 是3。 代码 /*** *abort.c - abort a program by raising SIGABRT * * Copyright (c) Microsoft Corporation. All rights reserved. * *Purpose: * defines abort() - print a message and raise SIGABRT. * *******************************************************************************/ #include <cruntime.h> #include <stdlib.h> #include <internal.h> #include <awint.h> #include <rterr.h> #include <signal.h> #include <oscalls.h> #include <mtdll.h> #include <dbgint.h> #ifdef _DEBUG #define _INIT_ABORT

Passing of variable arguments in C

非 Y 不嫁゛ 提交于 2019-12-12 19:20:35
问题 Does anybody know how variable arguments are passed in classic C? I did some debugging today and most regular arguments are passed via stack. However it seems that this does not apply for variable arguments. Are those parameters stored somewhere else like constant strings? Thanks in advance! 回答1: They are very often passed on the stack. What you are looking for is ABI specifications for the platform you are using. For the AMD64 platform, have a look for example here. 回答2: It depends on the

MS Visual Studio 2012 ultimate doesn't start because of MSVCR110.dll

隐身守侯 提交于 2019-12-12 10:53:27
问题 When I try to run MVS 2012 I always get an error - entry point to procedure _crtCreateSymbolicLinkW was not found in library DLL MSVCR110.dll. I've already copied this dll file from my other computer where everything is working but it didn't help0_o. OS - windows 7. 回答1: Your best option at this point is to try and repair the Visual Studio Installation Control Panel Add / Remove Programs Select Visual Studio and choose "Repair" 回答2: The Microsoft Visual C++ Redistributable is missing on the

How to get RSA key from -----BEGIN CERTIFICATE--— from.crt and .pem file?

对着背影说爱祢 提交于 2019-12-12 09:49:41
问题 I'm having .crt and .pem file with -----BEGIN CERTIFICATE----- MIIFSDCCBDCg........................................ -----END CERTIFICATE----- and I want RSA key from this file. anyone is having any idea that how we can do that. I have used below command one by one openssl rsa -in XXX.crt -out input1.der -outform DER openssl rsa -in input1.der -inform DER -out key.pem -outform PEM But, It gives error: unable to load Private Key 140331982231200:error:0906D06C:PEM routines:PEM_read_bio:no start

Moving stack and reserving half of addressable space in Linux

此生再无相见时 提交于 2019-12-11 18:15:42
问题 For the implementation of a memory monitoring library, I would like to move the stack of the monitored program, and reserve the upper half of the virtual memory for use in the monitoring library, following the "half'n'half"-model describe used by tools such as TaintTrace, LIFT and Hobbes. However, it does not seem clear to me how to actually do this. Just mmaping the memory required fails (cannot allocate memory). Do I need to modify crt? The linker? 回答1: I'm not too sure how you would

C 可变参数函数的本质

邮差的信 提交于 2019-12-11 17:39:49
C语言支持定义可变参数的函数,方法是在函数的参数列表最后加上 " ... ",代表变长的参数列表,例如: void Func( int num, ...) { } 需要注意 “...” 必须在最后,而且前面 起码要有一个固定的参数 ,类型可以任意。 为什么要有一个固定的参数呢?这篇文章要说明的就是这个问题。 首先我们是如何调用变长参数列表里的变量? 需要使用 stdarg.h 里定义的三个宏: va_start(ap, x)、va_arg(ap,t)、va_end(ap) ,还有一个v a_list 类型(本质上是字节指针) 这几个宏的源代码: 1 typedef char * va_list; 2 3 #define _INTSIZEOF(n) ((sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1)) 4 5 #define __crt_va_start_a(ap, v) ((void)(ap = (va_list)_ADDRESSOF(v) + _INTSIZEOF(v))) 6 #define __crt_va_arg(ap, t) (*(t*)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t))) 7 #define __crt_va_end(ap) ((void)(ap = (va_list)0))

CRT types across process boundaries

不打扰是莪最后的温柔 提交于 2019-12-11 08:38:07
问题 I'm doing drag/drop out of an activeX control. On drag, I provide a CComQIPtr which has COM methods implemented to pass information to the drop target. On drop, the drop target's process calls my COM methods to get information. Am I not allowed to use CRT types or pointers to CRT types near that interface boundary? I would love for my IDataObject to have a private std::list and some std::strings, and on the foreign side of the interface be able to call my COM methods which can access those

Trouble w/ Haskell Implementation of Chinese Remainder Theorem

泄露秘密 提交于 2019-12-11 08:15:42
问题 So I am having a problem trying to implement the Chinese Remainder Theorem into Haskell. So far I have this: minv :: Integer -> Integer -> Integer minv a m = let (1, x, _) = extGCD a m in x `mod` m crt :: [Integer] -> [Integer] -> Integer crt as ms = let prod = product ms big_m = [div prod i| i <- ms] in (zip as ms (\(ai,mi)) ((ai * big_m * (minv mi big_m)) `mod` prod)) Okay so I know the minv function works (I've tested it multiple times), but I can't get the crt function to work. So here is

Unresolved ___stdio_common_vsprintf_s, what library has this?

让人想犯罪 __ 提交于 2019-12-11 03:58:46
问题 I'm using VS2015 Community. I have obtained some C code that I'm trying to build. It is all in C and I have made a project as a Console Application. When I build I get the below errors. The problem is that __stdio_common_vsprintf_s cannot be found during the link process. So I searched the internet for the symbols but don't get any useful information. I am using the Runtime Library setting called Multi-threaded (/MT). I have tried adding #define STDC_WANT_LIB_EXT1 1 before all includes but