Computer Chess Club Archives


Search

Terms

Messages

Subject: [OT] Inlining Assembler in C - Linking Problems

Author: Steve Maughan

Date: 03:11:12 01/20/04


I have been having problems linking assembler routines into Monarch.  I'm using
Visual Studio .NET 2003.  The following routine runs with no problems:

int bsf(bitboard a)
{__asm
	{
		bsf eax, dword ptr[a + 4]
		add eax, 32
		bsf eax, dword ptr[a]
	}
}

No doubt many will recognize it as the classic "Bit Scan First" routine.
However if I add a '__forceinline' or '_inline' before the 'int' I get the
following errors when the program links (it generates code with no errors):

Linking...
board.obj : error LNK2019: unresolved external symbol _bsf referenced in
function _clear_board
checks.obj : error LNK2001: unresolved external symbol _bsf
genmove.obj : error LNK2019: unresolved external symbol _bsf referenced in
function _generate_black_evade_check
test.obj : error LNK2001: unresolved external symbol _bsf
Release/Monarch.exe : fatal error LNK1120: 1 unresolved externals

What am I doing incorrectly?  I've looked through the project options and cannot
identify any options to 'tick'.

All help appreciated!

Steve Maughan



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.