<p>Hello everyone,<br></p><p>I appologize if this is not the correct mailing list for this kind of question.</p><p>I want to use Python from my application, i found a couple of ways to do this. either use P4D in Windows (which would not compile on my 64 bit system, and is not cross platform), I can translate the necessary functions and classes from the python header files myself (h2pas wont work) and work directly against the library..</p>
<p>Or the third option, which I tried on linux.. which is to write the code that actually uses python in C, compile it with gcc and then link the resulting .o file into the rest of my application and use that. With this method, I can use all of pythons API without having to translate its headers, This trick worked in Linux when I tested it, but im having issues in Windows</p>
<p></p><p>Whilst the compile of the actual C code worked, I simply cannot use the Python25.dll from my code, Heres how I did it:</p><p></p><p>unit pyinterface;<br><br>{$link py.o}<br>{$linklib python25}<br>{$linklib c}<br>
</p><p></p><p>On windows, I used the MingW compiler so linklib c was to be replaced with the appropriate libraries (msvcrt etc.) but this is not the issue,</p><p>the problem here is that when I try to linklib python25, It produces:</p>
<p>C:\test\C>C:\FPC\2.2.2\bin\i386-win32\ppcrossx64.exe -FlE:\mingw-w64-bin_i686-mi<br>ngw_20090213\x86_64-pc-mingw32\lib64 -FlC:\test\C -FoE:\Python25\libs foo.pas<br>foo.pas(19,1) Error: Import library not found for python25<br>
<br></p><p>doesnt matter if i put python25 or python25.dll in the linklib line, and the DLL is present both in my System32 directory, as well as in the local one where all the source code for my demo project is in.</p><p>
You can find my linux demo source at:</p><p><a href="http://xealot.winsbydefault.com/py_interface.tar.bz2">http://xealot.winsbydefault.com/py_interface.tar.bz2</a></p><p></p><p>thanks for taking your time reading this,</p>
<p> - Martin</p><p><br></p>