Greetings! Where in the MASM32 IDE can I set a link list? For example, let's say I write a program that is going to use C's printf function. I need to link to msvcrt.lib, but I can find no place in the IDE to tell the linker where msvcrt.lib is.
Thanks!
~todd
Hello
Write in your code where your includes example
include windows.inc
..
.
Write:
include msvcrt..inc
includelib msvcrt.lib
Greets,
Console assemble & link:
include \masm32\include\masm32rt.inc
.code
start:
printf("The number is %f\n", FP8(1234.5678))
invoke crt_printf, cfm$("The number is %f\n"), FP8(1234.5678)
invoke crt_printf, chr$("The number is %f", 13, 10), FP8(1234.5678)
exit
end start
Option #1 is a macro,
#2 uses the crt_ prefix to identify a C RunTime function, and uses the cfm$() macro to produce a C-formatted string
#3 uses the crt_ prefix and a standard chr$() macro with Cr, Lf
Open \masm32\include\masm32rt.inc in Notepad, and you will understand why this works.
Great!
But I still need to know how to add something to the link list. Is there a setting in the IDE?
Thanks!
Normally, there is no need to add something: the linker "sees" the includelib \..*.lib statements
If you need to link other object modules, you need to write your own batch file for use with qEditor.exe; if you need it often, you can add it to the menus, see \Masm32\menus.ini
I use RichMasm (http://masm32.com/board/index.php?topic=5314.0) for all my coding; if I insert this line somewhere in the source, the linker will get it:
; OPT_DebugL some.obj /Largeaddressaware
include \masm32\include\masm32rt.inc
.code
start:
printf("The number is %f\n", FP8(1234.5678))
exit
end start
OPT_DebugL some.obj
Okay, I get it now - it's all done by include and includelib statements. Or, if I have one or more obj files to link, then create a batch file.
Thanks to all who posted!!
~todd
todd,
There is another option that is worth learning, if you have a number of object modules, you can place them in a library then just call the library instead of linking each one on the link command line. Just another way to build exe/dll code that is useful.