News:

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

not valid library

Started by fdig, January 31, 2006, 02:23:57 PM

Previous topic - Next topic

fdig

Hi,

i put a procedure to seperate asm file and want to use it as library.

i did a ml /c myprogramm.asm

then

ml /c library.asm

rename library.obj library.lib

But then linking both files together brings me this error:


C:\>link myprogramm.obj

Microsoft (R) Segmented Executable Linker  Version 5.31.009 J
Copyright (C) Microsoft Corp 1984-1992.  All rights reserved.

Run File [myprogramm.exe]: test.exe
List File [nul.map]: NUL
Libraries [.lib]: library
Definitions File [nul.def]:
LINK : fatal error L1104: library.lib : not valid library


What did i make wrong?

regards

P1

fdig,

Welcome A Board !!!     

Using 'Search' will help to learn more quickly by studying past answers.   Going through the Help files of QEditor in a great way to cover the basics.

Go into the m32lib directory of MASM32, in there is the MAKE.BAT batch file.

Study it for more techniques in using batch files to build/assemble your code.

Regards,  P1 

MusicalMike

Library files are surprisingly difficult to deal with. I just try to avoid situations where I have to generate them. I would much rather just distribute my source code along with a nice copyright notice. But you should probably know that .obj files are NOT the same file format as .lib files. Having a hefty amount of experience with PE files, you should know that when you compile code, information about what the binary file actually is is stored in the headers of the file. .lib files will contain information near the beginning of the file that says specifically that it is a static library, or a dll, or an executable image. When your linker looks at the renamed .obj file and fails to find that information you are going to get the error you are getting. If you want to compile something as a static library file, there are command line switches that you will use for that that will produce a proper PE .lib file. Hope this helps.