Building Panda3D with OpenGL ES using Cygwin and MSVC9. Log

Return to Compiling or Editing the Panda Source

Building Panda3D with OpenGL ES using Cygwin and MSVC9. Log

Postby darkphoenix16 » Fri Nov 05, 2010 4:22 pm

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
Code: Select all
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

Code: Select all
#include <windows.h>


2. Compiling dtool

Here is my Config.pp

Code: Select all
///////////////////////////////////////////////////////////////////////
// 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

Code: Select all
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?

Code: Select all
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.

Code: Select all
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

Code: Select all
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

Code: Select all
#define USE_COMPILER MSVC9


Error 3: Linker Library Path no set

Code: Select all
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

Code: Select all
$ 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

Code: Select all
   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


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)


Code: Select all
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

Code: Select all
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

Code: Select all
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

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.

Code: Select all
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

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.

=========================================
Current Error



Error: PFNGLFRAMEBUFFERTEXTURE3DOES Redefinition, inconsistent dll linkage[b]

Code: Select all
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'


[b]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

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


whereas in the gl2ext file we have this

Code: Select all
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

Code: Select all
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?
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby drwr » Fri Nov 05, 2010 4:44 pm

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
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby darkphoenix16 » Fri Nov 05, 2010 5:26 pm

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.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby drwr » Fri Nov 05, 2010 8:46 pm

Ah, OK. My apologies for the confusion.

Some of your other problems:
Set the INCLUDE environment variable properly.

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.

I don't know where to find the proper python26_d.lib

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.

I had tried setting LD_LIBRARY_PATH and LIBPATH

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

Furthermore, my OPENAL_IPATH doesnt not seem to be in the build command

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

Am I using the wrong gles?

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
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby darkphoenix16 » Fri Nov 05, 2010 10:51 pm

Commenting that typedef out leads to the world ending:

Code: Select all
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'
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Sat Nov 06, 2010 2:58 am

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

I just looked at panda/metalibs/pandagles2/Sources.p and found this:
Code: Select all
#define BUILDING_DLL BUILDING_PANDAGLES

I think that should be changed to this:
Code: Select all
#define BUILDING_DLL BUILDING_PANDAGLES2

Could you try it with this change?
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Sat Nov 06, 2010 8:24 am

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.

Code: Select all
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.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Sat Nov 06, 2010 8:58 am

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:
Code: Select all
#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.
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Sat Nov 06, 2010 10:23 am

Interesting. Thanks for the explanation. I'll pull the latest from CVS and recompile and post the results.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby darkphoenix16 » Sat Nov 06, 2010 3:48 pm

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
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Sat Nov 06, 2010 4:23 pm

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).
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Sat Nov 06, 2010 4:38 pm

In that case, would it make sense to start over with glxdisplay and build in the egl specific stuff from egldisplay?
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Sat Nov 06, 2010 4:43 pm

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.
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Sun Nov 07, 2010 3:59 pm

Hello.

Could you help me out with the following linker errors?

Code: Select all

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?
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby drwr » Mon Nov 08, 2010 1:04 am

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
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Library build, pvew doesn't work

Postby darkphoenix16 » Wed Nov 10, 2010 7:43 am

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

Code: Select all
#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:

Code: Select all
load-display pandagles
load-display pandagles2


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

Code: Select all
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!
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Wed Nov 10, 2010 8:15 am

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.
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Wed Nov 10, 2010 9:22 am

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:

https://bitbucket.org/colinn/panda3d_wegldisplay
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby drwr » Wed Nov 10, 2010 9:49 am

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
drwr
 
Posts: 11425
Joined: Fri Feb 13, 2004 12:42 pm
Location: Glendale, CA

Postby darkphoenix16 » Wed Nov 10, 2010 9:55 am

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.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Wed Nov 10, 2010 10:14 am

Should we really have a separate wegldisplay? I was thinking of having egldisplay use the Windows interfaces in the case of Windows, and X11 in the case of Unix.
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Wed Nov 10, 2010 10:17 am

It doesn't matter to me. Once wegldisplay is working it should be easy to merge egl and wegl.

Note: eglDisplay should compile in windows (or at least it did). I found it easier to distance myself from that though to limit breakage points.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby darkphoenix16 » Wed Nov 10, 2010 4:04 pm

Another update. I merge the wegl code into egldisplay. It should still compile and link properly in Linux. If not there are probably a few small chagnes that need making.

Unfortunately pview still can't find a graphics pipe. Not sure what I am doing wrong.

UPDATE: I don't have many libs, like libp3framework.
Last edited by darkphoenix16 on Wed Nov 10, 2010 4:22 pm, edited 1 time in total.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Wed Nov 10, 2010 4:15 pm

Awesome, great job! I'd be happy to incorporate your changes and make sure it still works on Linux.

Do you have "load-display pandagles2" in Config.prc? Is there any warning saying that it couldn't be loaded?
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Wed Nov 10, 2010 4:39 pm

Here is my prc file

Code: Select all
load-display pandagles
load-display pandagles2
load-display egldisplay
load-display pandagl
notify-level-panagles3 spam


Here is the console output of pview

Code: Select all
colinn@colinn-PC /cygdrive/c/panda3d-1.7.0
$ pview
Known pipe types:
(all display modules loaded.)
No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.

colinn@colinn-PC /cygdrive/c/panda3d-1.7.0
$ which pview
/cygdrive/c/panda3d-1.7.0/bin/pview


I can't create a hello world app since I don't have libp3framework. So I must be missing something.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Wed Nov 10, 2010 4:49 pm

Hmm... two things could be wrong.

Firstly, try adding a "plugin-path" line to Config.prc pointing to the location of the directory that contains the pandagles dll.

Secondly, make sure the Config.prc file is loaded at all, by setting the PRC_DIR environment variable to the directory containing it.

PS. I also notice there's "panagles3" in your Config.prc file. Shouldn't that be "pandagles2"?
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Wed Nov 10, 2010 5:31 pm

(old post deleted)

I get a window now. My config.prc was in etc and I had used cygwin style paths for PRC_DIR instead of windows style paths.


Unfortunately it crashes, but at least its something.

Here is the log

Code: Select all
Known pipe types:
  weglGraphicsPipe
(all display modules loaded.)
:display:windisplay: OS version: 6.0.2.6002
:display:windisplay:   Service Pack 2
:display:windisplay: max Mhz 2800000000, current Mhz 2800000000
:display:egldisplay(error): eglChooseConfig failed: EGL_SUCCESS
:display:egldisplay(error): Failed to create window surface.
:display:gsg:gles2gsg(warning): Unable to query GL_VENDOR
:display: loading display module: libpandagles2.dll

darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Thu Nov 11, 2010 1:55 am

The error is thrown by this code:

Code: Select all
  int attrib_list[] = {
#ifdef OPENGLES_1
    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
#endif
#ifdef OPENGLES_2
    EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
#endif
    EGL_SURFACE_TYPE, EGL_DONT_CARE,
    EGL_NONE
  };

  int num_configs = 0;
  EGLConfig configs[32];
  if (!eglChooseConfig(_egl_display, attrib_list, configs, 32, &num_configs) || num_configs <= 0) {
    egldisplay_cat.error() << "eglChooseConfig failed: "
      << get_egl_error_string(eglGetError()) << "\n";
    return;
  }


Because eglGetError() apparently returns EGL_SUCCESS, I can assume that it just returns no available configs.

Are you sure that EGL is supposed to work? The code asks for a GLES2 renderable, does your device really support GLES2? Otherwise you should try the pandagles renderer.
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Postby darkphoenix16 » Thu Nov 11, 2010 9:35 am

It should work. I have some sample running from another project.

I've added file/line prints to the error cats.
darkphoenix16
 
Posts: 54
Joined: Wed Nov 03, 2010 11:22 am

Postby rdb » Thu Nov 11, 2010 10:20 am

Do you know what could be different between the Panda3D code and the sample code?
rdb
 
Posts: 9691
Joined: Mon Dec 04, 2006 5:58 am
Location: Netherlands

Next

Return to Compiling or Editing the Panda Source

Who is online

Users browsing this forum: No registered users and 0 guests