After one of my last questions about python & C ++ integration, I was told to use DLLs in windows. (Previous question)
This worked fine:
cl /LD A.cpp B.cpp C.pp
on a Windows environment, after setting the enable path for boost, cryptopp sources, and cryptopp libraries.
Now I am trying to do the same on Linux by creating a .so file for import via ctypes in python2.5. I did:
gcc -Wall -Wextra -pedantic A.cpp B.cpp C.cpp /usr/lib/libcryptopp.so -shared -o /test/decoding.so
and therefore the object is created normally. If the remote -shared compilation is ok, but stops because there is no main (obviously;)). Of course libcryptopp.so also exists.
But when I switch to python and import the “so” file, he said that the attribute has no “decrypt”, “encrypt” object, or anything where I am. the use of "dir" over dll objects confirms that they are not there.
external functions are defined in A.cpp as:
int encrypt (params...) //.. return num; int decrypt (params...) //.. return num;
also tried using:
extern "C" encrypt (params...) .....
Can someone tell me what I am doing wrong?
Thanks in advance!
rags
source share