invoke c++ shared library but the FILE fread() function always return 0 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: invoke c++ shared library but the FILE fread() function always return 0 (/thread-5698.html) |
invoke c++ shared library but the FILE fread() function always return 0 - sansirokarl - Oct-17-2017 this is my c code : Quote://libtest.cthen generate a shared library: Quote:gcc libtest.c -shared -o -fPIC -o libtest.so then i tried to invoke the function in python: Quote:#testfile.py but i got the result: 1, if i execute the command in python2 the fread function can be successful Quote:python testfile.py2, but when i tried to using python3 , the fread function always return 0 Quote:python3 testfile.py I don't know what's wrong with this.Any suggestion for me ? RE: invoke c++ shared library but the FILE fread() function always return 0 - Larz60+ - Oct-17-2017 Code goes between python tags not quote tags see BBCODE |