[C++-sig] "The filename or extension is too long"

Mike Thompson mike.thompson at day8.com.au
Thu Sep 4 23:44:52 CEST 2003


I'm attempting to set up a Boost.Python project outside the Boost.Python tree.
I'm working with a modified version of the jam files provided in
boost\libs\python\example\project.zip (see end of post)

Everything appears to be working perfectly EXCEPT that bjam is attempting to
create a folder whose path is longer than 255 characters long which, on XP,
causes the whole process to fall over with the message "The filename or
extension is too long. "

Other than this one small problem, I believe my configuration works because
I've done "bjam -n -oBUILD.BAT" , hand-modified the folder names in BUILD.BAT
to something shorter than 255 characters and successfully built a useable
'.pyd'.

So. What can I do about these enormous paths? Here is an example:

bin\getting_started1.pyd\msvc-stlport\release\debug-symbols-on\exception-handli
ng-on\inlining-off\optimization-off\rtti-on\runtime-build-debug\runtime-link-dy
namic\stlport-cstd-namespace-std\stlport-iostream-on\stlport-version-4.5.3\thre
ading-single

I've googled and found one mention of this problem in 2002, but there was no
resolution or workaround mentioned, simply a comment that it needed to be
fixed.

There's got to be a solution, because I don't run into this problem when I'm
working with the example in the Boost.Python source tree.

Any suggestions very welcome.

Here are the bjam files I'm working with:


-------------  Jamrules ---------------------------------------------

path-global BOOST_ROOT : C:/libs/boost ;


PYTHON_ROOT = C:/Python23 ;
PYTHON_VERSION = 2.3 ;

STLPORT_PATH = C:/libs ;
STLPORT_4.5-0725_PATH = C:/libs/STLport-4.5-0725 ;
STLPORT_VERSION = 4.5-0725 ;

TOOLS = msvc-stlport ;
BUILD = release ;

---------- Boost-Build.jam  -----------------------------------------

# Specify path to the boost build system
BOOST_ROOT = C:/libs/boost ;
boost-build C:/libs/boost/tools/build ;


---------- Jamfile -----------------------------------------
project-root ;


# Include definitions needed for Python modules
SEARCH on python.jam = $(BOOST_BUILD_PATH) ;
include python.jam ;

# Declare a Python extension called getting_started1
extension getting_started1
  :  # sources
     getting_started1.cpp
  :  # requirements

     # link to the appropriate library for the build variant.
    <release><find-library>boost_python
    <debug><find-library>boost_python_debug
    <debug-python><find-library>boost_python_pydebug

  # library path required for linking to boost_python shared lib. You
  # may need to edit this for your installation
    <library-path>C:/libs/boost/libs/python/build/bin-stage
  ;

------------------------------------------------------------------

--
Mike









More information about the Cplusplus-sig mailing list