For some reason, when I go to build my Pi Generator, everything assembls correctly, but my linker spits out this message:

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

/SUBSYSTEM:CONSOLE /RELEASE /VERSION:4.0 "/LIBPATH:C:\masm32\lib" "C:\Documents and Settings\***\Desktop\asm\WinAsm\Generate PI\pi-gen.obj" "/OUT:C:\Documents and Settings\***\Desktop\asm\WinAsm\Generate PI\pi-gen.exe"
pi-gen.obj : error LNK2001: unresolved external symbol _Factorial@8
pi-gen.obj : error LNK2001: unresolved external symbol _DoubleFactorial@8
C:\Documents and Settings\***\Desktop\asm\WinAsm\Generate PI\pi-gen.exe : fatal error LNK1120: 2 unresolved externals


I've declared my prototypes, and all my code is one one file, so I've really got no idea why this is happening.
Posted on 2006-07-02 05:34:55 by Bobbias
Where are you getting those two functions from? And are you including them correctly?
Posted on 2006-07-02 05:41:51 by JimmyClif
They are directly in the same same .asm file as my main code. They're not even supposed to be externals, lol.
If you want, I can upload the asm for you to look at.
Posted on 2006-07-02 05:45:00 by Bobbias
Please do.
Posted on 2006-07-02 06:07:29 by JimmyClif
I'm honestly surprised at how easy this was to make, so I'm kinda annoyed that it won't link properly, lol.
Attachments:
Posted on 2006-07-02 06:35:47 by Bobbias
You have the line "end start" before the end of the code. Simply move that line right to the end.

A fair few other errors though - and you need a call to ExitProcess

Ossa
Posted on 2006-07-02 06:37:10 by Ossa
Don't forget to add the call to ExitProcess at the end. (Before Factorial)

Still you have errors which could be easily fixed by now:

Mem to Mem moves are not allowed. Like mov input,TEMP. For dwords use a macro called m2m for that purpose m2m dwordto, dwordfrom


m2m macro arg1,arg2
push arg2
pop arg1
endm


As you are using Real8's though you might have to fld fstp them.

To declare Local labels all you need to do is ZERO: not LOCAL ZERO:

Posted on 2006-07-02 06:55:36 by JimmyClif
Bobbias,
Usually unresolved external error messages (when everything is fine in the assembly) means you do not have a pointer to where the libraries are in your link command.?  For example,

\masm32\bin\link.exe /SUBSYSTEM:WINDOWS /LIBPATH:masm32\lib edit.obj

Note the part that is bold.
Paul
Posted on 2006-07-02 07:16:55 by PBrennick
Yeah, much of my problems I come across in my code are stupid like that, lol. I'm working on clearing all this up now, and I'm finding OllyDbg to be an AMAZING piece of software :P
Thanks for the help, it looks like I'll be spending some time getting to know OllyDbg better, since if I call my program directly from olly, I get a stack overflow when calling one of my functions. Looks like I'm gonna have a headache for a while :P
Posted on 2006-07-02 19:34:05 by Bobbias