Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jul 2005 10:06:16 -0500
From:      Eriq Lamar <chess@tigergroup.org>
To:        freebsd-stable@freebsd.org
Subject:   need help linking??
Message-ID:  <42E65168.5040502@tigergroup.org>

next in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
A programmer needs your help to get his program to compile properly on 
freebsd. Presently he has no problems in Linux and winblows, but I could 
not get it running in 4.11. This is important to me because it is the 
strongest free chess program available and he is even giving the source! 
and so can be made into a port some day. Here is my message and response 
from him I am including the Makefile as an attachment:


Hi Eriq,

It refuses to link?
Ask BSD users and let me know what the solution is.

---

Make sure to add the appropriate include files but I don't think it would
have any effect.

 >book.o(.text+0x83): undefined reference to `__errno_location'

#include <cerrno>
Maybe BSD has a problem with C++ notation
try replacing with the obsolete #include <errno.h>

 >fen.o(.text+0x29e): undefined reference to `__strtol_internal'

Not sure with strtol (try man pages)
<cstdlib> or <cstring>?

 >protocol.o(.text+0xd55): undefined reference to `stdin'
 >protocol.o(.text+0xdb1): undefined reference to `stdout'

<cstdio>

 >any help you can give me is great! I have a linux binary of fruit2.1
 >running on freebsd just fine but would like to compile a native binary.

---

Well it looks like a linking issue specific to BSD to me.
Ask in appropriate forum and let me know their answer.

Fabien.






[-- Attachment #2 --]

# files

EXE = fruit

OBJS = attack.o board.o book.o eval.o fen.o hash.o list.o main.o material.o \
       move.o move_check.o move_do.o move_evasion.o move_gen.o move_legal.o \
       option.o pawn.o piece.o posix.o protocol.o pst.o pv.o random.o recog.o \
       search.o search_full.o see.o sort.o square.o trans.o util.o value.o \
       vector.o

# rules

all: $(EXE) .depend

clean:
	$(RM) *.o .depend gmon.out

# general

CXX      = g++33
CXXFLAGS = -pipe
LDFLAGS  = -lm

# C++

CXXFLAGS += -fno-exceptions -fno-rtti

# optimisation

CXXFLAGS += -O3 -fstrict-aliasing
CXXFLAGS += -fomit-frame-pointer
# CXXFLAGS += -march=athlon-xp # SELECT ME

# strip

LDFLAGS += -s

# dependencies

$(EXE): $(OBJS)
	$(CXX) $(LDFLAGS) -o $@ $(OBJS)

.depend:
	$(CXX) -MM $(OBJS:.o=.cpp) > $@

include .depend


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42E65168.5040502>