I'm unable to import headers after installing from source

I’d like to ask for help with setting up VS code for Panda. After installing Panda from source and running:

#include "pandaFramework.h"
#include "pandaSystem.h"


int main(int argc, char *argv[]) {
    PandaFramework framework;
    framework.open_framework(argc, argv);
    framework.set_window_title("basic game loop");
    WindowFramework *window = framework.open_window();
    framework.main_loop();
    //framework.close_framework();
    return 0;
}

I got error output:
fatal error: pandaFramework.h: No such file or directory

OS: Ubuntu Linux
compiler gcc std 11

I suspect my VS code isn’t correctly set up for Panda.

Any assistance is appreciated.

Hi coding_hedgehog,

I agree with your suspicions that your VS Code isn’t setup correctly.

I suspect you need to adjust your configuration to include the Panda3D include folder.

"includePath": ["${workspaceFolder}/**"],

This link might help too.

https://docs.panda3d.org/1.10/cpp/introduction/running-your-program#compiling-your-program-with-gcc-or-clang

Best of luck!

Thanks for that.

After setting it up and replacing what needed to be replaced Panda still can’t find the header files.
In my system headers files are in /usr/include/panda3d but running:
g++ -c main.cxx -o main.o -std=gnu++11 -O2 -I{/usr/include/panda3d/} just gives me:

fatal error: pandaFramework.h: No such file or directory even though the header file is physically there. I ran the ls command on /usr/include/panda3d:

So the header file is physically there the compiler just isn’t picking up on it. :thinking:

Try without the {} for the include.

g++ -c main.cxx -o main.o -std=gnu++11 -O2 -I/usr/include/panda3d/ 
1 Like

OK, that worked !
Now it throws 'Eigen/Dense' file not found.

It throws it after opening the lsimpleMatrix.h header file. That file isn’t in the directory.

I’m guessing you’re missing the Eigen third-party dependency?

https://docs.panda3d.org/1.10/cpp/introduction/building-from-source#building-panda3d-from-source

While building you’ll get a list of not found dependencies. Further descriptions of those can be found here: Dependencies.

https://docs.panda3d.org/1.10/cpp/distribution/thirdparty-licenses#eigen

I had it in my system. I had to create symlinks. The command now runs and compiles ! Thank you for your assistance H3llboy ! I now have main.o file in my directory. When I run it it gives me permission error. So close to actually make it work.

1 Like

Happy to help :slight_smile:

I might be misunderstanding, but you’re not trying to execute the .o file are you?

If so, read a bit further down the earlier link about compiling with gcc or clang.

1 Like

Thank you. It’s now running. You’ve been very helpful H3LLB0Y ! Can I send you a coffee ?

1 Like

Glad it’s working! :smiley:
Appreciate the offer, feel free to pay it forward to someone in need. :coffee: / :canned_food: