Cross compiling on linux

Hi all,

I was trying to cross compile panda3d from sources on linux to win64. I have installed the thirdparty/win* directories. This are the commands:

python makepanda/ --target windows --arch amd64 --everything --runtime --installer --no-gles --no-gles2 --no-egl --no-opencv --no-wx --no-carbon --no-contrib --threads 8


python makepanda/ --target windows --arch amd64 --everything --installer --no-gles --no-gles2 --no-egl --no-opencv --no-wx --no-carbon --no-contrib --threads 8

In both cases it complains that it cannot find some header files. In the first case it says it cannot find io.h. If I correct the header file in the source to sys/io.h, it complains it cannot find minmax.h (which I have no idea what it is!). In the second case it cannot find pyconfig.h

Should I deduce that it cannot be cross compiled? Or is there a way out? I noticed that a dtool_config.h file is generated by panda3d which tells which header files should be included: is there a way to influence how it is generated?


I think you might be among the first to attempt this. We don’t officially support building for Windows using a compiler other than MSVC.

If you wish to go ahead with this, there may be some changes you will need to make to the source code in order to ensure that it is compatible with the standard library you are using.

The contents of dtool_config.h is generated from the DTOOL_CONFIG structure and the WriteConfigSettings function in

Right, I see. Would it work if I do the opposite and use windows as base platform and cross compile to linux from there (maybe with mingw)?


It might. I’m not sure that it has been tried before. You’d also need to compile the thirdparty packages, of course, for which this script may help. And compiling from cygwin is probably going to help.

I don’t mean to discourage you; I think some have successfully compiled for Windows from Linux in the past. However, it will require some minor changes to the source and possibly to

Ok, thanks for the reply. I am giving up :stuck_out_tongue:
It is not really worth the effort!