hello, my problem is:

I`m compiling minifmod in visual 2003, and then i trying to link minifmod.lib file with assebler code:

.model flat, stdcall
option casemap:none

include windows.inc
include kernel32.inc
include user32.inc

includelib kernel32.lib
includelib user32.lib
includelib winmm.lib
includelib minifmod.lib

;minifmod protos in cdecl style!
FMUSIC_LoadSong proto C :DWORD, :DWORD

xmfile db "music.xm",0


;some minifmod initialization functions

    invoke  FMUSIC_LoadSong, offset xmfile, NULL

    push    0
    call    ExitProcess

end start

now, minifmod require libc.lib and oldnames.lib, so i copyied them to my minifmod.asm directory, but when i want to link all togeter, there occurying link error:

LIBC.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
LIBC.lib(a_env.obj) : error LNK2001: unresolved external symbol __imp__GetEnvironmentStrings@0

with _main function is no probler, beucase i can define it in my source, but what is with __imp__GetEnvironmentStrings?? This function is situated in libc.lib, so why linker cant find it?

greets, and sory for my english:)) bye

  • You must to post comments

The best solution is to disable libc (nodefaultlib linker option) and place any standart C functions (string, FPU routines, etc.) inside your assembler code. Using libc will increase your exe size and link to MSVCRT. You don’t want things to happen that way, right? To make things easier, there’s already a full working example of minifmod + masm32 somewhere at hp://wasm.ru. Or visit hp://ufmod.sf.net to get a full set of FMOD usage examples in masm32, tasm, nasm, fasm and so on. Sorry for pointing to external resources.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.