MathewWi / gl2gx

Automatically exported from code.google.com/p/gl2gx
0 stars 0 forks source link

Compiling gl2gx on devkitPro r19 and libogc 1.8.1 #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Use this patch on gl2gx.7z from the downloads section.

Original issue reported on code.google.com by stephen.george.west on 1 Mar 2010 at 7:41

Attachments:

GoogleCodeExporter commented 9 years ago
Silly of me to think that if it compiled it worked. Linker errors...

CON_StartDraw(), CON_StopDraw(), CON_CopyToFB(), and CON_FlipStipple() in 
gl2gx/source/glut.c cause linker errors. There are warning in the compilation 
about 
implicit declaration of these functions.  I can't find where they are defined, 
but 
they look similar to some functions in libogc/libogc/console.c . Google code 
search( 
http://www.google.com/codesearch?hl=en ) returns no results on these functions.

Also undefined reference to `__gxx_personality_v0'
This is caused by gl2gx/source/doreset.cpp containing "throw;" when linking to 
the 
library from a .c only project (like the example project glwin32wii.zip in the 
downloads).
Three solutions:
1) Programs that link to this library need to be compiled with g++ even if they 
only 
contain .c files.
   ie 
#-------------------------------------------------------------------------------
--
# use CXX for linking C++ projects, CC for standard C
#-------------------------------------------------------------------------------
--
ifeq ($(strip $(CPPFILES)),)
    export LD   :=  $(CXX)
else
    export LD   :=  $(CXX)
endif

2) Add libstdc++ to the list of libraries.
   ie LIBS  :=  -lgl2gx -lwiiuse -lbte -logc -lm -lstdc++

3) Change doreset.cpp to doreset.c, removing  ""C"" and "throw;"

Original comment by stephen.george.west on 2 Mar 2010 at 7:24

Attachments: