Panda3D
 All Classes Functions Variables Enumerations
pystub.h
1 // Filename: pystub.h
2 // Created by: drose (08Aug00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef PYSTUB_H
16 #define PYSTUB_H
17 
18 #include "dtoolbase.h"
19 
20 // The sole purpose of this header file is to allow a program other
21 // than Python to load in a module that includes Python wrappers.
22 
23 // We need this if we build the Panda libraries with Python wrappers,
24 // but want to run a standalone program with those libraries.
25 
26 // This header file just stubs out the Python functions that these
27 // wrappers will call. You should include this header file in exactly
28 // one .C file in your project, preferably in the .C file that defines
29 // main(), and then link with -lpystub. Do not include this header
30 // file in a .C or .h file that will become part of an .so that might
31 // eventually link with Python.
32 
33 
34 // You might need to call this function in main() or somewhere to
35 // force the .so to be linked in--some OS'es try to be smart about not
36 // pulling in shared libraries whose symbols aren't referenced
37 // anywhere.
38 EXPCL_PYSTUB void pystub();
39 
40 
41 #endif
42