|
|
C/C++ Quellcode |
1 2 3 4 5 6 7 8 9 10 |
#include "stdafx.h" #include "c:\python25\include\Python.h" int _tmain(int argc, _TCHAR* argv[]) { Py_Initialize(); PyRun_SimpleString("print \"hallo\""); Py_Finalize(); return 0; } |
Es ist nich schwer zu erraten was da falsch läuft. Nur wo bekomm ich die Header-Datei her?
Quoted
c:\dokumente und einstellungen\codework\eigene dateien\visual studio 2005\projects\python\python\pyconfig.h(189) : fatal error C1083: Datei (Include) kann nicht geöffnet werden: "basetsd.h": No such file or directory
Quoted
I've only skimmed your post briefly, but this is likely your problem. Python extensions cannot be built with Visual C++ 2005 (incompatible C runtime), so this doesn't work. You need the Visual C++ Toolkit Edition, but MS no longer seem to supply this :-( If you can get someone who has a copy to send it to you, that would be one option - but it's a 32MB file, and I don't know the redistribution conditions, it's probably not allowed, so you may have problems there).
The other option is to install Mingw (from www.mingw.org), and build using setup.py build --compiler=mingw32. This works fine, unless your extension code uses MSVC specific extensions. The instructions in the Python docs are a little out of date, I believe. With Python 2.4, you shouldn't need to do anything more than install mingw, make sure gcc is on your path, and run setup.py as above. You can even edit the distutils config file (I can't remember its location offhand, sorry) to specify that distutils should use mingw by default.
This post has been edited 1 times, last edit by "neckcracker" (Aug 17th 2007, 3:48pm)
Quoted
I would recommend buying Visual Studio. It's what python 2.4 is built
with, and it makes compiling extensions nice and easy.
Und bei Code::Blocks nimmst du dann einen Nightly, die Links gibts im Forum (nicht zu verfehlen), das sind dann 2 weitere Archive, die du noch entpacken musst ... Hier nochma der Quellcode:
Quoted
pythonembed.cpp: undefined reference to '_Py_Initialize'
pythonembed.cpp: undefined reference to '_Py_SimpleStringFlags'
pythonembed.cpp: undefined reference to '_Py_Finalize'
|
|
C/C++ Quellcode |
1 2 3 4 5 6 7 8 |
#include "py25/Python.h" int main(int argc, char *argv[]) { Py_Initialize(); PyRun_SimpleString("print \"hallo dude\""); Py_Finalize(); return 0; } |
|
|
Bash |
1 |
|
Tja, das is dann wohl dumm das die Header Fehler haben?!
Quoted
intobject.h (44): error '__int64' does not have a name type
longobject.h (43): error '__int64' was not declared in this scope
longobject.h (45): error '__int64' does not have a name type
longobject.h (46): error '__int64' does not have a name type
longobject.h (47): error '__int64' does not have a name type
This post has been edited 1 times, last edit by "neckcracker" (Aug 19th 2007, 8:33am)