Building Panda3D with OpenGL ES using Cygwin and MSVC9. Log

[color=red]Scroll to the bottom of this post for the most recent trouble I have encountered. Any suggestions would be appreciated

This documents my 4th attempt at compiling panda3d using ppremake. Its meant to log all the issues I cam across so other searching the the forums might make some use of it.


A few of the former errors I would get resolved around linker issues. The most annoying being the linker spitting up when encountering -outresource, saying that this was not supported. On this final attempt I did not encounter this. I am not sure why. I am assuming that I was infact using the wrong linker (indirectly), or had some other environment issue. If you have encountered the same thing I recommend you start from scratch and follow the instructions more carefully. Hopefully my log below is useful to someone.

My environment is cygwin using gcc 4. I am using also MSVC9. I’m compiling Panda 1.7.

1. Compiling ppremake

ERROR

T filename.o -MD -MP -MF .deps/filename.Tpo -c -o filename.o filename.cxx
filename.cxx: In member function `bool Filename::make_true_case()':
filename.cxx:841: error: `MAX_PATH' was not declared in this scope
filename.cxx:842: error: `DWORD' was not declared in this scope
filename.cxx:842: error: expected `;' before `l'
filename.cxx:843: error: `l' was not declared in this scope
filename.cxx:851: error: `l' was not declared in this scope
filename.cxx:854: error: `short_name' was not declared in this scope
filename.cxx:854: error: `long_name' was not declared in this scope
filename.cxx:854: error: `GetLongPathName' was not declared in this scope
filename.cxx: In member function `std::string Filename::to_os_short_name() cons
':
filename.cxx:984: error: `MAX_PATH' was not declared in this scope
filename.cxx:985: error: `DWORD' was not declared in this scope
filename.cxx:985: error: expected `;' before `l'
filename.cxx:986: error: `l' was not declared in this scope
filename.cxx:994: error: `l' was not declared in this scope
filename.cxx:996: error: `short_name' was not declared in this scope
filename.cxx: In member function `std::string Filename::to_os_long_name() const
:
filename.cxx:1018: error: `MAX_PATH' was not declared in this scope
filename.cxx:1019: error: `DWORD' was not declared in this scope
filename.cxx:1019: error: expected `;' before `l'
filename.cxx:1020: error: `l' was not declared in this scope
filename.cxx:1025: error: `l' was not declared in this scope
filename.cxx:1027: error: `long_name' was not declared in this scope
make[1]: *** [filename.o] Error 1

To resolve this I added the following to the top of filename.cxx

#include <windows.h>

2. Compiling dtool

Here is my Config.pp

///////////////////////////////////////////////////////////////////////
// Caution: there are two separate, independent build systems:
// 'makepanda', and 'ppremake'.  Use one or the other, do not attempt
// to use both.  This file is part of the 'ppremake' system.
///////////////////////////////////////////////////////////////////////

// This is a sample Config.pp that you may wish to use for your own
// needs.  For a longer list of configuration variables that you may
// set in your own Config.pp file, see dtool/Config.pp.

// What level of compiler optimization/debug symbols should we build?
// The various optimize levels are defined as follows:
//
//   1 - No compiler optimizations, full debug symbols
//   2 - Full compiler optimizations, full debug symbols
//         (if the compiler supports this)
//   3 - Full compiler optimizations, no debug symbols
//   4 - Full optimizations, no debug symbols, and asserts removed
//
// Setting this has no effect when BUILD_TYPE is "stopgap".  In this
// case, the compiler optimizations are selected by setting the
// environment variable OPTIMIZE accordingly at compile time.
#define OPTIMIZE 1



// If you have installed the DirectX SDK in a particular location on
// your machine (currently, Panda requires DirectX 8.1 in order to
// build the DirectX interfaces), then you must indicate that location
// here.  These two variables point to the include and lib
// directories, respectively.

// Note the use of the Panda filename convention, with forward slashes
// instead of backslashes, and /c/ instead of c:/ .
#define DX8_IPATH /c/DXSDK-OCT2004/include
#define DX8_LPATH /c/DXSDK-OCT2004/lib
#define DX9_IPATH /c/DXSDK-DEC2006/include
#define DX9_LPATH /c/DXSDK-DEC2006/lib

// If for any reason you need to turn off either the DX8 or DX9 builds,
// you can uncomment one of the following lines.  (Defining a
// variable to an empty string means setting it false.)
#define HAVE_DX8
#define HAVE_DX9
#define HAVE_GL
#define HAVE_CG
#define HAVE_TINYDISPLAY
#define GLES_IPATH /c/Imagination Technologies/POWERVR SDK/OGLES-1.1_WINDOWS_PCEMULATION_2.06.26.0649/Builds/OGLES/Include
#define GLES_LPATH /c/Imagination Technologies/POWERVR SDK/OGLES-1.1_WINDOWS_PCEMULATION_2.06.26.0649/Builds/OGLES/WindowsPC/Lib

#define OPENAL_IPATH /c/Program Files/OpenAL 1.1 SDK/include
#define OPENAL_LPATH /c/Program Files/OpenAL 1.1 SDK/lib/Win32
#define HAVE_OPENAL 1

#define PYTHON_IPATH /c/Python26/include
#define HAVE_THREADS 1
#define SIMPLE_THREADS 1

and here is the result

Root is /cygdrive/c/panda3d-1.7.0/dtool
Reading /cygdrive/c/panda3d-1.7.0/Config.pp (referred to by PPREMAKE_CONFIG)
Read 18 Sources.pp files.
Generating for MSVC7

Configuring support for the following optional third-party packages:
- Did not find OpenSSL
- Did not find libjpeg
- Did not find libpng
- Did not find libtiff
- Did not find libtar
- Did not find fftw
- Did not find squish
- Did not find Nvidia Cg High Level Shading Language
- Did not find Cg OpenGL API
- Did not find Cg DX8 API
- Did not find Cg DX9 API
- Did not find Cg DX10 API
- Did not find VRPN
- Did not find zlib
- Did not find Miles Sound System
- Did not find FMOD Ex sound library
+ OpenAL sound library
+ Ageia PhysX
- Did not find TinyXML
- Did not find gtk+-2
- Did not find Freetype
- Did not find WxWidgets
+ OpenGL ES 2
- Did not find DirectX8
- Did not find DirectX9
- Not building Tinydisplay
- Did not find X11
- Did not find Mesa
- Did not find OpenCV
- Did not find FFMPEG
- Did not find ODE
- Did not find AWESOMIUM
- Did not find OpenMaya
- Did not find FCollada
- Did not find ARToolKit

Compilation will generate Python interfaces.
Compilation will include simulated threading support.

See dtool_config.h for more details about the specified configuration.

Generating dtool_config.h
No errors.

Error 1: Standard include path is missing?

cd ./src/dtoolbase && make all
make[1]: Entering directory `/cygdrive/c/panda3d-1.7.0/dtool/src/dtoolbase'
cl /Fo"Opt1-Cygwin\dtoolbase_lookup3.obj" /nologo /c /I"." /I"C:\panda3d-1.7.0\d
tool" /I"C:\Python26\include"    /DHAVE_DINKUM /Zc:forScope /MDd   /Zi /Fd"Opt1-
Cygwin\dtoolbase_lookup3.pdb" /RTCs /GS /DBUILDING_DTOOL /EHsc /Zm500 /DWIN32_VC
 /DWIN32=1 /W3   "lookup3.c"
lookup3.c
C:\Python26\include\pyconfig.h(68) : fatal error C1083: Cannot open include file
: 'io.h': No such file or directory
make[1]: *** [Opt1-Cygwin/dtoolbase_lookup3.obj] Error 2
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/dtool/src/dtoolbase'
make: *** [dtoolbase] Error 2

Solution

Set the INCLUDE environment variable properly.

colinn@colinn-PC /cygdrive/c/panda3d-1.7.0/dtool
$ INCLUDE="C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE"\;"C:\Program Files\Microsoft SDKs\Windows\v7.1\Include"

colinn@colinn-PC /cygdrive/c/panda3d-1.7.0/dtool
$ export INCLUDE

Error 2: LINK syntax error

link /nologo /DLL  /DEBUG  /MAP /MAPINFO:EXPORTS /MAPINFO:LINES /fixed:no /incre
mental:no /stack:4194304 /NODEFAULTLIB:LIBCI.LIB /NODEFAULTLIB:MSVCRT.LIB  /OUT:
"Opt1-Cygwin\libdtool_d.dll" Opt1-Cygwin/dtool_dtool.obj ../../src/dtoolutil/Opt
1-Cygwin/dtoolutil_gnu_getopt.obj ../../src/dtoolutil/Opt1-Cygwin/dtoolutil_gnu_
getopt1.obj ../../src/dtoolutil/Opt1-Cygwin/dtoolutil_dtoolutil_composite1.obj .
./../src/dtoolutil/Opt1-Cygwin/dtoolutil_dtoolutil_composite2.obj ../../src/dtoo
lbase/Opt1-Cygwin/dtoolbase_lookup3.obj ../../src/dtoolbase/Opt1-Cygwin/dtoolbas
e_indent.obj ../../src/dtoolbase/Opt1-Cygwin/dtoolbase_dtoolbase_composite1.obj
../../src/dtoolbase/Opt1-Cygwin/dtoolbase_dtoolbase_composite2.obj  shell32.lib
LINK : fatal error LNK1117: syntax error in option 'MAPINFO:LINES'
make[1]: *** [Opt1-Cygwin/libdtool_d.dll] Error 93
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/dtool/metalibs/dtool'
make: *** [dtool] Error 2

Solution: Set USE_COMPILER properly

In Config.pp, add the line

#define USE_COMPILER MSVC9

Error 3: Linker Library Path no set

make[1]: Entering directory `/cygdrive/c/panda3d-1.7.0/dtool/metalibs/dtool'
link /nologo /DLL  /DEBUG  /MAP /MAPINFO:EXPORTS /fixed:no /incremental:no /stac
k:4194304 /NODEFAULTLIB:LIBCI.LIB /NOD:MFC80.LIB /NOD:libcmtd /NOD:libc /NODEFAU
LTLIB:MSVCRT.LIB  /OUT:"Opt1-Cygwin\libdtool_d.dll" Opt1-Cygwin/dtool_dtool.obj
../../src/dtoolutil/Opt1-Cygwin/dtoolutil_gnu_getopt.obj ../../src/dtoolutil/Opt
1-Cygwin/dtoolutil_gnu_getopt1.obj ../../src/dtoolutil/Opt1-Cygwin/dtoolutil_dto
olutil_composite1.obj ../../src/dtoolutil/Opt1-Cygwin/dtoolutil_dtoolutil_compos
ite2.obj ../../src/dtoolbase/Opt1-Cygwin/dtoolbase_lookup3.obj ../../src/dtoolba
se/Opt1-Cygwin/dtoolbase_indent.obj ../../src/dtoolbase/Opt1-Cygwin/dtoolbase_dt
oolbase_composite1.obj ../../src/dtoolbase/Opt1-Cygwin/dtoolbase_dtoolbase_compo
site2.obj  shell32.lib  ; mt -nologo -manifest Opt1-Cygwin/libdtool_d.dll.manife
st -outputresource:Opt1-Cygwin/libdtool_d.dll\;2
LINK : fatal error LNK1181: cannot open input file 'shell32.lib'
/bin/sh: mt: command not found
make[1]: *** [Opt1-Cygwin/libdtool_d.dll] Error 127
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/dtool/metalibs/dtool'
make: *** [dtool] Error 2

Solution: EXPORT Library path

$ export LIB="C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB"\;"C:\Program
 Files\Microsoft SDKs\Windows\v7.1\lib"

Error 4: Unresolved python symbols

   Creating library Opt2-Cygwin\libdtool_d.lib and object Opt2-Cygwin\libdtool_d
.exp
dtoolutil_dtoolutil_composite1.obj : error LNK2019: unresolved external symbol _
_imp___Py_Dealloc referenced in function "public: struct _object * __thiscall Fi
lename::__reduce__(struct _object *)const " (?__reduce__@Filename@@QBEPAU_object
@@PAU2@@Z)
dtoolutil_dtoolutil_composite1.obj : error LNK2019: unresolved external symbol _
_imp___Py_NegativeRefcount referenced in function "public: struct _object * __th
iscall Filename::__reduce__(struct _object *)const " (?__reduce__@Filename@@QBEP
AU_object@@PAU2@@Z)
dtoolutil_dtoolutil_composite1.obj : error LNK2001: unresolved external symbol _
_imp___Py_RefTotal
Opt2-Cygwin\libdtool_d.dll : fatal error LNK1120: 3 unresolved externals

mt.exe : general error c101008d: Failed to write the updated manifest to the res
ource of file "Opt2-Cygwin/libdtool_d.dll". The system cannot find the file spec
ified.
make[1]: *** [Opt2-Cygwin/libdtool_d.dll] Error 31
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/dtool/metalibs/dtool'
make: *** [dtool] Error 2

[color=red]Solution: … None Yet

I don’t know where to find the proper python26_d.lib so for the time being I changed the optimization level of the build to 3 (no debug symbols)

In Config.pp
#define OPTIMIZE 3

Compiling panda:

Error: Cannot run interrogate because libdtool.dll cannot be found.

I had tried setting LD_LIBRARY_PATH and LIBPATH to both C:\Panda3d-1.7.0 and /cygdrive/c/panda3d-1.7.0 with no luck. I most likely goofed something up here but instead I…

Solution: Hack by moving dlls to the exe dir

cp lib/*.dll bin

Error: Incorrect OpenAL include paths

Panda expects al.h to be under AL whereas the OpenAL SDK just places it at include. Furthermore, my OPENAL_IPATH doesnt not seem to be in the build command

make[1]: Entering directory `/cygdrive/c/panda3d-1.7.0/panda/src/audiotraits'
cl /Fo"Opt3-Cygwin\p3openal_audio_openal_audio_composite1.obj" /nologo /c /I"."
/I"C:\panda3d-1.7.0\panda" /I"..\audio" /I"..\downloader" /I"..\event" /I"..\exp
ress" /I"..\gobj" /I"..\gsgbase" /I"..\linmath" /I"..\mathutil" /I"..\movies" /I
"..\nativenet" /I"..\net" /I"..\pandabase" /I"..\pipeline" /I"..\pnmimage" /I"..
\pstatclient" /I"..\putil" /I"C:\panda3d-1.7.0\include" /I"C:\Python26\include"
  /DFORCE_INLINING /DHAVE_DINKUM /Zc:forScope /MD /O2 /Ob2 /Zi /Fd"Opt3-Cygwin\p
3openal_audio_openal_audio_composite1.pdb" /DBUILDING_OPENAL_AUDIO /EHsc /Zm500
/DWIN32_VC /DWIN32=1 /W3   "openal_audio_composite1.cxx"
openal_audio_composite1.cxx
c:\panda3d-1.7.0\panda\src\audiotraits\openalAudioManager.h(34) : fatal error C1
083: Cannot open include file: 'AL/al.h': No such file or directory
make[1]: *** [Opt3-Cygwin/p3openal_audio_openal_audio_composite1.obj] Error 2
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/panda/src/audiotraits'
make: *** [audiotraits] Error 2

Solution

[color=red]No real solution yet. Since it was just head libraries I copied them over to another directory that was in the include path. In this case C:\Panda3d-1.7\include

Error: Incorrect OpenAL library paths

Same as above.

link /nologo /DLL  /DEBUG  /MAP /MAPINFO:EXPORTS /fixed:no /incremental:no /stac
k:4194304 /NODEFAULTLIB:LIBCI.LIB /NOD:MFC80.LIB /NOD:libcmtd /NOD:libc /NODEFAU
LTLIB:MSVCRTD.LIB /OPT:REF /NODEFAULTLIB:LIBCMT.LIB  /OUT:"Opt3-Cygwin\libp3open
al_audio.dll" Opt3-Cygwin/p3openal_audio_openal_audio_composite1.obj /LIBPATH:".
.\..\metalibs\panda\Opt3-Cygwin" /LIBPATH:"..\..\metalibs\pandaexpress\Opt3-Cygw
in" /LIBPATH:"C:\panda3d-1.7.0\lib" /LIBPATH:"C:\Python26\libs" libpanda.lib lib
pandaexpress.lib libdtoolconfig.lib libdtool.lib user32.lib advapi32.lib winmm.l
ib libopenal.lib wsock32.lib  ; mt -nologo -manifest Opt3-Cygwin/libp3openal_aud
io.dll.manifest -outputresource:Opt3-Cygwin/libp3openal_audio.dll\;2
LINK : fatal error LNK1181: cannot open input file 'libopenal.lib'

Opt3-Cygwin/libp3openal_audio.dll.manifest : general error c1010070: Failed to l
oad and parse the manifest. The system cannot find the file specified.
make[1]: *** [Opt3-Cygwin/libp3openal_audio.dll] Error 31
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/panda/src/audiotraits'
make: *** [audiotraits] Error 2

Solution

[color=red]No real solution yet. Copied over to C:\Panda3d-1.7\lib. Maybe I am supposed to use a different version of OpenAL.

NOTE: The same issue happened with the GLES include/lib files.

[color=green][size=200]=========================================
Current Error[/size]

[b]Error: PFNGLFRAMEBUFFERTEXTURE3DOES Redefinition, inconsistent dll linkage[b]

cl /Fo"Opt3-Cygwin\gles2gsg_config_gles2gsg.obj" /nologo /c /I"." /I"C:\panda3d-1.7.0\panda" /I"..\cull" /I"..\display" /I"..\downloader" /I"..\effects" /I"..\event" /I"..\express" /I"..\glstuff" /I"..\gobj" /I"..\gsgbase" /I"..\lerp" /I"..\linmath" /I"..\mathutil" /I"..\nativenet" /I"..\net" /I"..\pandabase" /I"..\pgraph" /I"..\pgraphnodes" /I"..\pipeline" /I"..\pnmimage" /I"..\pstatclient" /I"..\putil" /I"C:\panda3d-1.7.0\include" /I"C:\Python26\include" /I"C:\Python26\include"   /DFORCE_INLINING /DHAVE_DINKUM /Zc:forScope /MD /O2 /Ob2 /Zi /Fd"Opt3-Cygwin\gles2gsg_config_gles2gsg.pdb" /DBUILDING_PANDAGLES /EHsc /Zm500 /DWIN32_VC /DWIN32=1 /W3   "config_gles2gsg.cxx"
config_gles2gsg.cxx
c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.h(98) : error C2373: 'PFNGLFRAMEBUFFERTEXTURE3DOES' : redefinition; different type modifiers
        C:\panda3d-1.7.0\include\GLES2/gl2ext.h(411) : see declaration of 'PFNGLFRAMEBUFFERTEXTURE3DOES'
config_gles2gsg.cxx(21) : warning C4273: 'gles2gsg_cat' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(23) : see previous definition of 'gles2gsg_cat'
config_gles2gsg.cxx(21) : warning C4273: 'NotifyCategoryGetCategory_gles2gsg::NotifyCategoryGetCategory_gles2gsg' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(23) : see previous definition of '{ctor}'
config_gles2gsg.cxx(21) : warning C4273: 'NotifyCategoryGetCategory_gles2gsg::get_category' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(23) : see previous definition of 'get_category'
config_gles2gsg.cxx(36) : warning C4273: 'init_libgles2gsg' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(25) : see previous definition of 'init_libgles2gsg'
make[1]: *** [Opt3-Cygwin/gles2gsg_config_gles2gsg.obj] Error 2
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/panda/src/gles2gsg'

[color=red]No solution yet:

I’m really not sure what to make of this yet. I looked at the PFNGLFRAMEBUFFERTEXTURE3DOES redefinition. In panda (gles2gsg) we have this

typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);

whereas in the gl2ext file we have this

typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);

Am I using the wrong gles? I got it from Imagination tech.

Here is what a search for gles2gsg_cat returns

src/egldisplay/eglGraphicsStateGuardian.cxx:  if (gles2gsg_cat.is_debug()) {
src/egldisplay/eglGraphicsStateGuardian.cxx:    gles2gsg_cat.debug()
src/gles2gsg/gles2gsg.h:#define GLCAT gles2gsg_cat
Binary file src/gles2gsg/Opt3-Cygwin/gles2gsg_config_gles2gsg.obj matches

Any idea on this?

You’re a brave man, to attempt to build a project of the size of Panda on a compilation environment that it has never built before on. Is there any particular reason you are doing this? There are many reasons to choose one compiler or another, of course, but on Windows we have never successfully built Panda on anything other than MSVC.

We did once, many years ago, attempt to build Panda on Windows using Cygwin gcc. That attempt failed miserably, due to gcc’s incomplete handling of Microsoft DLL export symbols. Perhaps that situation has improved by now, and you won’t run into the same issues that we ran into back then.

Still, all of these other issues you are running into are just the normal sorts of things you get when you first start using a new compilation environment. You’re the first one to run into each of these, because no one else has done what you’re doing. There will doubtless be many more issues before you’re done.

Is there any particular reason you’re using gcc instead of MSVC?

David

Hey, thanks for the reply.

I only used gcc for the ppremake tool. MSVC for the rest. I did previously try using MINGW gcc. The reason being I prefer the Eclipse IDE and the MINGW couldn’t link with the Panda MSVC Libs for some reason.

Ah, OK. My apologies for the confusion.

Some of your other problems:

Note that INCLUDE and LIB are part of your build environment and are supposed to be set by the vsvars.bat script or whatever equivalent you create for yourself in Cygwin.

One reliable way to get this is to download the Python source and build it yourself. But note that you don’t actually need to build a debug build if all you want is debug symbols; debug symbols are in fact provided in an OPTIMIZE 3 build. It’s a release build with debug symbols; that’s not a contradiction.

On Windows, you need to set the PATH variable instead of LD_LIBRARY_PATH.

This sounds like a bug in the ppremake scripts. Probably the ppremake build system has never been tested with OpenAL.

Is the only difference between these two the use of GL_APIENTRYP instead of APIENTRYP? Do those two symbols have different definitions? Strange. Well, you can comment out the one in Panda to allow the one in your gles headers to win.

David

Commenting that typedef out leads to the world ending:

c:\panda3d-1.7.0\panda\src\gles2gsg\gles2gsg.h(69) : warning C4005: 'APIENTRY' : macro redefinition
        C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\windef.h(126) : see previous definition of 'APIENTRY'
config_gles2gsg.cxx(21) : warning C4273: 'gles2gsg_cat' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(23) : see previous definition of 'gles2gsg_cat'
config_gles2gsg.cxx(21) : warning C4273: 'NotifyCategoryGetCategory_gles2gsg::NotifyCategoryGetCategory_gles2gsg' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(23) : see previous definition of '{ctor}'
config_gles2gsg.cxx(21) : warning C4273: 'NotifyCategoryGetCategory_gles2gsg::get_category' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(23) : see previous definition of 'get_category'
config_gles2gsg.cxx(36) : warning C4273: 'init_libgles2gsg' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\gles2gsg\config_gles2gsg.h(25) : see previous definition of 'init_libgles2gsg'
cl /Fo"Opt3-Cygwin\gles2gsg_gles2gsg.obj" /nologo /c /I"." /I"C:\panda3d-1.7.0\panda" /I"..\cull" /I"..\display" /I"..\downloader" /I"..\effects" /I"..\event" /I"..\express" /I"..\glstuff" /I"..\gobj" /I"..\
gles2gsg.cxx
c:\panda3d-1.7.0\panda\src\gles2gsg\gles2gsg.h(69) : warning C4005: 'APIENTRY' : macro redefinition
        C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\windef.h(126) : see previous definition of 'APIENTRY'
c:\panda3d-1.7.0\panda\src\glstuff\glmisc_src.cxx(161) : warning C4273: 'GLES2init_classes' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glmisc_src.h(45) : see previous definition of 'GLES2init_classes'
c:\panda3d-1.7.0\panda\src\glstuff\glTextureContext_src.cxx(17) : warning C4273: '_type_handle' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glTextureContext_src.h(58) : see previous definition of 'private: static TypeHandle GLES2TextureContext::_type_handle'
c:\panda3d-1.7.0\panda\src\glstuff\glTextureContext_src.cxx(17) : error C2491: 'GLES2TextureContext::_type_handle' : definition of dllimport static data member not allowed
c:\panda3d-1.7.0\panda\src\glstuff\glTextureContext_src.cxx(36) : warning C4273: 'GLES2TextureContext::evict_lru' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glTextureContext_src.h(28) : see previous definition of 'evict_lru'
c:\panda3d-1.7.0\panda\src\glstuff\glVertexBufferContext_src.cxx(15) : warning C4273: '_type_handle' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glVertexBufferContext_src.h(55) : see previous definition of 'private: static TypeHandle GLES2VertexBufferContext::_type_handle'
c:\panda3d-1.7.0\panda\src\glstuff\glVertexBufferContext_src.cxx(15) : error C2491: 'GLES2VertexBufferContext::_type_handle' : definition of dllimport static data member not allowed
c:\panda3d-1.7.0\panda\src\glstuff\glVertexBufferContext_src.cxx(33) : warning C4273: 'GLES2VertexBufferContext::evict_lru' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glVertexBufferContext_src.h(33) : see previous definition of 'evict_lru'
c:\panda3d-1.7.0\panda\src\glstuff\glIndexBufferContext_src.cxx(15) : warning C4273: '_type_handle' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glIndexBufferContext_src.h(53) : see previous definition of 'private: static TypeHandle GLES2IndexBufferContext::_type_handle'
c:\panda3d-1.7.0\panda\src\glstuff\glIndexBufferContext_src.cxx(15) : error C2491: 'GLES2IndexBufferContext::_type_handle' : definition of dllimport static data member not allowed
c:\panda3d-1.7.0\panda\src\glstuff\glIndexBufferContext_src.cxx(33) : warning C4273: 'GLES2IndexBufferContext::evict_lru' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glIndexBufferContext_src.h(31) : see previous definition of 'evict_lru'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.cxx(15) : warning C4273: '_type_handle' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.h(74) : see previous definition of 'private: static TypeHandle GLES2GeomContext::_type_handle'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.cxx(15) : error C2491: 'GLES2GeomContext::_type_handle' : definition of dllimport static data member not allowed
c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.cxx(23) : warning C4273: 'GLES2GeomContext::~GLES2GeomContext' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.h(32) : see previous definition of '{dtor}'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.cxx(39) : warning C4273: 'GLES2GeomContext::get_display_list' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.h(35) : see previous definition of 'get_display_list'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.cxx(70) : warning C4273: 'GLES2GeomContext::release_display_lists' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.h(37) : see previous definition of 'release_display_lists'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.cxx(105) : warning C4273: 'GLES2GeomContext::remove_munger' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomContext_src.h(39) : see previous definition of 'remove_munger'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(17) : warning C4273: '_type_handle' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(76) : see previous definition of 'private: static TypeHandle GLES2GeomMunger::_type_handle'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(17) : error C2491: 'GLES2GeomMunger::_type_handle' : definition of dllimport static data member not allowed
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(19) : warning C4273: '_deleted_chain' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(36) : see previous definition of 'public: static DeletedChain<GLES2GeomMunger> GLES2GeomMunger::_deleted_chain'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(19) : error C2491: 'GLES2GeomMunger::_deleted_chain' : definition of dllimport static data member not allowed
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(27) : warning C4273: 'GLES2GeomMunger::GLES2GeomMunger' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(34) : see previous definition of '{ctor}'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(52) : warning C4273: 'GLES2GeomMunger::~GLES2GeomMunger' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(35) : see previous definition of '{dtor}'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(71) : warning C4273: 'GLES2GeomMunger::wp_callback' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(38) : see previous definition of 'wp_callback'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(83) : warning C4273: 'GLES2GeomMunger::munge_format_impl' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(41) : see previous definition of 'munge_format_impl'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(225) : warning C4273: 'GLES2GeomMunger::premunge_format_impl' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(43) : see previous definition of 'premunge_format_impl'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(354) : warning C4273: 'GLES2GeomMunger::compare_to_impl' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(45) : see previous definition of 'compare_to_impl'
c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.cxx(378) : warning C4273: 'GLES2GeomMunger::geom_compare_to_impl' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glGeomMunger_src.h(46) : see previous definition of 'geom_compare_to_impl'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(24) : warning C4273: '_type_handle' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(95) : see previous definition of 'private: static TypeHandle GLES2ShaderContext::_type_handle'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(24) : error C2491: 'GLES2ShaderContext::_type_handle' : definition of dllimport static data member not allowed
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(54) : warning C4273: 'GLES2ShaderContext::GLES2ShaderContext' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(35) : see previous definition of '{ctor}'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(358) : warning C4273: 'GLES2ShaderContext::~GLES2ShaderContext' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(36) : see previous definition of '{dtor}'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(369) : warning C4273: 'GLES2ShaderContext::release_resources' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(78) : see previous definition of 'release_resources'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(424) : warning C4273: 'GLES2ShaderContext::bind' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(40) : see previous definition of 'bind'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(466) : warning C4273: 'GLES2ShaderContext::unbind' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(41) : see previous definition of 'unbind'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(507) : warning C4273: 'GLES2ShaderContext::issue_parameters' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(42) : see previous definition of 'issue_parameters'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(576) : warning C4273: 'GLES2ShaderContext::disable_shader_vertex_arrays' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(43) : see previous definition of 'disable_shader_vertex_arrays'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(614) : warning C4273: 'GLES2ShaderContext::update_shader_vertex_arrays' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(44) : see previous definition of 'update_shader_vertex_arrays'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(704) : warning C4273: 'GLES2ShaderContext::disable_shader_texture_bindings' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(46) : see previous definition of 'disable_shader_texture_bindings'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(765) : warning C4273: 'GLES2ShaderContext::update_shader_texture_bindings' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(47) : see previous definition of 'update_shader_texture_bindings'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(865) : warning C4273: 'GLES2ShaderContext::glsl_report_shader_errors' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(73) : see previous definition of 'glsl_report_shader_errors'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(888) : warning C4273: 'GLES2ShaderContext::glsl_report_program_errors' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(74) : see previous definition of 'glsl_report_program_errors'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(911) : warning C4273: 'GLES2ShaderContext::glsl_compile_entry_point' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(75) : see previous definition of 'glsl_compile_entry_point'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(949) : warning C4273: 'GLES2ShaderContext::glsl_compile_shader' : inconsistent dll linkage
        c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.h(76) : see previous definition of 'glsl_compile_shader'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(971) : error C2039: '_glProgramParameteri' : is not a member of 'GLES2GraphicsStateGuardian'

Beh, that’s because we’ve never tested this code on Windows.

I just looked at panda/metalibs/pandagles2/Sources.p and found this:

#define BUILDING_DLL BUILDING_PANDAGLES

I think that should be changed to this:

#define BUILDING_DLL BUILDING_PANDAGLES2

Could you try it with this change?

No problem! I don’t mind going through this process.

I get some new errors, which I can understand a little better. I’ll go through these later today.

c:\panda3d-1.7.0\panda\src\gles2gsg\gles2gsg.h(69) : warning C4005: 'APIENTRY' : macro redefinition
        C:\Program Files\Microsoft SDKs\Windows\v7.1\Include\windef.h(126) : see previous definition of 'APIENTRY'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(971) : error C2039: '_glProgramParameteri' : is not a member of 'GLES2GraphicsStateGuardian'
        c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.h(164) : see declaration of 'GLES2GraphicsStateGuardian'
c:\panda3d-1.7.0\panda\src\glstuff\glShaderContext_src.cxx(974) : error C2039: '_glProgramParameteri' : is not a member of 'GLES2GraphicsStateGuardian'
        c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.h(164) : see declaration of 'GLES2GraphicsStateGuardian'
c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsBuffer_src.cxx(190) : error C2065: 'GL_FRAMEBUFFER_INCOMPLETE_FORMATS' : undeclared identifier
c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsBuffer_src.cxx(190) : error C2051: case expression not constant
c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.cxx(958) : error C2440: '=' : cannot convert from 'void (__stdcall *)(GLuint,GLuint)' to 'PFNGLATTACHSHADERPROC'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.cxx(959) : error C2440: '=' : cannot convert from 'void (__stdcall *)(GLuint,GLuint,const char *)' to 'PFNGLBINDATTRIBLOCATIONPROC'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.cxx(960) : error C2440: '=' : cannot convert from 'void (__stdcall *)(GLuint)' to 'PFNGLCOMPILESHADERPROC'
        This conversion requires a reinterpret_cast, a C-style cast or function-style cast
c:\panda3d-1.7.0\panda\src\glstuff\glGraphicsStateGuardian_src.cxx(961) : error C2440: '=' : cannot convert from 'GLuint (__stdcall *)(void)' to 'PFNGLCREATEPROGRAMPROC'

(there are more of the same nature)

So what does the previous error, inconsistent DLL linkage typically mean? I haven’t come across this before.

I advise getting the latest CVS version of Panda3D. I think that it has many of these problems resolved (including the previous one, I’ve just checked in a fix to that).

As for what “Inconsistent DLL linkage” means - I don’t know the exact details, but it’s got something to do with __declspec(dllexport) and __declspec(dllimport) being used incorrectly. When compiling the headers, the classes are exported using dllexport, but when including the headers, dllimport is used.
We have this in panda/src/pandabase/pandasymbols.h:

#ifdef BUILDING_PANDAGLES2
  #define EXPCL_PANDAGLES2 __declspec(dllexport)
  #define EXPTP_PANDAGLES2
#else
  #define EXPCL_PANDAGLES2 __declspec(dllimport)
  #define EXPTP_PANDAGLES2 extern
#endif

So when BUILDING_PANDAGLES2 is not correctly defined when building this code, it gets compiled using the wrong keyword.

In the case of non-Windows, these symbols are not necessary and defined to nothing, that’s why I’ve never spotted the mistake before.

Interesting. Thanks for the explanation. I’ll pull the latest from CVS and recompile and post the results.

Hey.

I got the source from CVS and fixed errors as I went. These were mostly just casting of types. I got to the point where I’m compiling the code under panda/egldisplay. Unfortunately it all seems to be X11 dependent. Should this directory be included in the build process?

Colin

Feel free to send me a patch and I’ll apply it to CVS.

As for egldisplay - eh, it’s really made for X11. What we should really do is remove the X11-specific stuff, and make the classes inherit from classes in x11display or from windisplay based on ifdefs - as opposed to directly inheriting from classes in display.

(egldisplay is basically a fork of glxdisplay, but later we’ve moved the X11-specific stuff from glxdisplay to x11display).

In that case, would it make sense to start over with glxdisplay and build in the egl specific stuff from egldisplay?

Hmm, maybe that’s easier indeed. If you really want to complicate making it easy, find the date in CVS in which egldisplay was created, and diff it to glxdisplay at that point, duplicate the current version of glxdisplay and use the diff to replace the GLX stuff with EGL stuff.
Of course, that’s only step one - step two would be to let it inherit from the windisplay code in the case of Windows.

I could help and separate out the code to make it easier for you, but I’m kind of swamped this weekend, so that would have to wait a few days.

Hello.

Could you help me out with the following linker errors?


link /nologo /DLL  /DEBUG  /MAP /MAPINFO:EXPORTS /fixed:no /incremental:no /stack:4194304 /NODEFAULTLIB:LIBCI.LIB /NOD:MFC80.LIB /NOD:libcmtd /NOD:libc /NODEFAULTLIB:MSVCRTD.LIB /OPT:REF /NODEFAULTLIB:LIBCMT.LIB  /OUT:"Opt3-Cygwin\libframework.dll" Opt3-Cygwin/framework_framework_composite1.obj  /LIBPATH:"..\..\metalibs\panda\Opt3-Cygwin" /LIBPATH:"..\..\metalibs\pandaexpress\Opt3-Cygwin" /LIBPATH:"C:\panda3d-1.7.0\lib" /LIBPATH:"C:\Python26\libs" /LIBPATH:"C:\Python26\libs" libpanda.lib libpandaexpress.lib libdtoolconfig.lib libdtool.lib ws2_32.lib wsock32.lib
   Creating library Opt3-Cygwin\libframework.lib and object Opt3-Cygwin\libframework.exp
framework_framework_composite1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class DisplayRegion * __thiscall GraphicsOutput::make_mono_display_region(class LVecBase4f const &)" (__imp_?make_mono_display_region@GraphicsOutput@@QAEPAVDisplayRegion@@ABVLVecBase4f@@@Z) referenced in function "public: class NodePath __thiscall WindowFramework::get_render_2d(void)" (?get_render_2d@WindowFramework@@QAE?AVNodePath@@XZ)
framework_framework_composite1.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall Texture::do_unlock_and_reload_ram_image(bool)" (?do_unlock_and_reload_ram_image@Texture@@MAEX_N@Z)
framework_framework_composite1.obj : error LNK2001: unresolved external symbol "protected: virtual bool __thiscall Texture::do_can_reload(void)" (?do_can_reload@Texture@@MAE_NXZ)
framework_framework_composite1.obj : error LNK2001: unresolved external symbol "public: virtual class PointerTo<class TextFont> __thiscall StaticTextFont::make_copy(void)const " (?make_copy@StaticTextFont@@UBE?AV?$PointerTo@VTextFont@@@@XZ)
framework_framework_composite1.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class DisplayRegion * __thiscall GraphicsOutput::make_display_region(class LVecBase4f const &)" (__imp_?make_display_region@GraphicsOutput@@QAEPAVDisplayRegion@@ABVLVecBase4f@@@Z) referenced in function "protected: class GraphicsOutput * __thiscall WindowFramework::open_window(class WindowProperties const &,int,class GraphicsEngine *,class GraphicsPipe *,class GraphicsStateGuardian *)" (?open_window@WindowFramework@@IAEPAVGraphicsOutput@@ABVWindowProperties@@HPAVGraphicsEngine@@PAVGraphicsPipe@@PAVGraphicsStateGuardian@@@Z)
Opt3-Cygwin\libframework.dll : fatal error LNK1120: 5 unresolved externals
make[1]: *** [Opt3-Cygwin/libframework.dll] Error 96
make[1]: Leaving directory `/cygdrive/c/panda3d-1.7.0/panda/src/framework'
make: *** [framework] Error 2

colinn@colinn-PC /cygdrive/c/panda3d-1.7.0/panda
$ nm metalibs/panda/Opt3-Cygwin/libpanda.lib | grep do_unlock_and_reload_ram_image
00000000 T ?do_unlock_and_reload_ram_image@Texture@@IAEX_N@Z
00000000 I __imp_?do_unlock_and_reload_ram_image@Texture@@IAEX_N@Z

libpanda.lib is in the library list, and (in example) do_unlock_and_reload_ram_image@Texture is a symbol in that lib. So I’m guessing this is some abstract function? Any tips before I start going through the code more thoroughly?

This isn’t an issue with abstract functions or anything like this. I think it might be related to the DLL symbols again: Microsoft’s nutty DLL-import scheme requires symbols that are imported from another DLL to be prefixed with _imp, and symbols that are local to this DLL are not meant to be prefixed.

This is why you see the _imp prefix on do_unlock_and_reload_ram_image@Texture in the output of nm. (You should get used to using dumpbin /exports instead of nm; I think it’s more reliable on Windows.)

It’s suspicious that the _imp prefix is absent when the error message is reported by link. Almost as if BUILDING_PANDA had been defined when compiling some parts of the framework directory. Make sure that BUILDING_xxx is only defined when compiling the code that is going to go into library xxx.

David

Hey.

I finally got my new lib ‘wegldisplay’ compiling and linking properly. I used ‘egldisplay’ and ‘wgldisplay’ as bases for this. I have a pandagles2.lib file but no wegl[2]display.lib.

My Sources.pp for wegldisplay looks like this

#define BUILD_DIRECTORY $[HAVE_WEGL]

#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
                   dtoolutil:c dtoolbase:c dtool:m

#begin lib_target
  #define TARGET wegldisplay
  #define EXTRA_CDEFS OPENGLES_1
  #define LOCAL_LIBS \
    glesgsg display putil windisplay
	
  #define COMPONENT_LIBS \
    windisplay
	
	
  #define SOURCES \
    config_wegldisplay.cxx config_wegldisplay.h \
    weglGraphicsBuffer.h weglGraphicsBuffer.cxx \
    weglGraphicsPipe.I weglGraphicsPipe.cxx weglGraphicsPipe.h \
    weglGraphicsPixmap.h weglGraphicsPixmap.cxx \
    weglGraphicsWindow.h weglGraphicsWindow.cxx \
    weglGraphicsStateGuardian.h weglGraphicsStateGuardian.cxx

  #define INSTALL_HEADERS \
    weglGraphicsBuffer.h weglGraphicsPixmap.h \
    weglGraphicsPipe.I weglGraphicsPipe.h \
    weglGraphicsWindow.I weglGraphicsWindow.h
	
	#define WIN_SYS_LIBS \
		EGL GLESv2 $[WIN_SYS_LIBS]

#end lib_target

#begin lib_target
  #define TARGET wegldisplay
  #define EXTRA_CDEFS OPENGLES_2
  #define LOCAL_LIBS \
    gles2gsg display putil windisplay

  #define SOURCES \
    config_wegldisplay.cxx config_wegldisplay.h \
    weglGraphicsBuffer.h weglGraphicsBuffer.cxx \
    weglGraphicsPipe.I weglGraphicsPipe.cxx weglGraphicsPipe.h \
    weglGraphicsPixmap.h weglGraphicsPixmap.cxx \
    weglGraphicsWindow.h weglGraphicsWindow.cxx \
    weglGraphicsStateGuardian.h weglGraphicsStateGuardian.cxx

  #define INSTALL_HEADERS \
    weglGraphicsBuffer.h weglGraphicsPixmap.h \
    weglGraphicsPipe.I weglGraphicsPipe.h \
    weglGraphicsWindow.I weglGraphicsWindow.h
	
	#define WIN_SYS_LIBS \
		EGL GLESv2 $[WIN_SYS_LIBS]

#end lib_target

My Config.prc (in the etc folder) looks like this:

load-display pandagles
load-display pandagles2

I think I need help with the Config.pp files in general. I had the following error:

Cycle detected in inter-directory dependencies!
wegldisplay depends on pandagles2
pandagles2 depends on wegldisplay

When I had the second #define TARGET in wegldisplay/Sources.pp set as wegl2display. I understand what the error means, just not how to resolve it. I seem to have the same thing that egldisplay has (more or less)

Any help would be greatly appreciated. Thanks!

Hmm, that’s weird. I assume you’ve added the right code to panda/metalibs/pandagles2 and panda/metalibs/pandagles already?

Maybe you’re accidentally including pandagles2.h in your code, or so?

If not, you could try calling “make cleanall” within the wegldisplay and pandagles2 directories, and invoking “ppremake” and “make install” in wegldisplay and pandagles2, respectively.

I don’t include pangles directly. Would you mind taking a quick look at my changes? They are fairly small. I would appreciate a hand since I’m not clear on the build system.

I uploaded my work here if you are interested:

bitbucket.org/colinn/panda3d_wegldisplay

ppremake determines directory dependency order based on the LOCAL_LIBS lines in each Sources.pp. You can also use ppremake -d dirname or ppremake -r dirname to output the forward and reverse dependencies of a particular directory, if it helps you track this down. But in general, the error message is telling you that wegldisplay is directly or indirectly linking with a library built by pandagles2, and vice-versa.

David

Cool, thanks David. I’ve found the error and fixed it.

Should my wegldisplay be generating a lib? It creates object files and installs a header.