How to create window in C++?

I have been using using Panda3D with python till now. I realised that there is a C++ version also. So I tried to make a (basic) window in C++. I downloaded the SDK and copied the include folder to my C++ workspace. I then took code from online, that makes a basic window. I copy-pasted this program from the Panda3D documentation. However this error comes up:

fatal error C1083: Cannot open include file: 'pandaFramework.h': No such file or directory

EDIT: I found out that you have to build it. I have built it and installed it, what next, I still get the error.

You don’t have to build Panda from source; you can just use the SDK .exe from the download page.

You do need to follow the instructions here to set your Include Directories and Library Directories properly:
https://docs.panda3d.org/1.10/cpp/introduction/running-your-program

I did follow the steps. The only difference is that I am using CLion. Surely that isn’t the problem. I think I have to include other libraries from lib, which ones though? I keep getting this error:

Scanning dependencies of target untitled
[ 50%] Building CXX object CMakeFiles/untitled.dir/Panda3D.cxx.obj
Panda3D.cxx
[100%] Linking CXX executable untitled.exe
LINK Pass 1: command "C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\untitled.dir\objects1.rsp /out:untitled.exe /implib:untitled.lib /pdb:C:\Users\avishah\CLionProjects\untitled\cmake-build-debug\untitled.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\untitled.dir/intermediate.manifest CMakeFiles\untitled.dir/manifest.res" failed (exit code 1120) with the following output:
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall ReferenceCount::unref(void)const " (?unref@ReferenceCount@@UBE_NXZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class TypeHandle __thiscall PerspectiveLens::get_type(void)const " (?get_type@PerspectiveLens@@UBE?AVTypeHandle@@XZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class TypeHandle __thiscall PerspectiveLens::force_init_type(void)" (?force_init_type@PerspectiveLens@@UAE?AVTypeHandle@@XZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class ReferenceCount * __thiscall TypedWritableReferenceCount::as_reference_count(void)" (?as_reference_count@TypedWritableReferenceCount@@UAEPAVReferenceCount@@XZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class PointerTo<class Lens> __thiscall PerspectiveLens::make_copy(void)const " (?make_copy@PerspectiveLens@@UBE?AV?$PointerTo@VLens@@@@XZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall PerspectiveLens::is_linear(void)const " (?is_linear@PerspectiveLens@@UBE_NXZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall PerspectiveLens::is_perspective(void)const " (?is_perspective@PerspectiveLens@@UBE_NXZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall PerspectiveLens::do_extrude_depth(class Lens::CData const *,class LPoint3f const &,class LPoint3f &)const " (?do_extrude_depth@PerspectiveLens@@MBE_NPBVCData@Lens@@ABVLPoint3f@@AAV4@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall PerspectiveLens::do_compute_projection_mat(class Lens::CData *)" (?do_compute_projection_mat@PerspectiveLens@@MAEXPAVCData@Lens@@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual float __thiscall PerspectiveLens::fov_to_film(float,float,bool)const " (?fov_to_film@PerspectiveLens@@MBEMMM_N@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual float __thiscall PerspectiveLens::fov_to_focal_length(float,float,bool)const " (?fov_to_focal_length@PerspectiveLens@@MBEMMM_N@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual float __thiscall PerspectiveLens::film_to_fov(float,float,bool)const " (?film_to_fov@PerspectiveLens@@MBEMMM_N@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Lens::is_orthographic(void)const " (?is_orthographic@Lens@@UBE_NXZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class PointerTo<class Geom> __thiscall Lens::make_geometry(void)" (?make_geometry@Lens@@UAE?AV?$PointerTo@VGeom@@@@XZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual class PointerTo<class BoundingVolume> __thiscall Lens::make_bounds(void)const " (?make_bounds@Lens@@UBE?AV?$PointerTo@VBoundingVolume@@@@XZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Lens::output(class std::basic_ostream<char,struct std::char_traits<char> > &)const " (?output@Lens@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Lens::write(class std::basic_ostream<char,struct std::char_traits<char> > &,int)const " (?write@Lens@@UBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@H@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall Lens::do_extrude(class Lens::CData const *,class LPoint3f const &,class LPoint3f &,class LPoint3f &)const " (?do_extrude@Lens@@MBE_NPBVCData@1@ABVLPoint3f@@AAV3@2@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall Lens::do_extrude_vec(class Lens::CData const *,class LPoint3f const &,class LVector3f &)const " (?do_extrude_vec@Lens@@MBE_NPBVCData@1@ABVLPoint3f@@AAVLVector3f@@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall Lens::do_project(class Lens::CData const *,class LPoint3f const &,class LPoint3f &)const " (?do_project@Lens@@MBE_NPBVCData@1@ABVLPoint3f@@AAV3@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_film_size(class Lens::CData *)" (?do_compute_film_size@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_focal_length(class Lens::CData *)" (?do_compute_focal_length@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_fov(class Lens::CData *)" (?do_compute_fov@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_aspect_ratio(class Lens::CData *)" (?do_compute_aspect_ratio@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_view_hpr(class Lens::CData *)" (?do_compute_view_hpr@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_view_vector(class Lens::CData *)" (?do_compute_view_vector@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_film_mat(class Lens::CData *)" (?do_compute_film_mat@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::do_compute_lens_mat(class Lens::CData *)" (?do_compute_lens_mat@Lens@@MAEXPAVCData@1@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Lens::write_datagram(class BamWriter *,class Datagram &)" (?write_datagram@Lens@@UAEXPAVBamWriter@@AAVDatagram@@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Lens::fillin(class DatagramIterator &,class BamReader *)" (?fillin@Lens@@MAEXAAVDatagramIterator@@PAVBamReader@@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TypedWritable::update_bam_nested(class BamWriter *)" (?update_bam_nested@TypedWritable@@UAEXPAVBamWriter@@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall TypedWritable::complete_pointers(class TypedWritable * *,class BamReader *)" (?complete_pointers@TypedWritable@@UAEHPAPAV1@PAVBamReader@@@Z)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall TypedWritable::require_fully_complete(void)const " (?require_fully_complete@TypedWritable@@UBE_NXZ)
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall TypedWritable::finalize(class BamReader *)" (?finalize@TypedWritable@@UAEXPAVBamReader@@@Z)
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl MemoryBase::operator delete(void *)" (__imp_??3MemoryBase@@SAXPAX@Z) referenced in function "public: virtual void * __thiscall PerspectiveLens::`scalar deleting destructor'(unsigned int)" (??_GPerspectiveLens@@UAEPAXI@Z)
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class BitMask<unsigned int,32> __cdecl BitMask<unsigned int,32>::lower_on(int)" (__imp_?lower_on@?$BitMask@I$0CA@@@SA?AV1@H@Z) referenced in function "void __cdecl `dynamic initializer for 'default_collision_node_collide_mask''(void)" (??__Edefault_collision_node_collide_mask@@YAXXZ)
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class BitMask<unsigned int,32> __cdecl BitMask<unsigned int,32>::bit(int)" (__imp_?bit@?$BitMask@I$0CA@@@SA?AV1@H@Z) referenced in function "void __cdecl `dynamic initializer for 'default_geom_node_collide_mask''(void)" (??__Edefault_geom_node_collide_mask@@YAXXZ)
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall PerspectiveLens::~PerspectiveLens(void)" (__imp_??1PerspectiveLens@@UAE@XZ) referenced in function "public: virtual void * __thiscall PerspectiveLens::`scalar deleting destructor'(unsigned int)" (??_GPerspectiveLens@@UAEPAXI@Z)
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall PandaFramework::PandaFramework(void)" (__imp_??0PandaFramework@@QAE@XZ) referenced in function _main
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall PandaFramework::~PandaFramework(void)" (__imp_??1PandaFramework@@UAE@XZ) referenced in function _main
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::open_framework(int &,char * * &)" (__imp_?open_framework@PandaFramework@@QAEXAAHAAPAPAD@Z) referenced in function _main
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::close_framework(void)" (__imp_?close_framework@PandaFramework@@QAEXXZ) referenced in function _main
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::set_window_title(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (__imp_?set_window_title@PandaFramework@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) referenced in function _main
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class WindowFramework * __thiscall PandaFramework::open_window(void)" (__imp_?open_window@PandaFramework@@QAEPAVWindowFramework@@XZ) referenced in function _main
Panda3D.cxx.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall PandaFramework::main_loop(void)" (__imp_?main_loop@PandaFramework@@QAEXXZ) referenced in function _main
Panda3D.cxx.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) int panda_version_1_11" (__imp_?panda_version_1_11@@3HA)
untitled.exe : fatal error LNK1120: 46 unresolved externals

Yes, you are now missing the library references, such as libpanda.lib. The list that you’ll need is also in the above manual page.

I don’t know how to set these in CLion, but I’m sure it’s possible.

Included the library:

#include "C:\ProgramFiles\Panda3D-1.11.0-x64\include\pandaFramework.h"
#include "C:\ProgramFiles\Panda3D-1.11.0-x64\include\pandaSystem.h"
#include "C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib"

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);
}

New error:

====================[ Build | untitled | Debug ]================================
C:\ProgramFiles\CLion\bin\cmake\win\bin\cmake.exe --build C:\Users\avishah\CLionProjects\untitled\cmake-build-debug --target untitled --
Scanning dependencies of target untitled
[ 50%] Building CXX object CMakeFiles/untitled.dir/Panda3D.cxx.obj
Panda3D.cxx
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(1): error C2059: syntax error: '<'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(2): error C2018: unknown character '0x60'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C3872: '0xae': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C2018: unknown character '0x14'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C2059: syntax error: 'bad suffix on number'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C2018: unknown character '0x8'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C3872: '0x2020': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C3872: '0x201d': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C3872: '0x2039': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C3873: '0x2039': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C2059: syntax error: ')'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C3872: '0x201a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C2018: unknown character '0x40'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C2018: unknown character '0x2'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(3): error C2018: unknown character '0xe'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(4): error C2018: unknown character '0xe'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x2030': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x2'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0xe'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x203a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x60'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xa4': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x16'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3873: '0x2020': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x2020': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x90': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x2039': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3873: '0xa2': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x201e': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xa0': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x10'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xa2': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x9d': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x2013': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xa9': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x3'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x14'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xac': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x12'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x2014': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x4': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x201a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x24': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x40'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3873: '0x2039': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xb0': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0xf'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xa7': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0xa6': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3873: '0xb0': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x1e'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C3872: '0x2026': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(5): error C2018: unknown character '0x7f'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(7): error C3872: '0x2026': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(7): error C3872: '0x201a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(7): error C2018: unknown character '0x1e'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(7): error C3872: '0x24': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(9): error C3872: '0x201a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(9): error C3872: '0x2020': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(9): error C2018: unknown character '0xe'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(9): error C3873: '0x2039': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(9): error C3872: '0x2039': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(9): error C3872: '0xbb': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(9): error C3872: '0x2030': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(10): error C3873: '0x2039': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(10): error C3872: '0x2030': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2018: unknown character '0x18'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0x201a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2018: unknown character '0x1e'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2018: unknown character '0xe'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0x2030': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2018: unknown character '0x14'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2018: unknown character '0x1c'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0xa6': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0xa5': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2018: unknown character '0x1'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0x2020': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0x2039': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3873: '0x2039': this character is not allowed as a first character of an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2018: unknown character '0x60'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0xb6': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C3872: '0x201e': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2059: syntax error: ':'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): error C2143: syntax error: missing ';' before '~'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(12): error C2588: '::~S': illegal global destructor
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(12): error C2143: syntax error: missing ';' before '~'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(12): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(12): error C2086: 'int S': redefinition
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(11): note: see declaration of 'S'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C2588: '::~ZO0ZO0~': illegal global destructor
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C2065: '~': undeclared identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C2018: unknown character '0x16'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C2065: 'v�': undeclared identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C2146: syntax error: missing ';' before identifier 'v�'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C3872: '0xb6': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C2018: unknown character '0x8'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C3872: '0xa6': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C3872: '0x2013': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C3872: '0x203a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C2018: unknown character '0x5'
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C3872: '0x4': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C3872: '0x201a': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): error C3872: '0x2020': this character is not allowed in an identifier
C:\ProgramFiles\Panda3D-1.11.0-x64\lib\libpanda.lib(13): fatal error C1003: error count exceeds 100; stopping compilation
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.

You need to add these paths in your compiler settings, not as header files in your source code.

I think you have to add

add_library(panda3d lib)

in the Cmake.txt. Am I right?

In CMake I think it’s more something like target_link_libraries.

add_library()
target_link_library()

None of these work, they raise an error.
Only this works without raising error in Cmake.txt:

link_directories()

But it raises error in my Panda3D.cxx.

EDIT:

link_libraries()

also works in CMake.txt, but not in Panda3D.cxx. But it raises a smaller error:

LINK Pass 1: command "C:\PROGRA~2\MICROS~2\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\untitled.dir\objects1.rsp /out:untitled.exe /implib:untitled.lib /pdb:C:\Users\avishah\CLionProjects\untitled\cmake-build-debug\untitled.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console lib.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\untitled.dir/intermediate.manifest CMakeFiles\untitled.dir/manifest.res" failed (exit code 1104) with the following output:
LINK : fatal error LNK1104: cannot open file 'lib.lib'
NMAKE : fatal error U1077: 'C:\ProgramFiles\CLion\bin\cmake\win\bin\cmake.exe' : return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\nmake.exe"' : return code '0x2'
Stop.

How are you using these functions? In particular target_link_libraries? Can you show it to me including the arguments?

CMake.txt:

cmake_minimum_required(VERSION 3.15)
project(untitled)

set(CMAKE_CXX_STANDARD 14)
add_library(lib)  //included in project folder, tried target_link_library(), link_directories(), link_libraries()
add_executable(untitled Panda3D.cxx)

You are using these functions wrong. Consult the CMake documentation to find out how to use target_link_libraries.