473,326 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Problem compiling C++ code with python embedded

Hello,

I just recently switched my code from one server to another and now
having some problems compiling my code. I was able to compile fine
with my last server now but this current one is giving me problems. My
build file is as follows

g++ -Wall ibdws.cpp ../cgic205/cgic.c -oibdws.cgi -Lcgraph -lcgraph
-Icgraph/Cgraph/source -I../cgic205 -L../cgic205
-I/usr/include/python2.4 -L/usr/lib
/python2.4/site-packages -lpython2.4

However, the new server only has python 2.2 so i simply switched the
2.4 to 2.2 so now my build file looks like this:

g++ -Wall ibdws.cpp ../cgic205/cgic.c -oibdws.cgi -Lcgraph
-lcgraph -Icgraph/Cgraph/source -I../cgic205 -L../cgic205
-I/usr/include/python2.2 -L/usr/lib
/python2.2/site-packages -lpython2.2

but i get the following error when i build now:

/usr/bin/ld: cannot find -lpython2.2
collect2: ld returned 1 exit status

Could someone help me out with this problem? I am not too good with
linux so please explain to me in newbie steps. Thanks a lot.

Eric

Oct 10 '06 #1
1 1961
vduber6er schrieb:
g++ -Wall ibdws.cpp ../cgic205/cgic.c -oibdws.cgi -Lcgraph
-lcgraph -Icgraph/Cgraph/source -I../cgic205 -L../cgic205
-I/usr/include/python2.2 -L/usr/lib
/python2.2/site-packages -lpython2.2

but i get the following error when i build now:

/usr/bin/ld: cannot find -lpython2.2
collect2: ld returned 1 exit status

Could someone help me out with this problem? I am not too good with
linux so please explain to me in newbie steps. Thanks a lot.
I'm not sure I can explain it in newbie steps; I try with my own
words.

You need to find libpython2.2.a or libpython2.2.so on the new system.
You told the linker to look in /usr/lib/python2.2/site-packages
(in addition to the default locations: /lib and /usr/lib); it
wasn't there.

Try /usr/lib/python2.2/config as a directory instead. Check with
ls whether the file is there; don't try blindly.

Regards,
Martin
Oct 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: RJS | last post by:
Hi all, I can't get a py2exe compiled app to run with numarray (numarray-0.5.win32- py2.2). Also wxPythonWIN32-2.3.3.1-Py22 and ActivePython-2.2.1-222. In the sample below, commenting out...
3
by: Zdenda | last post by:
Hi, i have RH9 and i need python 2.3. I executed tgz file and typed ./configue. Then i type make. It is without problem. When I type make install ... .... .... Compiling...
5
by: eq | last post by:
Hi, I'm trying to create a program(written in C) that does the following things using embedded Python: 1. Create a module(say, "MyModule") 2. Create a class in that module(say, "MyClass") 3....
6
by: Farshid Lashkari | last post by:
Hi, My application has python embedded into it. I noticed that when I run any python code the output is buffered and doesn't get flushed until my application exits. To fix this I simply flush...
3
by: stefan | last post by:
Hi Folks, I currenty extended some of my C++ functionality to python and also embedded python to use python functionality in my C++ system (and use as well these extended functions). While...
6
by: Club-B42 | last post by:
i've compiled my programm using command "python setup.py py2exe >1" python script works fine, but .exe version fails with =====================================================================...
2
by: Ugo Di Girolamo | last post by:
I have the following code, that seems to make sense to me. However, it crashes about 1/3 of the times. My platform is Python 2.4.1 on WXP (I tried the release version from the msi and...
1
by: Han-Wen Nienhuys | last post by:
Hello, I have a small patch for Python SVN that makes it possible to cross-compile python on Unix to various other Unix targets. I have successfully built a binary for FreeBSD on Linux. The...
3
by: Sebastian Bassi | last post by:
I was trying to install Python 2.5 compiling from sources. I used: ../compile It run OK. Then: make altintall After a lot of output, got this: Listing /usr/local/lib/python2.5/xml/sax ......
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.