compiling panda3d without python

hi
i want to compile panda3d in debug mode but when i do that compiler wants python_d that i don’t know how to find it. why do we need python when i want compile and use panda3d to program in c++?
can i omit python features of panda3d and compile it completely in c++ code?if not how can i find python_d?
please help me…

If you are using makepanda to compile, use the --no-python flag.

which features of panda3d are disabled by doing this.can i work with the panda3d by omitting python?

I haven’t compiled with this option myself, but I would assume it removes the ability to load Panda apps written in Python. Give it a try, see what happens.

If your intent is to develop in c++, there should not be a need to get python (python_d) in debug mode.

If for whatever reason you’d like to test some part of your program in Python prior to implementing it in C++, you’ll still be able to do it in release mode.

hi my friends
i have a problem in compiling Panda3D with optimization level 1 and --no-python

[ 33%] Linking dynamic library built/bin/libpanda_d.dll
fatal error C1900: Il mismatch between 'P1' version '20080116' and 'P2' version
'20070207'
LINK : fatal error LNK1257: code generation failed
Storing dependency cache.
Elapsed Time: 6 min 38 sec

Build terminated.

please help me…

I think you should make sure you are using VS 2008 SP1.
At the same time I would advise to use the latest Microsoft SDK.

Thank you jean-claude
i solve this problem by installing sp1 but when i compile panda3d i got an other fatal error :

[ 50%] Linking dynamic library built/bin/libpandaode_d.dll
   Creating library built/lib/libpandaode_d.lib and object built/lib/libpandaode
_d.exp
ode.lib(convex.obj) : error LNK2019: unresolved external symbol __imp___invalid_
parameter_noinfo referenced in function "public: bool __thiscall std::_Tree<clas
s std::_Tset_traits<struct std::pair<unsigned int,unsigned int>,struct std::less
<struct std::pair<unsigned int,unsigned int> >,class std::allocator<struct std::
pair<unsigned int,unsigned int> >,0> >::const_iterator::operator==(class std::_T
ree<class std::_Tset_traits<struct std::pair<unsigned int,unsigned int>,struct s
td::less<struct std::pair<unsigned int,unsigned int> >,class std::allocator<stru
ct std::pair<unsigned int,unsigned int> >,0> >::const_iterator const &)const " (
??8const_iterator@?$_Tree@V?$_Tset_traits@U?$pair@II@std@@U?$less@U?$pair@II@std
@@@2@V?$allocator@U?$pair@II@std@@@2@$0A@@std@@@std@@QBE_NABV012@@Z)
built/bin/libpandaode_d.dll : fatal error LNK1120: 1 unresolved externals
Storing dependency cache.
Elapsed Time: 2 min 42 sec

Build terminated.

why do Panda3d developers release debug version of panda3d???

Quick answer:
(1) do you need ode? if not try compile with -no–ode
(2) in case you need it (we’ll see this later), for the time being try (1) and let’s see how far you go!

Thank you jean-claude
Your solution work but if i need ode what should i do?

i build panda3D by this command in console:

makepanda\makepanbat --no-python --no-ode --optimize 1

you see that i omit python because without --no-python we need python_d.lib that compiling python is an other problem.
can anyone tell me which features of panda3d are disabled when we use --no-python?
Is python only a wrapper on c++ code or some features of panda3d are programed in python that we should have these features to make game?

Hi,
I’m glad you made some progress!

To include ode what I’d suggest is to get ode from the main ode repository at http://sourceforge.net/projects/opende/files/ and then generate your own release/debug version (preferably use single mode float, and build with /MD). (At least you have better control!)

When done just drop the include and the libs in your thirdparty folder (should be at
…\panda3d\thirdparty\win-libs-vc9\ode)

Then compile.

As per your second question, I think I already mentionned the fact that if you intend to develop in C++ there is no strict need for Python. What you’ll be missing is some utility written in Python that in any case won’t have been accessible by your c++ code. So don’t worry and go ahead!

BTW. I used ODE a few months ago then I discovered Bullet, and I decided to move to Bullet (looks better).
Have a look, it may be a good alternative for your physics.

Cheers

Jean-Claude

Thank you very much jean-claude
You helped my alot

hello again
when i want to run the sample codes in the manual, Panda3d tell me in the console that:

No graphics pipe is available!
Your Config.prc file must name at least one valid panda display library via load-display or aux-display

i installed Microsoft DirectX SDK (June 2010) and all the programs ran correctly when i used original panda3d that is on the site. but now in debug mode that i compiled, programs only run when i change the load-display to “tinydisplay”.

an other problem is: in visual studio IntelliSence feature is disabled and i cant see what is in the classes that panda3d provided while coding.

please help!
thanks.

try this: add in your c++ source code

#include "load_prc_file_data.h"

load_prc_file_data("", "load-display pandadx9");

Thank you for your reply jean-claude
i cant find “load_prc_file_data.h”
there is “load_prc_file.h”
i add it and add the function but it dose not work.

After working with sample c++ code
i found that when i compile panda without python we will not have direct and we will not have intervals.
can anyone tell me hoe can i compile panda with intervals?
or if not how can i compile python in debug mode?
starting to work with panda is really hard.
Is there any Panda3d developers can help me?
please…

You will still have intervals. You just won’t have the Python interface (e.g. LerpPosInterval), instead, you’ll have to use the C++ interface (CLerpNodePathInterval). But this is always true when you’re developing in C++, whether or not you have compiled the Python interfaces, of course.

As teedee and jean-claude have already said, the Python interfaces that you are omitting are only useful for people who want to develop in Python. If you are developing in C++, you absolutely don’t need to build them; it doesn’t provide anything useful and only slows down the build.

For the record, though, if you wish to build with the Python interfaces in debug mode, it only means that you need a build of Python in debug mode as well. This is easy to find via Google, or you can simply download the Python source and compile it too. Since you’re already compiling Panda, this shouldn’t be a big deal for you. But again, there is no reason for you to do this if you aren’t planning to write any Python code yourself.

David

hi drwr
Thank you for reply.
i compiled the Panda3D with these options:

--no-python --optimize 1

and after successful build i set Visual Studio’s include directories and additional libraries and etc.
after that i copied the sample codes that are provided at the manual.i ran following samples successfully:Creating a New Panda3D ApplicationThe Scene GraphDefault Camera Control SystemActors
but when i want to run Intervals and Sequences i encounter with many link errors like:

error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual void __thiscall CLerpNodePathInterval::output(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (__imp_?output@CLerpNodePathInterval@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)	main.obj

that all of them are because i do not add libp3direct.lib to Additional Dependencies of visual studio.i encounter with these link errors when i remove libp3direct.lib from Additional Dependencies of release mode of this sample.because of these i found that my problem, when i compile panda3d is direct is not compiled and libp3direct.lib is not generated.
i see in c++ reference that intervals are subset of direct and when i do not have libp3direct so i do not compiled it.
i recompile the panda3d with following options:

--no-python --use-direct --optimize 1

but nothing changed.

my other problem is: Panda3d that i downloaded and installed from site can found directX and work well but the Panda3D that i compiled only know tinydisplay and tinydisplay is very slow because of software acceleration. i load my own config file but problem is not solved.

please help me drwr and every one read this.

i programmed with panda3d in python for test it.Panda3d has a good design but we want to program in c++ and starting to work with panda3d in c++ is confusing.
why didn’t you provide debug mode like Ogre did?

Hmm, you’re right–it looks like makepanda has a bug, it does not build direct when python is not enabled. That’s a mistake, because there is C++ code in direct that is still useful to a C++ programmer. I don’t know why it does this.

To fix this, try hand-editing makepanda.py. Look for lines like the following, at line 3657 or so:

#
# DIRECTORY: direct/src/directbase/
#

if (PkgSkip("PYTHON")==0 and PkgSkip("DIRECT")==0):

Remove the PYTHON condition from the if statement, so it looks like this:

if (PkgSkip("DIRECT")==0):

There are several groups in a row that build the various directories that contribute to libp3direct; you will need to change all of them here.

Did you build libpandagl.dll and/or libpandadx9.dll? You need to have the DirectX SDK installed where makepanda can find it in order to build libpandadx9.dll.

This is probably an oversight on our part. But supporting C++ is difficult, because of the variety of compilers and options out there, and so far no one has asked for this. Traditionally, Panda has emphasized Python development; we believe this is usually the best way to achieve the highest-quality application possible for a given amount of development time. Of course, there are still reasons to develop in C++ in spite of this, and we recognize this; but it takes a while to bring all of the C++ development tools up to par with the Python tools. Please accept my apologies for the clumsiness and bear with us.

David

Thanks David
i change makepanda and recompile Panda3d and result is:

[ 51%] Building C++ object built/tmp/packpanda.obj
ppython.cxx
direct/src/directbase/ppython.cxx(10) : fatal error C1083: Cannot open include f
ile: 'Python.h': No such file or directory
Storing dependency cache.
Elapsed Time: 3 min 26 sec

Build terminated.

now what should i do?
we need python here.