News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

I need crtdll.inc or replacement

Started by Ran, March 13, 2007, 09:43:33 PM

Previous topic - Next topic

Ran

Hello,

I did find a masm32 project where crtdll.inc and crtdll.lib is needed.
I did search the Web but cannot find it.
I did find crtdll.lib!
So I think there must be a replacement(s) for this older? crtdll.inc.
But which one(s)?

Greetings,

Ran




Vortex

Hi Ran,

The attached zip file contains crtdll.lib and crtdll.inc

[attachment deleted by admin]

Ran

Hi Vortex,

It's is good to hear from You again.
I am not often on the board but everytime I am You get me out of trouble.

Thanks a lot,

Ran

Vortex

Hello Ran,

You are welcome. I am glad if I could be helpful.

Ran

Hello Vortex,

I have some info about the crtdll.inc and crt.lib You sent me.

When assembling I got the following errors:

- atol error A2111 conflicting parameter definition
               A2112 Proc and prototype calling conventions conflict
- isalpha     idem
- islower    idem
- isupper   idem
- div error syntax error PROTO
-fabs idem

But since I do not use this functions I deleted them from crtdll.inc

Linking the crtdll.lib gave me following problem:

fatal error LNK1115: / MACHINE option required

But on http://search.cpan.org/src/SREZIC/Tk-804.027_500/PNG/zlib/contrib/vstudio/readme.txt
I did find the link: http://www.winimage.com/zLibDll/crtdll.zip
where I could download another crtdll.lib and this one is much bigger = 499 Kb
Anyway this new crtdll.lib did disappear my LNK1115 error.
Now my program runs happely!  :U

This is just informative because I tought You have to know this problems with crtdll.

Best of greetings and thanks again,

Ran

MichaelW

If I try to combine crtdll.inc with masm32.inc and macros.asm, there are conflicts on lines:
320
337
339
341
342
345
354
359
360
364
368
378
383
387
454
Which are easy enough to get around, but even modifying the LINK command line I could not get around the:

LINK : fatal error LNK1115: /MACHINE option required

eschew obfuscation

Ran

Michael,

Did You try to replace Your crtdll.lib in masm32 with the one from:

http://www.winimage.com/zLibDll/crtdll.zip

This way I got rid of the "LINK : fatal error LNK1115: /MACHINE option required" error.

And try the crtdll.inc from Vortex above, it gives a lot less errors. (errors line 320-337-341-378-383-387)

Greetings,

Ran


Vortex

Hi Ran,

I am sorry for the trouble. To create the import library, I used Pelle's librarian Polib. For the include file, I used the lib2inc tool. I will analyze the import library you found.

MichaelW

Ran,

There is no crtdll.lib in the MASM32 package. The library that you linked appears to be a static library, judging from the size and the presence of object module names. I did not attempt to use it because I have no need and because it is from an unknown (to me) source. Is there some reason why you cannot just use the MASM32 msvcrt.lib and include file?
eschew obfuscation

Ran

Michael

Then I got a lot of unsupported symbols like
free
malloc
strlen
strcpy
strcat
_kbhit
_getch
_getche

Ran

MichaelW

For the MASM32 msvcrt.lib all of the function names have a "crt_" prefix. So the correct names are:

crt_free
crt_malloc
crt_strlen
crt_strcpy
crt_strcat
crt__kbhit
crt__getch
crt__getche
etc

The prefix was added to eliminate name conflicts with the MASM32 library and macros, and with some of the instruction mnemonics (div and fabs).
eschew obfuscation

Ran

OK, Thanks Michael,

It is perhaps better that I replace the crtdll with the msvcrt lib.
That's why I asked for "or replacement.
I'm not using masm a lot so I'm not at home with the masm libs.
I do like asm programming but I do need a purpose to use it.
I other words, if I have a project, I code.
And I am more into C.
My problem with asm is that I never found a good (simple) tutorial about the use of floating point math.
That's what's holding me back.

Greetings,

Ran 



MichaelW

The MASM32 package includes a FPU tutorial by Raymond Filiatreault that IMO is excellent. Look in masm32\tutorial\fputut.
eschew obfuscation

Vortex

Hello Ran,

Introducing the crt_ prefix, I modified crtdll.def to avoid those conflicts :

LIBRARY crtdll
EXPORTS
crt_HUGE_dll
crt__CIacos
crt__CIasin
crt__CIatan
.
.


After, I rebuilt crtdll.lib with the new symbols prefixed with crt_ in crtdll.def :

\masm32\bin\link -lib /OUT:crtdll.lib /DEF:crtdll.def /MACHINE:IX86
del crtdll.exp
rebuildlib crtdll.lib -l4


Attached contains a working example. The size of the final import library crtdll.lib is 340 Kb.

[attachment deleted by admin]

Ran

Thanks a lot Vortex,

I will put it to good use.

But Michael and Vortex, I have to ask You another question:

Using C run-time functions, is that done or not done in a masm environment if You think about speed ?
Are this functions optimised?
And if not done, do You make Your own functions or is there an existing database with optmised asm functions?

Just asking

Thanks a lot guys,

Ran