0

I am trying to compile this example application with panda3d c++ on the command line on windows. I installed the panda3d sdk in version 1.10. Dispite all necessary libraies are in the command ld fails to find the references. Why is g++ unable to find and link these?

g++:

g++ -w -c D:\Git\cpp-chess-panda3d\\src\\main.cpp -o D:\Git\cpp-chess-panda3d\\out\\out.o -std=gnu++11 -O2 -IC:\\Panda3D-1.10.13-x64\\include

g++ -w D:\Git\cpp-chess-panda3d\\out\\out.o -LC:\\Panda3D-1.10.13-x64\\bin -l:libp3framework.dll -l:libpanda.dll -l:libpandafx.dll -l:libpandaexpress.dll -l:libp3dtool.dll -l:libp3dtoolconfig.dll -l:libp3direct.dll

Panda3d hello-world:

#include "pandaFramework.h"
#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 and open the window
  framework.set_window_title("My Panda3D 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();
  framework.close_framework();
  return (0);
}

Error:

xxx@DESKTOP MINGW64 ~
$ g++ -w -c D:\\Git\\cpp-chess-panda3d\\src\\main.cpp -o D:\\Git\\cpp-chess-panda3d\\out\\out.o -std=gnu++11 -O2 -IC:\\Panda3D-1.10.13-x64\\include

xxx@DESKTOP MINGW64 ~
$ g++ -w D:\\Git\\cpp-chess-panda3d\\out\\out.o -LC:\\Panda3D-1.10.13-x64\\bin -l:libp3framework.dll -l:libpanda.dll -l:libpandafx.dll -l:libpandaexpress.dll -l:libp3dtool.dll -l:libp3dtoolconfig.dll -l:libp3direct.dll
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0x22): undefined reference to `BitMask<unsigned int, 32>::bit(int)'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0x89): undefined reference to `PandaFramework::PandaFramework()'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0xa1): undefined reference to `PandaFramework::open_framework(int&, char**&)'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0x122): undefined reference to `PandaFramework::open_window()'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0x12a): undefined reference to `PandaFramework::main_loop()'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0x132): undefined reference to `PandaFramework::close_framework()'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0x13a): undefined reference to `PandaFramework::~PandaFramework()'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.text.startup+0x154): undefined reference to `PandaFramework::~PandaFramework()'
c:/programdata/chocolatey/lib/mingw/tools/install/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: D:\Git\cpp-chess-panda3d\out\out.o:main.cpp:(.rdata$.refptr.panda_version_1_10[.refptr.panda_version_1_10]+0x0): undefined reference to `panda_version_1_10'
collect2.exe: error: ld returned 1 exit status

Daniel
  • 1
  • 1
  • 1
    Where did you get the panda dlls? – HolyBlackCat Mar 28 '23 at 18:30
  • `-l:libp3framework.dll` I know you can link a `.dll` instead of `.dll.a` / import library with g++ but is the `:lib` part correct? I don't claim to be an expert in g++. I use msvc for the paying job. – drescherjm Mar 28 '23 at 20:02

0 Answers0