[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

C++/Python .so Problem



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hallo,
ich möchte eine .so Datei erstellen und ein Python Skript soll diese
Datei benutzen.
Ich habe erst einmal eine Test-C++ Quellcode Datei (.cpp) geschrieben:

#include <stdio.h>
void test()
{
	printf("test");
}

und dann mittels:
g++ -shared o.g.QuellcodeDatei >> RASAPI.so
die Datei RASAPI.so erfolgreich erstellt.

Anschließend habe ich eine Python Skript geschrieben:

from ctypes import CDLL
aou = CDLL("absoluterPfad/RASAPI.so")

Doch wenn ich das Python Skript starte erhalte ich folgende Fehlermeldung:
Traceback (most recent call last):
  File "python.py", line 2, in <module>
    aou = CDLL("absoluterPfad/RASAPI.so")
  File "/usr/lib/python2.7/ctypes/__init__.py", line 365, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: absoluterPfad/RASAPI.so: file too short



Meine Frage:
Wie kann ich machen dass es funktioniert?


- -- 
Volker Weißmann
volker.weissmann@gmx.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Icedove - http://www.enigmail.net/

iQEcBAEBAgAGBQJTtr0TAAoJENDHbl9eTTNyJpwH/2N0MTXdGs236on1efR4xFO9
yLrilgC5JMjHLytI+xWM8nHjEqjcb8TYUu6PzXYmqFHbd+AyKl6MEn103DaEfOcx
aJG5r7Ig9A+sVyjh+aqIpTyQxmWrhaL3npKzyE4+BtxDaahSJ6FHzU/B/R0u35mi
sYl6OfUZSvmyYap7oHYUza3jfsPCrIF8JGdacetxFnCazGACt0NhAkVc41RQI8YJ
el6CjJ/uwwTqh1ffTxkeRdt5iFFySTcB1mUlng8++0clQC8ZAuBvsfThtqsAaKOi
Dc6n3FCbVb1Bf6w1Uqlmqavl5eGjivYmmlpA7j/VV15vEuYE+LgLz56l0ZwKRGE=
=kkNw
-----END PGP SIGNATURE-----


Reply to: