Questions tagged [crt]

For issues relating to utilizing the C runtime library.

The C runtime library is a special program library used by a compiler, to implement functions built into the C programming language, during the execution (runtime) of a computer program.

Not to be confused with CRT terminals.

364 questions
10
votes
3 answers

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

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…
tushark
  • 101
  • 1
  • 2
  • 5
10
votes
2 answers

Building Visual C++ app that doesn't use CRT functions still references some

This is part of a series of at least two closely related, but distinct questions. I hope I'm doing the right thing by asking them separately. I'm trying to get my Visual C++ 2008 app to work without the C Runtime Library. It's a Win32 GUI app…
Thomas
  • 174,939
  • 50
  • 355
  • 478
10
votes
6 answers

Does a memory leak at unload of a DLL cause a leak in the host process?

Consider this case: dll = LoadDLL() dll->do() ... void do() { char *a = malloc(1024); } ... UnloadDLL(dll); At this point, will the 1k allocated in the call to malloc() be available to the host process again? The DLL is statically linking to…
Viktor
  • 3,295
  • 2
  • 25
  • 26
9
votes
3 answers

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

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…
Viktor
  • 3,295
  • 2
  • 25
  • 26
8
votes
6 answers

How to execute some code before entering the main() routine in VC?

I am reading Microsoft's CRT source code, and I can come up with the following code, where the function __initstdio1 will be executed before main() routine. The question is, how to execute some code before entering the main() routine in VC (not VC++…
yinyueyouge
  • 3,684
  • 4
  • 25
  • 22
8
votes
4 answers

fscanf / fscanf_s difference in behaviour

I'm puzzled by the following difference in behaviour: // suppose myfile.txt contains a single line with the single character 's' errno_t res; FILE* fp; char cmd[81]; res = fopen_s(&fp, "D:\\myfile.txt", "rb" ); …
Ofek Shilon
  • 14,734
  • 5
  • 67
  • 101
8
votes
2 answers

Why does renaming reg.exe on Windows Server 2008 x64 causes it to fail to run?

I've got a neat question here. There's a utility called reg.exe thats been shipped with Windows for quite some time. Its very handy to import .reg files from scripts, modify values from scripts, etc, etc. So when making a copy of it for a script…
NoName
  • 125
  • 5
7
votes
2 answers

How fix Error of error of crt1.o,crti.o in Build TinyCCompiler(TCC) from Source?

How fix Error of crt1.o,crti.o in Build TinyCCompiler(TCC) from Source? https://github.com/LuaDist/tcc i'm test this at my Desktop system(ubuntu) and also test on server(centos). at both OS , show error. Error : tcc: file '/usr/lib/crt1.o' not…
C-Compiler
  • 71
  • 5
7
votes
1 answer

Unable to compile and link simple C++ program with Visual Studio 2015 command line tools

With Visual Studio 2015 I am no longer able to compile and link a simple C++ program using the command line tools. Consider main.cpp: #include int main() { return 0; } In previous releases (for example Visual Studio 2012) I was able to…
Ben Kircher
  • 152
  • 1
  • 7
7
votes
5 answers

What's the scenario to use the atexit function?

CRT function atexit() could register a function to run after main function returns. I am wondering what's the typical scenario to use this? Is it (atexit) really necessary?
Thomson
  • 20,586
  • 28
  • 90
  • 134
7
votes
3 answers

Correct way to distribute VC++ runtime files

I have an MFC application which I am trying to package for deployment. It seems to depend on the files 'msvcr90.dll', 'msvcp90.dll' and 'mfc90.dll'. What is the correct way to distribute these files? I can't use merge modules as my installer doesn't…
Hoppy
  • 720
  • 2
  • 12
  • 24
7
votes
4 answers

Linking error when building without CRT, memcpy and memset intrinsic functions

I'm trying to build an application as tiny as possible, and in doing so I'm trying to avoid use of the CRT by using Win API calls instead of standard C/C++ calls. Unfortunately, I'm still getting a single linker error: Error 2 error LNK2001:…
Knox
  • 1,150
  • 1
  • 14
  • 29
7
votes
1 answer

Unable to debug the CRT source files in Visual Studio 2013 debugger

I just installed Visual Studio 2013 and tried to create a "Hello World" console C++ app. I am trying to debug through the CRT source code but I am unable to do so. I notice that the source files are still installed in the Program Files \ Visual…
Raman Sharma
  • 4,551
  • 4
  • 34
  • 63
6
votes
4 answers

How can I resolve this link error in Visual Studio (LNK2005)?

I keep having linker errors of the following form: libcmtd.dll msvmrtd.dll some element(ex: _mkdir ) already defined... and I don't know how to resolve them. Here is a complete error message: private: __thiscall type_info::type_info(class…
Cute
  • 13,643
  • 36
  • 96
  • 112
6
votes
1 answer

usage of MSYS2 environments

I want to thoroughly understand the usage of environments from the MSYS2 platform. A partial description is available at: https://www.msys2.org/docs/environments/ Things I understand: MSYS environment it is used to build applications that will run…
user16533250
1 2
3
24 25