[C++-sig] embbed simple example failed

Stefan Seefeld seefeld at sympatico.ca
Wed Sep 3 21:40:58 CEST 2008


Olaf Peter wrote:
> Hi,
>
> I get mad on this snipped; I've got:
>
> $ g++ -I /usr/include/python2.5 bpl.cpp -o bpl -l boost_python -l
> python2.5 && ./bpl
>   File "<string>", line 1
>     print("Hello World\n")
>         ^
> SyntaxError: invalid syntax
>   

The compiler is right. What you probably meant is 'printf', not 'print'.

It is usually a good idea to narrow down the error by removing bits from 
the sources until the problem disappears. Doing that you would have 
realized that your problem has nothing to do with boost, neither with 
python.

HTH,
       Stefan

-- 

      ...ich hab' noch einen Koffer in Berlin...




More information about the Cplusplus-sig mailing list