Using Panda3D with codeblocks and mingw compiler

Hi all,

This is my first post and I will explain the topic.
I have just downloaded the windows 64bit version of Panda3D and installed it.

I don’t use Visual Studio as my ide but I do use Codeblocks and the mingw compiler.
I want to program in C++ and not python, but all the tutorials seem to be in python.

So from the manual I typed in the first example code for opening a window and did the includes.

#include “pandaFramework.h”
#include “pandaSystem.h”

Obviously the first error I get is that it can’t find these files. I haven’t tried a full path yet, because I am thinking I need to configure codeblocks for panda3D first.

Can anybody help me get panda3D working with codeblocks in windows 10?

Hi all,

Ok in the build project/build options under search directories I added
C:\Panda3D-1.9.2-x64\include

Now I don’t get the error on the includes but I get an error in another location
line 120 #include “pyconfig.h” no such file found.

So please read my first post, and I hope I can get some help getting this to work in codeblocks.

you can show all of the code?

Hi Serega,

I am using the code off this page
https://www.panda3d.org/manual/index.php?title=Starting_Panda3D&language=cxx

In the Search Directories I am including
C:\Panda3D-1.9.2-x64\include
C:\Panda3D-1.9.2-x64\python\include

Now I am getting the error
Line 185 fatal error: minmax.h: No such file or directory.

Does anybody on this forum use C++ in codeblocks on windows?

You need to adjust the linker, Linker settings add:

C:\Panda3D-1.9.2-x64\lib\libp3framework.lib
C:\Panda3D-1.9.2-x64\lib\libpanda.lib
C:\Panda3D-1.9.2-x64\lib\libpandaexpress.lib
C:\Panda3D-1.9.2-x64\lib\libp3dtool.lib
C:\Panda3D-1.9.2-x64\lib\libp3dtoolconfig.lib
C:\Panda3D-1.9.2-x64\lib\libp3pystub.lib
C:\Panda3D-1.9.2-x64\lib\libp3direct.lib

Hi serega,

I added all those libraries in project/build options/ Linker settings, but I am still getting the error.
minmax.h not found.

I have been using irrlicht for ages, and I am looking to panda3D because irrlicht is sadly lacking in some aspects, and so this is the first time I have ever used Panda.

I really want to use c++ because I have been programming in c++ for years and I have never used python before.

Unfortunately there are tons of setup videos on youtube for python but nothing for c++.

panda3d.org.ru/forum/13-325-1

:slight_smile:

Sorry forgot mingw compiler, no support panda3d.

So basically I have to install a different compiler to make it work?

Went to that site you gave me and it is all in Russian LOL.

Only Russian I know is Privet and das vydania heh heh

Perhaps I will have to install visual C++ and then use that compiler in codeblocks.

I don’t really like visual c++ though because it is terribly bloated.

Привет :slight_smile:

Yes

github.com/panda3d/panda3d

helpful information

Thanks will look at that soon. Gotta re-install panda3d anyway as I am on a different computer now.

I am feeling a little despondant.
I installed visual C++2010 hoping that would help.

I then set codeblocks to use the visual C++ 2010 compiler.
At first I had the error about not finding io.h and I solved that by including the VC include folder, and finally something was happening.

After a lenghy compile shot up the screen I finally get another error.
fatal error LNK1112: moudle machine type ‘x64’ conflictswith target machine type ‘x86’

I installed the 64bit version of codeblocks because I had a 64bit machine, so I wonder if I try the 32 bit version it might solve that error.

Would you believe I have spent quite a few days of failure so far heh heh.
I really want to port over a game I started in irrlicht.

The reason is not in the 64-bit version of codeblock. You must use C ++ 2010 compiler to 64bit.

Hi Serega,

It seems codeblocks is linking to the x86 sdk. So now I am installing the 64 bit microsoft sdk, and hopefully that will solve it.
Found this article here.
http://forums.codeblocks.org/index.php?topic=6801.0

I have my fingers crossed this will work :laughing:

PS. Been having trouble installing the 64 bit sdk. Keeps giving me an installation error nooooooooooooo
A problem occurred while installing selected Windows SDK components.

Installation of the “Microsoft Windows SDK for Windows 7” product has reported the following error: Please refer to Samples\Setup\HTML\ConfigDetails.htm document for further information.

Please attempt to resolve the problem and then start Windows SDK setup again. If you continue to have problems with this issue, please visit the SDK team support page at go.microsoft.com/fwlink/?LinkId=130245.

This is a nightmare

From these problems have a common recommendation.

Remove Microsoft .NET Framework, which is higher than version 4.

You can delete all completely. And just to put the Microsoft .NET Framework 4

Do you know what it was 10 years ago!

It seems that the problem with the parameters in kodeblok.

From the command line I was going okay.

I for myself have found a formula for trouble-free compilation.

Example WIN 7, 64bit.

step 1. Delete all version Microsoft .NET Framework.
step 2. Install Microsoft.NET Framework 4.
step 3. Install SDKs v7.1.
step 4. Panda3d compile from source.

step 5. Create file game.cpp

insert:

#include “C:\built_x64\include\pandaFramework.h”
#include “C:\built_x64\include\pandaSystem.h”
int main(int argc, char *argv[]) {
//open a new window framework
PandaFramework framework;
framework.open_framework(argc, argv);
//set the window title to My Panda3D Window
framework.set_window_title(“My Panda3D Window”);
//open the window
WindowFramework *window = framework.open_window();
//here is room for your own code
//do the main loop, equal to run() in python
framework.main_loop();
//close the window framework
framework.close_framework();
return (0);
}

step 6. Create file run.bat

insert:

call “C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd” /x64 /Release
cl /EHca Game.cpp C:\built_x64\lib\libp3framework.lib C:\built_x64\lib\libpanda.lib C:\built_x64\lib\libpandaexpress.lib C:\built_x64\lib\libp3dtool.lib C:\built_x64\lib\libp3dtoolconfig.lib C:\built_x64\lib\libp3pystub.lib C:\built_x64\lib\libp3direct.lib
pause

If the assembly is normal. The problem with the IDE

Thanks will give it a go when I get my computer back from rendering.
I am rendering some 8000px * 4000px renders in 3ds max.

When that finishes I will give this a go.