Author Topic: MinGW, LCC, VC++ assembling and linking.  (Read 17412 times)

nobody

  • Guest
MinGW, LCC, VC++ assembling and linking.
« on: November 21, 2004, 05:56:09 PM »
I need to know the isues for assemble and link with those C libraries.

For nasm:
What output switch I use fo each one?
Do I need import names of functions?

For the linking time:
Do I need a specific name for entry point?
I can use the make of the specific tool?
Some of this is like gcc that call the linker if you dont use the c flag, but the entry point is diferent name?
I need more to know?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: MinGW, LCC, VC++ assembling and linking.
« Reply #1 on: November 22, 2004, 09:36:50 PM »
I don't use any of those tools, but I think you'd want "-f win32" for all of them. Nasm's "import" directive is "-f obj"-only, I think. I guess you "don't need it" in "-f win32"(?).

I think you would need to specify the entry-point name to the linker, if you call the linker directly. I think "winmain" is "traditional"(?), but can be anything(?).

If you're using gcc to invoke the linker - no actual .c file involved - you'll be linking against the C "startup" code, which will want to call "main"... "_main", actually - all global or extern variables get "_" prepended to 'em.

You might get some help by looking at the examples in the doc, and/or in the "test" directory, if you've got the source.

Best,
Frank

nobody

  • Guest
Re: MinGW, LCC, VC++ assembling and linking.
« Reply #2 on: November 23, 2004, 01:42:41 PM »
Thanks, I will try them, and put the results.