The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: SonnyC on June 24, 2007, 07:54:17 PM

Title: I can't link from assembled files !!!
Post by: SonnyC on June 24, 2007, 07:54:17 PM
Hello everybody !


I start playing with asm, ans I got a little problem :

I got few c files. I compile them with (for example):
    cl /c *.c
    cl *.obj
it works, well.

Now what I want, is compile this file, modify some asm instructions, and assemble and link.

I try :
    cl /FA /c *.c
    ml file1.asm file2.asm ...

and here I got "symbol already defined in a previous module" errors.

Why .obj from .asm are not the same of those compile directly with cl ?
Thanks for your help. I think I'll take lot of time reading this forum ;)

Note: This works with gcc:
    gcc -S *.c
    as *.s
    gcc *.obj


Title: Re: I can't link from assembled files !!!
Post by: drizz on June 25, 2007, 08:23:46 PM
Hello
Quote from: SonnyC on June 24, 2007, 07:54:17 PMand here I got "symbol already defined in a previous module" errors.
i think you'll have to put in some more switches.. like /coff for ml, /TC for cl,
it's hard to say without source.
Quote from: SonnyC on June 24, 2007, 07:54:17 PMWhy .obj from .asm are not the same of those compile directly with cl ?
i can think of a couple of reasons,
1) each puts its own trademark and id (@comp.id)
2) cl puts more debug information
3) maybe compiling to asm prevents cl from some global optimization...