Verknüpfungsfehler während der Verbindung des C -Python -ModulsPython

Python-Programme
Anonymous
 Verknüpfungsfehler während der Verbindung des C -Python -Moduls

Post by Anonymous »

Ich versuche, ein Python -Modul einzurichten, um auf meine C ++ - Bibliothek zuzugreifen. Ich habe die .cpp-Schnittstelle und dann ein Setup.py so geschrieben: < /p>

Code: Select all

    setup(
name="otawapy",
...
ext_modules = [
Extension(
"otawapy",
["otawapy.cpp"],
include_dirs=["/home/casse/Dev/local/include"],
library_dirs=["/home/casse/Dev/local/lib "],
libraries = ["otawa", "elm", "gel++", "gel"]
)
]
)

< /code>
Beachten Sie, dass alle Pfade RECKS sind. Wenn ich die Installation ausführe (python3 setup.py install --user
unter Linux), ich erhalte (ich habe einige Nachrichten von Französisch übersetzt):
...
x86_64-linux-gnu-g++ -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.10/otawapy.o -L/home/casse/Dev/local/lib -lotawa -lelm -lgel++ -lgel -o build/lib.linux-x86_64-3.10/otawapy.cpython-310-x86_64-linux-gnu.so
/usr/bin/ld : cannot find -lotawa : Aucun fichier ou dossier de ce nom
/usr/bin/ld : cannot find -lelm : Aucun fichier ou dossier de ce nom
/usr/bin/ld : cannot find -lgel++ : Aucun fichier ou dossier de ce nom
/usr/bin/ld : cannot find -lgel : Aucun fichier ou dossier de ce nom
collect2: error: ld returned 1 exit status
error: command '/usr/bin/x86_64-linux-gnu-g++' failed with exit code 1
< /code>
Noch seltsamer, wenn ich diesen Befehl in meinem Terminal kopiere, funktioniert er ohne Fehler. Irgendeine Idee?

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post