pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/42921: C++ namespace problems with xplanet



>Number:         42921
>Category:       pkg
>Synopsis:       C++ namespace problems with xplanet
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 05 02:00:00 +0000 2010
>Originator:     Steven Drake
>Release:        xplanet-1.2.1nb1
>Organization:
>Environment:
System: Linux idran 2.6.30 #2 PREEMPT Sun Aug 9 18:32:44 NZST 2009 i686 
pentium4 i386 GNU/Linux
Architecture: pentium4
Machine: i686
C library: GNU C Library stable release version 2.10.1
C compiler: cc (GCC) 4.4.1
>Description:
On glibc 2.10 systems the std:: namespace gets confused with the sgp4sdp4:: 
namespace because of the way the namespace is declared and sgp4sdp4.h is 
included.

Also a missing "cstdio" include.

>How-To-Repeat:
cd x11/xplanet ; bmake

g++ -DHAVE_CONFIG_H -I. -I..  -DDATADIR=\"/usr/pkg/share/xplanet\"  
-I/usr/pkg/include/freetype2 -I/usr/pkg/include -I/usr/pkg/include 
-I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/freetype2 -I/usr/pkg/include 
-I/usr/pkg/include/glib/glib-2.0 -I/usr/pkg/lib/glib-2.0/include    
-I/usr/pkg/include -I/usr/include -I/usr/pkg/include/freetype2  -O2 -pipe 
-march=i586 -mtune=generic -I/usr/pkg/include -I/usr/include 
-I/usr/pkg/include/freetype2 -MT Satellite.o -MD -MP -MF .deps/Satellite.Tpo -c 
-o Satellite.o Satellite.cpp
In file included from /usr/include/stdio.h:907,
                 from libsgp4sdp4/sgp4sdp4.h:15,
                 from Satellite.h:6,
                 from Satellite.cpp:10:
/usr/include/bits/stdio.h: In function 'int sgp4sdp4::vprintf(const char*, 
char*)':
/usr/include/bits/stdio.h:39: error: cannot convert 'sgp4sdp4::_IO_FILE*' to 
'FILE*' for argument '1' to 'int sgp4sdp4::vfprintf(FILE*, const char*, char*)'
/usr/include/bits/stdio.h: In function 'int sgp4sdp4::fgetc_unlocked(FILE*)':
/usr/include/bits/stdio.h:56: error: invalid use of incomplete type 'struct 
_IO_FILE'
/usr/include/stdio.h:45: error: forward declaration of 'struct _IO_FILE'
........

g++ -DHAVE_CONFIG_H -I. -I..  -DDATADIR=\"/usr/pkg/share/xplanet\"  
-I/usr/pkg/include/freetype2 -I/usr/pkg/include -I/usr/pkg/include 
-I/usr/pkg/include/pango-1.0 -I/usr/pkg/include/freetype2 -I/usr/pkg/include 
-I/usr/pkg/include/glib/glib-2.0 -I/usr/pkg/lib/glib-2.0/include    
-I/usr/pkg/include -I/usr/include -I/usr/pkg/include/freetype2  -O2 -pipe 
-march=i586 -mtune=generic -I/usr/pkg/include -I/usr/include 
-I/usr/pkg/include/freetype2 -MT Separation.o -MD -MP -MF .deps/Separation.Tpo 
-c -o Separation.o Separation.cpp
Separation.cpp: In member function 'void Separation::setSeparation(double)':
Separation.cpp:79: error: 'printf' was not declared in this scope
make: *** [Separation.o] Error 1

>Fix:
Best I can do as I don't know c++.

Index: pkgsrc/x11/xplanet/patches/patch-aa
===================================================================
--- /dev/null
+++ pkgsrc/x11/xplanet/patches/patch-aa
@@ -0,0 +1,15 @@
+$NetBSD$
+
+--- src/Satellite.h.orig       2006-03-25 22:50:51.000000000 +0000
++++ src/Satellite.h
+@@ -1,10 +1,7 @@
+ #ifndef SATELLITE_H
+ #define SATELLITE_H
+ 
+-namespace sgp4sdp4
+-{
+ #include "libsgp4sdp4/sgp4sdp4.h"
+-}
+ 
+ class Satellite
+ {
Index: pkgsrc/x11/xplanet/patches/patch-ab
===================================================================
--- /dev/null
+++ pkgsrc/x11/xplanet/patches/patch-ab
@@ -0,0 +1,23 @@
+$NetBSD$
+
+--- src/libsgp4sdp4/sgp4sdp4.h.orig    2006-03-25 22:50:51.000000000 +0000
++++ src/libsgp4sdp4/sgp4sdp4.h
+@@ -23,6 +23,10 @@ extern "C" {
+ #include <unistd.h>
+ #undef select
+ 
++#ifdef  __cplusplus
++namespace sgp4sdp4
++{
++#endif
+ 
+ 
+ /** Type definitions **/
+@@ -229,6 +233,7 @@ int     Sat_Eclipsed(vector_t *pos, vect
+ 
+ #ifdef __cplusplus
+ }
++}
+ #endif
+ 
+ #endif
Index: pkgsrc/x11/xplanet/patches/patch-ac
===================================================================
--- /dev/null
+++ pkgsrc/x11/xplanet/patches/patch-ac
@@ -0,0 +1,11 @@
+$NetBSD$
+
+--- src/Separation.cpp.orig    2008-11-14 00:19:05.000000000 +0000
++++ src/Separation.cpp
+@@ -1,5 +1,6 @@
+ #include <cmath>
+ #include <iostream>
++#include <cstdio>
+ 
+ #include "Separation.h"
+ #include "View.h"


-- 
Steven
I'm such a prick!  --- The Bastard Operator from Hell


Home | Main Index | Thread Index | Old Index