how to compile pcp fileshare in libjingle - c++

okay, i'm trying to compile the fileshare example called 'pcp' using the following command
wolfgang#den-pc:~/tejesh/libjingle-0.6.14/programs$ g++ -g -Wall -DPOSIX
-DEXPAT_RELATIVE_PATH -DFEATURE_ENABLE_SSL -DHAVE_OPENSSL_SSL_H=1 -I ../ pcp_main.cc
../talk/build/dbg/lib/libxmpphelp.a ../talk/build/dbg/lib/libjingle.a ../talk/build
/dbg/lib/libexpat.a ../talk/build/dbg/lib/libsrtp.a -lpthread -lssl
And i get the following 'typeinfo' error...
pcp_main.cc: In member function ‘virtual void
CustomXmppPump::OnStateChange(buzz::XmppEngine::State)’:
pcp_main.cc:348:12: warning: enumeration value ‘STATE_NONE’ not handled in switch
[-Wswitch]
/tmp/ccVe8JUg.o:(.rodata._ZTI14CustomXmppPump[typeinfo for CustomXmppPump]+0x18):
undefined reference to `typeinfo for XmppPump'
/tmp/ccVe8JUg.o:(.rodata._ZTIN7cricket18SessionManagerTaskE[typeinfo for
cricket::SessionManagerTask]+0x8): undefined reference to `typeinfo for buzz::XmppTask'
/tmp/ccVe8JUg.o:(.rodata._ZTIN7cricket15SessionSendTaskE[typeinfo for
cricket::SessionSendTask]+0x8): undefined reference to `typeinfo for buzz::XmppTask'
/tmp/ccVe8JUg.o:(.rodata._ZTI17AutoPortAllocator[typeinfo for AutoPortAllocator]+0x8):
undefined reference to `typeinfo for cricket::HttpPortAllocator'
collect2: ld returned 1 exit status
Anybody have some idea on this issue?

If you compile with gyp, you can change trunk/talk/libjingle_examples.gyp:
# target pcp
{
'target_name': 'pcp',
'type': 'executable',
'dependencies': [
'libjingle_xmpphelp',
'libjingle.gyp:libjingle',
'libjingle.gyp:libjingle_p2p',
],
'sources': [
'examples/pcp/pcp_main.cc',
],
}, # target pcp
run gclient runhooks again and make.

This error may be caused by some virtual method not having a definition - i.e. you have declared it but you have not defined its body.
Probably you did not include some .c/.cpp file(s) in the compilation/linking?

Did manage to compile pcp succesfully by scons,......... in your talk/ directory append the following line to 'libjingle.scons'
talk.App(env, name = "pcp",
posix_libs = [
"crypto",
"ssl",
],
srcs = [
"examples/pcp/pcp_main.cc",
],
libs = [
"jingle",
"expat",
"srtp",
"xmpphelp",
],
)
And then build it using instructions from the README of libjingle.. pcp binary will be built in your /talk/build/dbg/staging/ directory..

Related

Undefined reference to symbol 'pa_context_disconnect#PULSE_0'

I'm using Raspberry pi 4, here I cloned this repo, and after I followed instructions they have given
First I run ./configure without any error
After that I tried to clean
make clean
Then I tried to make
After that I got some error as shown below:
~/qtcam/src $ make
Makefile:1725: warning: overriding recipe for target 'install_itemfolder_01'
Makefile:1716: warning: ignoring old recipe for target 'install_itemfolder_01'
Makefile:1729: warning: overriding recipe for target 'uninstall_itemfolder_01'
Makefile:1720: warning: ignoring old recipe for target 'uninstall_itemfolder_01'
g++ -Wl,-O1 -o Qtcam main.o logger.o about.o cameraproperty.o videostreaming.o uvccamera.o v4l2-api.o seecam_10cug_m.o seecam_10cug_bayer.o seecam_11cug.o seecam_cu50.o seecam_ar0130.o videoencoder.o seecam_cu51.o see3cam_cu130.o h264decoder.o ascella.o seecam_cu30.o see3cam_130.o see3cam_30.o seecam_81.o see3cam_cu135.o see3cam_cu40.o see3cam_cu20.o uvcExtCx3sni.o keyEventReceive.o nilecam20_usb.o nilecam30_usb.o h264camera.o see3cam_cu55.o see3cam_130A.o audioinput.o see3cam_cu38.o alsa.o fscam_cu135.o see3camcu55_mh.o see3cam_20cug.o see3cam_cu22.o see3cam_130d.o see3cam_24cug.o see3cam_cu81.o seecam_cu80.o see3cam_160.o ecam51_usb.o ecam82_usb.o see3cam_cu27.o see3cam_1332.o ecam83_usb.o see3cam_cu1330m.o see3cam_135m.o see3cam_cu136m.o barcode_camera.o qtquick2applicationviewer.o moc_qtquick2applicationviewer.o moc_about.o moc_cameraproperty.o moc_videostreaming.o moc_uvccamera.o moc_seecam_10cug_m.o moc_seecam_10cug_bayer.o moc_seecam_11cug.o moc_seecam_cu80.o moc_seecam_cu50.o moc_seecam_ar0130.o moc_seecam_cu51.o moc_see3cam_cu130.o moc_h264decoder.o moc_ascella.o moc_seecam_cu30.o moc_see3cam_130.o moc_common_enums.o moc_see3cam_30.o moc_seecam_81.o moc_see3cam_cu135.o moc_see3cam_cu40.o moc_see3cam_cu20.o moc_uvcExtCx3sni.o moc_keyEventReceive.o moc_nilecam30_usb.o moc_nilecam20_usb.o moc_h264camera.o moc_see3cam_cu55.o moc_see3cam_130A.o moc_audioinput.o moc_see3cam_cu38.o moc_fscam_cu135.o moc_see3camcu55_mh.o moc_see3cam_20cug.o moc_see3cam_cu22.o moc_see3cam_130d.o moc_see3cam_24cug.o moc_see3cam_cu81.o moc_see3cam_160.o moc_ecam51_usb.o moc_ecam82_usb.o moc_see3cam_cu27.o moc_see3cam_1332.o moc_ecam83_usb.o moc_see3cam_cu1330m.o moc_see3cam_135m.o moc_see3cam_cu136m.o moc_barcode_camera.o /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so /usr/lib/arm-linux-gnueabihf/libQt5Multimedia.so /usr/lib/arm-linux-gnueabihf/libQt5Quick.so /usr/lib/arm-linux-gnueabihf/libQt5Gui.so /usr/lib/arm-linux-gnueabihf/libQt5Concurrent.so /usr/lib/arm-linux-gnueabihf/libQt5QmlModels.so /usr/lib/arm-linux-gnueabihf/libQt5Qml.so /usr/lib/arm-linux-gnueabihf/libQt5Network.so /usr/lib/arm-linux-gnueabihf/libQt5Core.so -lGLESv2 -lpthread -latomic
/usr/bin/ld: audioinput.o: undefined reference to symbol 'pa_context_disconnect##PULSE_0'
/usr/bin/ld: /lib/arm-linux-gnueabihf/libpulse.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [Makefile:468: Qtcam] Error 1
Can anyone tell me how to solve this error?

[oneTBB]: undefined reference to tbb::detail::r1::xxxxx #802

with the usage:
ExternalProject_Add(tbb
PREFIX ${CMAKE_SOURCE_DIR}/deps
DOWNLOAD_NO_PROGRESS 1
DOWNLOAD_NAME v2021.4.0
# TODO: add wb cdn link
URL https://codeload.github.com/oneapi-src/oneTBB/tar.gz/refs/tags/v2021.4.0
URL_HASH SHA1=2641f9a1ead4621a8660ee07a1664627fa0eb477
BUILD_IN_SOURCE 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1
CMAKE_COMMAND ${CMAKE_COMMAND}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>
-DBUILD_SHARED_LIBS=OFF
-DTBB_TEST=OFF
-DTBB_EXAMPLES=OFF
-DTBB_BENCH=OFF
#CONFIGURE_COMMAND ""
BUILD_COMMAND make extra_inc=big_iron.inc ${ENABLE_STD_LIB}
INSTALL_COMMAND bash -c "/bin/cp -f */libtbb.${TBB_LIB_SUFFIX}* ${CMAKE_SOURCE_DIR}/deps/lib/"
BUILD_BYPRODUCTS ${CMAKE_SOURCE_DIR}/deps/lib/libtbb.${TBB_LIB_SUFFIX}
)
lead to
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:271: error: undefined reference to 'tbb::detail::r1::initialize(tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/detail/_small_object_pool.h:61: error: undefined reference to 'tbb::detail::r1::allocate(tbb::detail::d1::small_object_pool*&, unsigned long)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_arena.h:466: error: undefined reference to 'tbb::detail::r1::max_concurrency(tbb::detail::d1::task_arena_base const*)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/detail/_task.h:191: error: undefined reference to 'tbb::detail::r1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:367: error: undefined reference to 'tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)'
/home/runner/work/deps/src/tbb/include/tbb/../oneapi/tbb/task_group.h:367: error: undefined reference to 'tbb::detail::r1::destroy(tbb::detail::d1::task_group_context&)'
In mac OS , it works well, but centos 7.2(gcc 7.2) and ubuntu(clang 6) it lead to the errors .
Any one can help??

Add boost library as Bazel dependency c++

I have the following setup to add boost library to my c++ project.
/opt/boost/release contains my boost include & lib directories.My boost version is 1.65.1 and built with following command as per the documentation.
$ sudo ./bootstrap.sh --prefix=release --with-python=python3 --with-icu=
$ ./b2 install -j 4
I tried both with and without --with-python=python3 flag.
WORKSPACE
new_local_repository(
name = "boost",
build_file = "boost.BUILD",
path = "/opt/boost/release",
)
boost.BUILD
cc_library(
name = "boost",
srcs = glob(["lib/*.so*"]),
hdrs = glob(["include/**/*.hpp", "include/**/*.h"]),
includes = ["include"],
visibility = ["//visibility:public"],
linkstatic = 1,
)
BUILD
cc_binary(
name = "experiments",
srcs = ["main.cpp"],
deps = [
"#boost//:boost",
],
)
main.cpp
#include <boost/progress.hpp>
int main()
{
return 0;
}
And when I build this using the bazel build command
bazel build //experiments:experiments
I get the following error.
ERROR: /home/nipuna/vinci/engine/experiments/BUILD:1:1: Linking of rule '//experiments:experiments' failed (Exit 1): gcc failed: error executing command
(cd /home/nipuna/.cache/bazel/_bazel_nipuna/d2b463266f25f5449a4796ce18e325db/execroot/__main__ && \
exec env - \
LD_LIBRARY_PATH=/home/nipuna/software/clion-2017.2.3/bin: \
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin \
PWD=/proc/self/cwd \
/usr/bin/gcc -o bazel-out/local-fastbuild/bin/experiments/experiments '-Wl,-rpath,$ORIGIN/../_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib' -Lbazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib '-fuse-ld=gold' -Wl,-no-as-needed -Wl,-z,relro,-z,now -B/usr/bin -B/usr/bin -pass-exit-codes -Wl,-S -Wl,#bazel-out/local-fastbuild/bin/experiments/experiments-2.params)
Use --sandbox_debug to see verbose messages from the sandbox.
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyCObject_Type'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_CallFunction'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_SetString'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyImport_ImportModule'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyEval_CallFunction'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_AttributeError'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_Print'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to '_Py_NoneStruct'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_GetAttrString'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_RuntimeError'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyCObject_AsVoidPtr'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyInt_FromLong'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_Size'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_Occurred'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyErr_Format'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_IsTrue'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyBool_FromLong'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyLong_FromUnsignedLong'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_ValueError'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyObject_CallMethod'
bazel-out/local-fastbuild/bin/_solib_k8/_U#boost_S_S_Cboost___Uexternal_Sboost_Slib/libboost_numpy.so: error: undefined reference to 'PyExc_ImportError'
collect2: error: ld returned 1 exit status
Target //experiments:experiments failed to build
INFO: Elapsed time: 0.422s, Critical Path: 0.10s
Since you're linking your executable to Boost Python/Numpy, you also need to provide Python symbols.
If you don't need Python, the easiest solution is add libboost_numpy.so to exclude in your glob. If you actually need Python, a quick fix would be to add -lpython to linkopts in BOOST.build (this is not a solution that I would recommend for production, since you have no control over Python versions, etc..)
You can use rules_foreign_cc , which is maintained by the Bazel organization.
WORKSPACE
workspace(name = "example")
load("#bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
http_archive(
name = "rules_foreign_cc",
strip_prefix = "rules_foreign_cc-master",
url = "https://github.com/bazelbuild/rules_foreign_cc/archive/master.zip",
)
load("#rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
rules_foreign_cc_dependencies()
http_archive(
name = "boost",
build_file_content = all_content,
strip_prefix = "boost_1_68_0",
sha256 = "da3411ea45622579d419bfda66f45cd0f8c32a181d84adfa936f5688388995cf",
urls = ["https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz"],
)
BUILD
load("#rules_foreign_cc//tools/build_defs:boost_build.bzl", "boost_build")
boost_build(
name = "boost_fiber",
lib_source = "#boost//:all",
static_libraries = ["libboost_fiber.a"],
user_options = ["--with-fiber"],
visibility = ["//visibility:public"],
deps = [":boost_context"],
)
boost_build(
name = "boost_context",
lib_source = "#boost//:all",
static_libraries = ["libboost_context.a"],
user_options = ["--with-context"],
visibility = ["//visibility:public"],
)
cc_binary(
name = "helloworld",
srcs = [
"main.cc",
],
deps = [
":boost_fiber",
],
)

How to add 3rd party C library to tensorflow?

I want to add a third-party C library to tensorflow so I can use it in one of the examples. There doesn't seem to be any examples to follow so any assistance would be appreciated.
Here's my work using event2 as the third-party C library.
I've created an 'ln -s' in tensorflow/third_party to provide the event2/ headers:
ls -al ~/code/tensorflow/third_party/event2
lrwxr-xr-x 1 XXXX staff 25 May 17 16:03 ~/code/tensorflow/third_party/event2 -> /usr/local/include/event2
/usr/local/include> ls event2
BUILD bufferevent_struct.h event_compat.h listener.h thread.h
buffer.h dns.h event_struct.h rpc.h util.h
buffer_compat.h dns_compat.h http.h rpc_compat.h visibility.h
bufferevent.h dns_struct.h http_compat.h rpc_struct.h
bufferevent_compat.h event-config.h http_struct.h tag.h
bufferevent_ssl.h event.h keyvalq_struct.h tag_compat.h
third_party/event2/BUILD:
licenses(["notice"])
cc_library(
name = "event2",
srcs = glob( [ "*.h" ] ),
visibility = [ "//visibility:public" ],
)
In tensorflow/examples/label_image/BUILD, I added the reference to libevent and my test files that use the events2 library:
cc_binary(
name = "label_image",
srcs = [
"main.cc",
"my_new_file_using_events.c",
"my_new_file_using_events.h",
],
linkopts = ["-lm", ],
copts = [ "-Ithird_party", ],
deps = [
"//tensorflow/cc:cc_ops",
"//tensorflow/core:framework_internal",
"//tensorflow/core:tensorflow",
"//third_party/event2:event2",
],
)
It compiles fine but when I run the binary I get the following errors:
dyld: lazy symbol binding failed: Symbol not found: _event_base_new
Referenced from: /Users/XXXX/code/tensorflow/bazel-bin/tensorflow/examples/label_image/label_image
Expected in: flat namespace
dyld: Symbol not found: _event_base_new
Referenced from: /Users/XXXX/code/tensorflow/bazel-bin/tensorflow/examples/label_image/label_image
Expected in: flat namespace
[1] 41395 trace trap bazel-bin/tensorflow/examples/label_image/label_image
The libevent.a, libevent.dylib and other libevent* libs are in /usr/local/lib. according to nm, event_base undefined.
nm -f label_image | grep event_base
U _event_base_dispatch
U _event_base_new
How do I resolve this linkage error? Thanks.
Aren't we missing event2 sources there? Also, I think you want to put .h into hdrs attribute.
cc_library(
name = "event2",
hdrs = glob( [ "*.h" ] ),
srcs = glob( [ "*.cpp" ] ),
visibility = [ "//visibility:public" ],
)
Does this help?

Python Embedded in C++

So I have a GUI program that has a great deal of "stuff" going on. I am adding a python scripting interface so someone can interact problematically with this environment. I am using boost python. So first thing I have is a new module I want to create. For simplicity right now my module just is hello world...
#include <boost/python.hpp>
char const* greet() {
return "hello, world" ;
}
BOOST_PYTHON_MODULE(cerrnimapi) {
boost::python::def( "greet", greet ) ;
}
In my system I have a class that looks like this...
Controller::Controller( ) {
Py_Initialize( ) ;
main_module = boost::python::import( "__main__" ) ;
main_namespace = main_module.attr( "__dict__" ) ;
}
void Controller::execute_script( std::string filename ) {
try {
boost::python::api::object ignored =
boost::python::exec_file( filename.c_str(), main_namespace ) ;
} catch( boost::python::error_already_set const & ) {
if (PyErr_ExceptionMatches(PyExc_ZeroDivisionError)) {
} else {
PyErr_Print();
}
}
}
Now when I go to execute the script in the GUI I get an error...
Traceback (most recent call last):
File "/home/mokon/repository/trunk/python.py", line 1, in <module>
import cerrnimapi
ImportError: No module named cerrnimapi
So of course I am building something wrong. My build system uses autotools so here are a few pieces of that build system that relate to this...
In configure.ac:
AM_PATH_PYTHON
AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
AS_IF([test -z "$PYTHON_INCLUDE"], [
AS_IF([test -z "$PYTHON_CONFIG"], [
AC_PATH_PROGS([PYTHON_CONFIG],
[python$PYTHON_VERSION-config python-config],
[no],
[`dirname $PYTHON`])
AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON.])])
])
AC_MSG_CHECKING([python include flags])
PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
AC_MSG_RESULT([$PYTHON_INCLUDE])
])
AC_ARG_VAR([PYTHON_LD], [Linker flags for python, bypassing python-config])
AS_IF([test -z "$PYTHON_LD"], [
AS_IF([test -z "$PYTHON_CONFIG"], [
AC_PATH_PROGS([PYTHON_CONFIG],
[python$PYTHON_VERSION-config python-config],
[no],
[`dirname $PYTHON`])
AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON.])])
])
AC_MSG_CHECKING([python linker flags])
PYTHON_LD=`$PYTHON_CONFIG --ldflags`
AC_MSG_RESULT([$PYTHON_LD])
])
In my obj/ dir Makefile.am...
pyexec_LTLIBRARIES = cerrnimapi.la
cerrnimapi_la_SOURCES = ${SRC_DIR}/lib/PythonAPI.cpp
cerrnimapi_la_LDFLAGS = -avoid-version -module $(PYTHON_LD)
cerrnimapi_la_CXXFLAGS = $(PYTHON_INCLUDE)
My makefile builds the shared lib and its in the obj folder along with my main program. This doesn't help. I have also done a make install to install the cerrnimapi lib in the python folders. This doesn't help.
I have also tried adding the PythonAPI.cpp to my main programs SOURCES but to no avail.
Any ideas? let me know what additional information would be helpful.
Some things to check:
Run nm over your .so file (which might be in .libs) to make sure your module init func is exported.
Make your program print out the value of sys.path (use PyRun_SimpleString) to see where it's expecting your module to turn up. If you're defining modules for your interpreter only, you probably don't want to install them in $pyexecdir.
Read the Extending Embedded Python article. You don't really need to build dynamic libraries at all, unless you're trying for a plugin architecture.
A point on style: You should try and find $PYTHON_CONFIG outside of your tests for $PYTHON_INCLUDE and $PYTHON_LD so you're not doing the AC_PATH_PROGS twice:
AM_PATH_PYTHON
AC_ARG_VAR([PYTHON_CONFIG], [Path to python-config])
AS_IF([test -z "$PYTHON_CONFIG"], [
AC_PATH_PROGS([PYTHON_CONFIG],
[python$PYTHON_VERSION-config python-config],
[no],
[`dirname $PYTHON`])
])
AC_ARG_VAR([PYTHON_INCLUDE], [Include flags for python, bypassing python-config])
AS_IF([test -z "$PYTHON_INCLUDE"], [
AC_MSG_CHECKING([python include flags])
AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON.])])
PYTHON_INCLUDE=`$PYTHON_CONFIG --includes`
AC_MSG_RESULT([$PYTHON_INCLUDE])
])
AC_ARG_VAR([PYTHON_LD], [Linker flags for python, bypassing python-config])
AS_IF([test -z "$PYTHON_LD"], [
AC_MSG_CHECKING([python linker flags])
AS_IF([test "$PYTHON_CONFIG" = no], [AC_MSG_ERROR([cannot find python-config for $PYTHON.])])
PYTHON_LD=`$PYTHON_CONFIG --ldflags`
AC_MSG_RESULT([$PYTHON_LD])
])