News:

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

StaticLib Problem

Started by ecube, June 29, 2010, 02:56:25 AM

Previous topic - Next topic

ecube

having trouble using a static link library I created with Goasm using both link and polib. masm says the function isn't define or something heres the code

#DEFINE LINKFILES
#include "\GoAsm\include\windows.h"
CODE SECTION
START:
EXPORT myfunc FRAME a1
LOCAL retval:D
invoke ExitProcess,0
ret
ENDF


compile with either

set INCLUDE=C:\GoAsm\include
\GoAsm\bin\GoAsm /x86 mylib.asm
\MASM32\BIN\link -lib /LIBPATH:\masm32\lib mylib.obj
pause


or


set INCLUDE=C:\GoAsm\include
\GoAsm\bin\GoAsm /x86 mylib.asm
\GoAsm\bin\polib /MACHINE:x86 /OUT:mylib.lib /VERBOSE mylib.obj
pause


masm when I try and use the func, and yeah I includelib mylib.lib and did myfunc proto :DWORD

Microsoft (R) Incremental Linker Version 5.12.8078
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

test.obj : error LNK2001: unresolved external symbol _myfunc@4
test.exe : fatal error LNK1120: 1 unresolved externals

Vortex

Hi E^Cube,

I guess your Masm source contains the line :

.model flat,stdcall

instructing the assembler to expect decorated symbols.

Did you try the /ms switch decorating the functions for the linkers Link.exe \ Polink.exe ?

\goasm\goasm /ms /x86 mylib.asm

ecube

Thanks Vortex, using that switch+removing the "export" word made it work, goodjob  :U