Boost logo

Boost :

From: Nokome Bentley (nbentley_at_[hidden])
Date: 2001-11-28 21:58:54


Hi,

Thanks Dave for your prompt reply to my question. I hope that the
descriptions of my continued problems are useful and not just clutter on the
list. I followed your instructions and JAM ran but I had to change some
things:

1. I changed the g++ to gxx in "actions gcc-C++-action" in
tools/build/gcc-tools.jam

2. Then I learnt about the apparently "infamous DOS 126-character limit"
for commands. To get around that I wrote a program (DOSWrite) to write a
command text file that could be read in by gcc:

        #include <fstream.h>
         int main(int argc, char* argv[]){
                ofstream file(argv[1]);
                for(int i=2;i<=argc;i++) file<<argv[i]<<" ";
                return 0;
        }

and in tools/build/gcc-tools.jam changed actions gcc-C++-action to

        actions gcc-C++-action
        {
                    DOSWrite
base.txt -c -Wall -ftemplate-depth-100 -U$(UNDEFS) -D$(DEFINES)$(CFLAGS)
$(C++FLAGS)
                    DOSWrite files.txt " " -I"$(HDRS)" -I"$(STDHDRS)" -o "$(<)" "$(>)"
                    COPY /Y base.txt+files.txt coms.txt
                    $(GCC_BIN_DIRECTORY)gxx @coms.txt
        }

3. I changed the PYTHON_INCLUDES variable in libs/python/build Jamfile so
that it included the directory where I have Python

This seems to work but when it gets to:

gxx -c -Wall -ftemplate-depth-100 -DSIZEOF_LONG=4 -DUSE_DL_IMPORT -g -O0 -
fno-inline -fPIC
         -I"libs\python\build" -I"." -I"c:\progra~1\python21\include"
         -o
"libs\python\build\bin\libboost_python\gcc\debug\runtime-link-dynamic\shared
-linkable-true\classes.obj"
         "libs\python\build\../src\classes.cpp"

then I get:

        c:/program files/djgpp/bin/as.exe: bfd assertion fail
/djgpp/gnu/binutl-2.112/bfd/coff-i386.c:529
        c:/program files/djgpp/tmp\ccxmWUEa.s: Assembler messages:
        c:/program files/djgpp/tmp\ccxmWUEa.s:1649: Error: cannot represent
relocation type BFD_RELOC_386_PLT32
        c:/program files/djgpp/bin/as.exe: bfd assertion fail
/djgpp/gnu/binutl-2.112/bfd/coff-i386.c:529
        c:/program files/djgpp/tmp\ccxmWUEa.s:1653: Error: cannot represent
relocation type BFD_RELOC_386_GOTOFF

Removing the option -fPIC allows compilation. I experimented without this
option and built libboost_python.lib using the 9 .obj files:

        ar ru libboost_python.lib classes.obj.....

But when I go to use it get:

gxx -shared -o gs2.pyd
getting_started2.o -Llibboost_python.lib -Lc:\progra~1\python21\libs\python2
1.lib
gcc.exe: unrecognized option `-shared'
c:/program files/djgpp/lib/crt0.o(.data+0xc2):crt0.s: undefined reference to
`main'
getting_started2.o(.text+0xd4):getting_started2.cpp: undefined reference to
`boost::python::module_builder::module_builder(char const*)'
getting_started2.o(.text+0x19f):getting_started2.cpp: undefined reference to
`boost::python::module_builder::~module_builder()'
getting_started2.o(.text+0x1b8):getting_started2.cpp: undefined reference to
`boost::python::module_builder::~module_builder()'
getting_started2.o(.text+0x1d3):getting_started2.cpp: undefined reference to
`boost::python::handle_exception()'
getting_started2.o(.gnu.linkonce.t._ZN5boost6python13class_builderIN37_GLOBA
L__N_getting_started2.cpp3w8Wna5helloENS0_6detail13held_instanceIS3_EEEC1ERN
S0_14module_builderEPKc+0xdd):getting_started2.cpp: undefined reference to
`boost::python::module_builder::add(boost::python::reference<_object>, char
const*)'
getting_started2.o(.gnu.linkonce.t._ZN5boost6python14module_builder3defIPFSs
RKN37_GLOBAL__N_getting_started2.cpp3w8Wna5helloEEEEvT_PKc+0x1f):getting_sta
rted2.cpp: undefined reference to
`boost::python::module_builder::add(boost::python::detail::function*, char
const*)'
getting_started2.o(.gnu.linkonce.t._ZN5boost6python6detail15extension_classI
N37_GLOBAL__N_getting_started2.cpp3w8Wna5helloENS1_13held_instanceIS4_EEEC1E
PKc+0x11):getting_started2.cpp: undefined reference to
`boost::python::detail::extension_class_base::extension_class_base(char
const*)'
getting_started2.o(.gnu.linkonce.t._ZN5boost6python6detail15extension_classI
N37_GLOBAL__N_getting_started2.cpp3w8Wna5helloENS1_13held_instanceIS4_EEE3de
fIMKS4_FSsvEEEvT_PKc+0x1f):getting_started2.cpp: undefined reference to
`boost::python::detail::extension_class_base::add_method(boost::python::deta
il::function*, char const*)'
getting_started2.o(.gnu.linkonce.t._ZN5boost6python6detail15extension_classI
N37_GLOBAL__N_getting_started2.cpp3w8Wna5helloENS1_13held_instanceIS4_EEE3de
fIPFSsRKS4_EEEvT_PKc+0x1f):getting_started2.cpp: undefined reference to
`boost::python::detail::extension_class_base::add_method(boost::python::deta
il::function*, char const*)'
(snip)

so I suppose that the -fPIC really is needed.

Nokome


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk