[C++-sig] examples compile but give exception (win32; intel 8.1; dinkumware 3.08)
Jens B. Jorgensen
jorgensen at getcollc.com
Tue Jun 14 15:58:48 CEST 2005
Sorry, the below makes me look like an idiot (I'm not asserting I'm not, but what you see below is actually not what I intended). Clearly the hello constructor in getting_started2 requires an argument. I first saw the error below in a different piece of code (one I wrote) and I quickly tried the example to verify that I was getting the same thing. In any case, writing proper Python I get:
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import getting_started2
>>> h = getting_started2.hello('hello, world')
Traceback (most recent call last):
File "<stdin>", line 1, in ?
Boost.Python.ArgumentError: Python argument types in
hello.__init__(hello, str)
did not match C++ signature:
__init__(struct _object *, class std::basic_string<char,struct std::char_tra
its<char>,class std::allocator<char> >)
>>>
Or running the test_getting_started2.py I get:
**********************************************************************
File "c:\boost_1_32_0\libs\python\example\test_getting_started2.py", line 2, in test_getting_started2
Failed example:
hi = hello('California')
Exception raised:
Traceback (most recent call last):
File "C:\Python24\Lib\doctest.py", line 1243, in __run
compileflags, 1) in test.globs
File "<doctest test_getting_started2[1]>", line 1, in ?
hi = hello('California')
ArgumentError: Python argument types in
hello.__init__(hello, str)
did not match C++ signature:
__init__(struct _object *, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)
**********************************************************************
File "c:\boost_1_32_0\libs\python\example\test_getting_started2.py", line 3, in test_getting_started2
Failed example:
hi.greet()
Exception raised:
Traceback (most recent call last):
File "C:\Python24\Lib\doctest.py", line 1243, in __run
compileflags, 1) in test.globs
File "<doctest test_getting_started2[2]>", line 1, in ?
hi.greet()
NameError: name 'hi' is not defined
**********************************************************************
File "c:\boost_1_32_0\libs\python\example\test_getting_started2.py", line 5, in test_getting_started2
Failed example:
invite(hi)
Exception raised:
Traceback (most recent call last):
File "C:\Python24\Lib\doctest.py", line 1243, in __run
compileflags, 1) in test.globs
File "<doctest test_getting_started2[3]>", line 1, in ?
invite(hi)
NameError: name 'hi' is not defined
**********************************************************************
File "c:\boost_1_32_0\libs\python\example\test_getting_started2.py", line 7, in test_getting_started2
Failed example:
hi.invite()
Exception raised:
Traceback (most recent call last):
File "C:\Python24\Lib\doctest.py", line 1243, in __run
compileflags, 1) in test.globs
File "<doctest test_getting_started2[4]>", line 1, in ?
hi.invite()
NameError: name 'hi' is not defined
**********************************************************************
File "c:\boost_1_32_0\libs\python\example\test_getting_started2.py", line 14, in test_getting_started2
Failed example:
hi2 = wordy('Florida')
Exception raised:
Traceback (most recent call last):
File "C:\Python24\Lib\doctest.py", line 1243, in __run
compileflags, 1) in test.globs
File "<doctest test_getting_started2[6]>", line 1, in ?
hi2 = wordy('Florida')
ArgumentError: Python argument types in
hello.__init__(wordy, str)
did not match C++ signature:
__init__(struct _object *, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)
**********************************************************************
File "c:\boost_1_32_0\libs\python\example\test_getting_started2.py", line 15, in test_getting_started2
Failed example:
hi2.greet()
Exception raised:
Traceback (most recent call last):
File "C:\Python24\Lib\doctest.py", line 1243, in __run
compileflags, 1) in test.globs
File "<doctest test_getting_started2[7]>", line 1, in ?
hi2.greet()
NameError: name 'hi2' is not defined
**********************************************************************
File "c:\boost_1_32_0\libs\python\example\test_getting_started2.py", line 17, in test_getting_started2
Failed example:
invite(hi2)
Exception raised:
Traceback (most recent call last):
File "C:\Python24\Lib\doctest.py", line 1243, in __run
compileflags, 1) in test.globs
File "<doctest test_getting_started2[8]>", line 1, in ?
invite(hi2)
NameError: name 'hi2' is not defined
**********************************************************************
1 items had failures:
7 of 9 in test_getting_started2
***Test Failed*** 7 failures.
> -----Original Message-----
> From: c++-sig-bounces at python.org [mailto:c++-sig-bounces at python.org]On
> Behalf Of Jens B. Jorgensen
> Sent: Tuesday, June 14, 2005 8:42 AM
> To: c++-sig at python.org
> Subject: [C++-sig] examples compile but give exception (win32; intel
> 8.1;dinkumware 3.08)
>
>
> I have a problem that hopefully someone can give me some
> insight to. I recently got Boost 1.32.0 to compile for my
> environment. I'm using the Intel c++ compiler 8.1 and the
> dinkumware std library v3.08. Getting everything to compile
> ultimately required my own custom intel-win32-sxl-tools.jam
> which I based on the intel-win32-tools.jam. The main options
> I added to get that working are:
>
> CFLAGS += -I\"<path to dinkumware stdlib>" ;
> CFLAGS += /D_GLOBAL_USING=1 /DBOOST_DATE_TIME_NO_LOCALE
> /D_HAS_EXCEPTIONS=1
> /DBOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
> -DBOOST_NO_EXCEPTION_STD_NAMESPACE /DBOOST_NO_STD_ALLOCATOR
> -DBOOST_NO_STD_USE_FACET -DBOOST_HAS_TWO_ARG_USE_FACET ;
>
> e.g. if I use bjam "-sTOOLS=intel-win32-sxl" -n I see:
>
> CALL "c:\Program
> Files\Intel\CPP\Compiler80\Ia32\bin\ICLVARS.BAT" > nul
> "c:\Program Files\Intel\CPP\Compiler80\Ia32\bin\icl"
> /Zm800 -nologo /EHsc -c -DBOOST_PYTHON_DYNAMIC_LIB /Z7 /Od
> /Ob0 /EHsc /GR /MDd -I"C:\VendorAPIs\SXL\include"
> /D_GLOBAL_USING=1 /DBOOST_DATE_TIME_NO_LOCALE
> /D_HAS_EXCEPTIONS=1
> /DBOOST_ARCHIVE_OLD_DINKUMWARE_BENEATH_STLPORT
> -DBOOST_NO_EXCEPTION_STD_NAMESPACE /DBOOST_NO_STD_ALLOCATOR
> -DBOOST_NO_STD_USE_FACET -DBOOST_HAS_TWO_ARG_USE_FACET /Qwn5
> /Qwd985 -Qoption,c,--arg_dep_lookup /Zc:forScope /Qansi_alias
> /Qvc6 -DBOOST_NO_INTRINSIC_WCHAR_T /EHa -I"bin\example"
> -I"C:\Program Files\Microsoft Visual
> Studio\VC98\include" -I"c:\boost_1_32_0"
> -I"c:\Python24\include"
> -Fo"bin\example\getting_started2.pyd\intel-win32-sxl\debug\thr
> eading-multi\getting_started2.obj"
> -Tp"c:\boost_1_32_0\libs\python\example\getting_started2.cpp"
>
> I arrived at my custom .jam through time patiently spent
> looking at compiler error messages and the source. With the
> above everything builds! Huzzah. We're using the Intel
> compiler in an msvc6 "environment" at the moment so I've got /Qvc6.
>
> So, then I proceeded to the hello example that defines a
> module with a "greet" function. Works fine. Then I tried to
> get a little fancier and create an object. This builds but I
> get a runtime error. So, ultimately I try using bjam to build
> the example code included. Everything builds fine but when I
> try to using the resulting python module I get some
> interesting things:
>
> Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import getting_started2
> >>> h = getting_started2.hello()
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> Boost.Python.ArgumentError: Python argument types in
> hello.__init__(hello)
> did not match C++ signature:
> __init__(struct _object *, class
> std::basic_string<char,struct std::char_traits<char>,class
> std::allocator<char> >)
>
> Any ideas? I've been pondering the lists but I'm stumped.
> It's clear that someout it isn't able to map the class but I
> have no idea why. The above module was compiled from the
> source included in the distribution, I made no changes to the source.
>
> Thanks for any help or pointers,
>
> Jens B. Jorgensen
> Getco, LLC
>
>
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
More information about the Cplusplus-sig
mailing list