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
2
votes
0 answers

How can I make Keil RealView ARM MDK (for Cortex-M3) work with BOTH retargeting(to USART) and STL?

I've been searching for a workaround for days. So far no luck. What I use: STM32F103VET6 J-Link RealView MDK-ARM v4.12 Both C and C++ code in my program Before I included STL in my code, everything works fine. I can retarget printf() and scanf()…
smilekzs
  • 21
  • 4
2
votes
1 answer

get LCID from string

How to get LCID from string like "en-US"? I know about GetLocaleInfoEx function, but it doesn't work on windows XP. Can I get LCID from CRT locale? UPD: Can I convert between LCID and CRT locale (created by _create_locale function)? CRT locale may…
velimir
  • 129
  • 11
2
votes
0 answers

Error installing vc90 runtime on Windows Sandbox

When I try to install vc90 on Windows Sandbox I get the following error: Product: Microsoft Visual C++ 2008 Redistributable - x64 9.0.30729.6161 -- Error 1935.An error occurred during the installation of assembly…
GeorgeGF
  • 21
  • 2
2
votes
2 answers

C to ASM increment causes Segfault

I have the following C program: #include int main() { int i = 0; int N = 10; while(i < N) { printf("counting to %d: %d", N, i); //i = i + 1; } return 0; } I would like to compile this first to…
Him
  • 5,257
  • 3
  • 26
  • 83
2
votes
0 answers

Under VS2019, CRT call the function main() with 3 auguments, why doesn't the Complier report error "incorrect number of parameters"?

In the file exe_common.inl, crt call main function like this: static int __cdecl invoke_main() { return main(__argc, __argv, _get_initial_narrow_environment()); } However, if I call main in my program with three auguments, C2660…
2
votes
1 answer

Inno Setup program doesn't work because of .crt file, but works in source directory

I'm trying to create an installer for my own C++ program compiled with cygwin, if executed from the source directory the program runs perfectly, but if I try executing it from the installation directory created by Inno Setup it won't work. I have…
eNkkk
  • 31
  • 4
2
votes
0 answers

how to link crtbegin.o and crtend.o to my 32-bit OS with clang

Lately I've been toying around with making an x86 OS, and decided to convert it from using a GCC cross compiler to using clang. Specifically, I made the Makefile use clang -target i386-pc-none and -m32. After some fighting, I finally managed to make…
2
votes
1 answer

MT and MD on Linux

I'm curious why there is so much about MT and MD on Windows and no-one is talking about linux. In linux, afaik, there is the libc.so as the MD equivalent, and the libc.a as the MT equivalent. Since there is the possibility to link the c runtime…
Jakub D.
  • 95
  • 5
2
votes
1 answer

Upgrading to Universal CRT-how can I get rid of a dependency on vcruntime140.dll and msvcp140.dll?

I have a project that I'm trying to get updated to the universal CRT, and I'm still seeing a dependency on vcruntime140.dll and msvcp140.dll, which I think should have been replaced with a ucrtbase.dll, as well as api-ms-win-crt* dlls. I've…
Chris Bardon
  • 430
  • 4
  • 13
2
votes
3 answers

suppress or intercept CRT checks from instances of CRT from other dlls

My program loads several dlls and calls their functions. The dlls can use different versions of CRT. When C runtime checks the validity of arguments and finds problems, it calls the invalid parameter handle, which in turn, closes the application,…
andi
  • 912
  • 1
  • 10
  • 25
2
votes
0 answers

How to run hello world program with vala and tcc vapi

vala code using TCC; void main (string[] args) { State s = new State (); // s.add_include_path ("/usr/lib/tcc/include"); // s.add_include_path ("/usr/include/"); // s.set_lib_path ("/usr/lib/tcc"); s.compile_string (""" …
gavr
  • 807
  • 7
  • 16
2
votes
2 answers

How exactly _fsopen() works?

How exactly _fsopen() works? Does Linux also has similar way of opening files which prepares the file for subsequent shared reading or writing based on shflag? Referred article here.
user1174114
  • 178
  • 1
  • 19
2
votes
4 answers

Passing of variable arguments in C

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…
Florian Greinacher
  • 14,478
  • 1
  • 35
  • 53
2
votes
1 answer

Get a FILE* handle to be passed to a C function for System.IO.File and default streams

I'm using an old C library (built as a DLL) within my C# application. One of the functions in this library requires a FILE* (as defined in ANSI C) to be passed. Is there any way I can get a FILE* handle, in C#, for a System.IO.File, stdout and…
gd1
  • 11,300
  • 7
  • 49
  • 88
2
votes
2 answers

Consistency of two C FILE* streams on a single file

I need to implement a simple "spill to disk" layer for large volume of data coming off a network socket. I was hoping to have two C FILE* streams, one used by a background thread writing to the file, one used by a front end thread reading it. The…
Brad Robinson
  • 44,114
  • 19
  • 59
  • 88