Computer Chess Club Archives


Search

Terms

Messages

Subject: GCC/Linux and FirstOne(), again.

Author: Frank Phillips

Date: 09:30:39 10/21/00


[Bob Hyatt Wrote in response to how to use Eugene's FirstOne() etc assembly code
in Linux

All you really need to do is compile the .s file separately, which produces
a .o file.  Then use those procedures in your C program calls.  IE there is a
FirstOne(), LastOne() function.  You could change the names in the .s file if
you want, of course.

Then just link that .o file in with your regular C and you should be ready to
rumble...]


Despite having read most HOWTOs I could find, I am still missing something
simple.
Linking X86.o to the rest of the program does not work, giving errors that seem
to
indicate the function cannot be found even though the function type is defined.

int FirstOne(BITBOARD);
main()
{
FirstOne(1);
return;
}

The above compiles with gcc -c -o main.o  main.cpp

The X86.s is compile with asm -o X86.o X86.s
But  gcc -o prog main.o X86.o  fails with the following type of error
main.o(.text+0x250): undefined reference to `FirstOne(unsigned long long)'

Very strange because this _appears_ to be what is done in Crafty by the
Makefile.

Frank





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.