Pelles C forum

Pelles C => Feature requests => Topic started by: TimoVJL on April 04, 2025, 10:53:17 AM

Title: OS msvcrt.lib for poasm
Post by: TimoVJL on April 04, 2025, 10:53:17 AM
Would be nice to have msvcrt.lib(s) for poasm examples
For example like from Windows 7
(Windows XP had also x64 version)
Title: Re: OS msvcrt.lib for poasm
Post by: Vortex on April 04, 2025, 01:40:09 PM
Hi Timo,

Good idea. It's possible to write a simple batch file to create the import libraries :

\PellesC\bin\polib.exe /OUT:msvcrt.lib /MACHINE:X86 C:\Windows\SysWOW64\msvcrt.dll

\PellesC\bin\polib.exe /OUT:msvcrt64.lib /MACHINE:X64 C:\Windows\System32\msvcrt.dll
Title: Re: OS msvcrt.lib for poasm
Post by: TimoVJL on April 04, 2025, 02:23:25 PM
I mean a cleanup version from C++ junk.
Also just a basic version, so everyone can test poasm examples just using it.
A printf is one of those functions, that are useful for testing code, how it works.
I just want to have a situation, that we don't have to read people to whine, as msvcrt.lib isn't in their system.
Title: Re: OS msvcrt.lib for poasm
Post by: Vortex on April 08, 2025, 09:40:35 PM
Hi Timo,

After retrieving the functions exported by msvcrt.dll :

LIBRARY msvcrt
EXPORTS
"??0__non_rtti_object@@QEAA@AEBV0@@Z"
"??0__non_rtti_object@@QEAA@PEBD@Z"
"??0bad_cast@@AAE@PBQBD@Z"
"??0bad_cast@@AEAA@PEBQEBD@Z"
"??0bad_cast@@QAE@ABQBD@Z"
"??0bad_cast@@QEAA@AEBQEBD@Z"
"??0bad_cast@@QEAA@AEBV0@@Z"
"??0bad_cast@@QEAA@PEBD@Z"
"??0bad_typeid@@QEAA@AEBV0@@Z"
"??0bad_typeid@@QEAA@PEBD@Z"
"??0exception@@QEAA@AEBQEBD@Z"
"??0exception@@QEAA@AEBQEBDH@Z"
"??0exception@@QEAA@AEBV0@@Z"
"??0exception@@QEAA@XZ"
"??1__non_rtti_object@@UEAA@XZ"
"??1bad_cast@@UEAA@XZ"
"??1bad_typeid@@UEAA@XZ"
.
.

We can remove the unnecessary entries ( cleanup version from C++ ) and rebuild the import library.
Title: Re: OS msvcrt.lib for poasm
Post by: TimoVJL on April 08, 2025, 10:52:57 PM
Here is msvcrt.libs from Windows 7 as example
Don't do those commands in same folder
polib -machine:x86 -def:msvcrt.def -out:msvcrt.lib
polib -machine:x64 -def:msvcrt.def -out:msvcrt.lib