Crystal Space
Welcome, Guest. Please login or register.
December 21, 2014, 08:07:48 am

Login with username, password and session length
Search:     Advanced search
9032 Posts in 2046 Topics by 9296 Members
Latest Member: Nicolepearce
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  MSVC and cspython plugin
« previous next »
Pages: [1] Print
Author Topic: MSVC and cspython plugin  (Read 1606 times)
IPKnightly
Guest


Email
« on: September 26, 2005, 04:38:36 am »

I have been able to get Crystal Space built with MSVC 7 and walktest works fine. However, how do I build cspython with MSVC as there are no solution or project files for it? I've tried creating my own project within the cs solution file called cspython but it did not compile because of 425 linking errors. What libs are required to compile cypython. Also does iScript get built when using MSVC.

Thank you for any help you can provide.

I am on WindowsXP with Python 2.3 installed and the PYTHONPATH environment variable set. I'm using cs_pseudo_2005_09_03 version of Crystal Space.
Logged
sunshine
Administrator
Sr. Member
*****
Posts: 294


View Profile
« Reply #1 on: September 26, 2005, 04:50:46 am »

We don't provide a project file for cspython at this time. Somebody needs to sit down and figure out exactly what must to be in the project file so that we can create one. It is also important that the process can be repeatable and automated since the project files are generated automatically. If you want to work on this, please let me know, and I can provide more details.

Note that CS supports two different Python modes. One, normally called cspython, is a Python plugin for CS which respects CS's iScript interface and which allows you to integrate Python fragments with a C++ CS program. The other, called pythmod (or 'cspace.py/dll'), is a pure-Python extension which lets you write CS programs entirely in Python. The exact files which you need to build from the CS/plugins/cscript/cspython directory differ depending upon which module you wish to build.

At the very least, you will need to link against libcrystalspace.lib and python23.lib (I presume that's the correct library name for your Python distribution).
Logged
IPKnightly
Guest


Email
« Reply #2 on: September 26, 2005, 05:42:08 am »

Thank you for the quick response sunshine.

I would like to have both. However, mainly my goal is to be able to script my game play by editing a .py file without having to recompile my game. Thus, I would like to use the iScript interface to incorporate python interpretation within my game code. Therefore, I should include all files in the C:\CS\plugins\cscript\cspython dir and will also link to the libs that you had specified. In addition to that is there any other header files I should include or source files. Also, I assume that I should build it as a dll. Is this correct?

Also, I'm using MinGW. Could you point me to some instructions or if you would be willing to tell me here so that I could build the plugin and the py file with MinGW. I read the manual but didn't see any instructions.

Thank you very much.
Logged
sunshine
Administrator
Sr. Member
*****
Posts: 294


View Profile
« Reply #3 on: September 26, 2005, 09:23:20 am »

Quote
I would like to have both. However, mainly my goal is to be able to script my game play by editing a .py file without having to recompile my game. Thus, I would like to use the iScript interface to incorporate python interpretation within my game code.

For this you will want the CS `cspython' plugin.

Quote
Therefore, I should include all files in the C:\CS\plugins\cscript\cspython dir and will also link to the libs that you had specified.

No, that's not correct. For the CS plugin `cspython', you compile and link together these files from that directory:

cs_pyth.cpp
cspython.cpp
pytocs.cpp

For the pure Python `pythmod' (cspace) module, you link together these files from that directory:

cs_pyth.cpp
pythmod.cpp

Quote
In addition to that is there any other header files I should include or source files. Also, I assume that I should build it as a dll. Is this correct?

When building cs_pyth.cpp, you probably need to #define SWIG_GLOBAL. Other than the headers files in CS/plugins/cscript/cspython itself, the compiler will need to know where to find the normal CS headers (of course) and the Python headers.

Quote
Also, I'm using MinGW. Could you point me to some instructions or if you would be willing to tell me here so that I could build the plugin and the py file with MinGW. I read the manual but didn't see any instructions.

If you are now using Mingw, then you don't need to do anything special. Just ./configure the project normally and build it with 'jam'. The configure script should detect Python automatically and then Jam should build both modules. You can selectively build those modules with 'jam cspython' and `jam pythmod'.
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.212 seconds with 14 queries.