Re: Compiler error in necpp

David Haller <[email protected]> Sun, 15 Nov 2009 23:53:46 +0100
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Hallo,

Am Son, 15 Nov 2009, Sascha 'saigkill' Manns schrieb:
>Am Sonntag 15 November 2009 22:20:49 wrote David Haller:
>> Am Son, 15 Nov 2009, Sascha 'saigkill' Manns schrieb:
>> >c_geometry.cpp: In member function 'void
>> >c_geometry::geometry_complete(nec_context*, int, int)':
>> >c_geometry.cpp:505: error: 'uint32_t' was not declared in this scope
>> >Hat jemand ne Idee?
>> 
>> #include <cstdint>
>Woher weißt du sowas immer? 

Erfahrung / gutes Raten ;)

Fehler == unbekannter (hier) Typ
-> grep wo der definiert ist
-> #include <stdint.h>
-> bei C++ und libc-Headern wie stdint.h dann per
   #include <c${header_ohne_.h}> einbinden
 
>> oben bei den includes ergänzen. Wendest du eigentlich den
>>  debian-patch an? 
>Welchen meinst du?

necpp_1.4.0+cvs20091005-1.diff.gz

aus dem gleichen Verzeichnis wie die Quellen.

>>  Und sind das die Debian-Quellen
>>  necpp_1.4.0+cvs20091005.orig.tar.gz?
>Ja, ich habe die Sourcen neu gepackt als tar.bz2 ohne orig.
>
>Jetzt will er meinen Patch nicht-
>
>Erstellt mit: quilt new necpp-compiler_errors.patch und quilt refresh -
>p0 necpp-compiler_errors.patch.
[..]
>Der Patch (anbei) müsste doch konform sein...

Seltsam. Der Patch schaut ok aus. Und läßt sich hier auch problemlos
auch mit --fuzz=0 einspielen. Ändert evtl. einer der vorhergehenden
Patches was an der Datei? der Debian-patch fügt IIRC noch <cstdlib>
ein. Ah. Gefunden. necpp-g++.patch ist die Ursache (und sowieso
überarbeitungswürdig):

====
diff -uNrp necpp-1.3.0+cvs20090101/src/c_geometry.cpp necpp-1.3.0+cvs20090101p/src/c_geometry.cpp  
--- necpp-1.3.0+cvs20090101/src/c_geometry.cpp  2008-12-14 22:43:41.000000000 +0100  
+++ necpp-1.3.0+cvs20090101p/src/c_geometry.cpp 2009-04-12 19:44:25.000000000 +0200  
@@ -17,10 +17,10 @@  
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA  
 */  
 #include "c_geometry.h"  
-  
+#include <cstdlib>  
 #include "nec_context.h"  
 #include "nec_exception.h"  
-  
+#include <stdlib.h>  
 #include <cstring>  
   
 c_geometry::c_geometry()  
====

stdlib.h == cstdlib
stdarg.h == cstdarg
string.h == cstring

Am besten laß den ganzen Patch weg. Ich häng dir mal Ersatz an.

(mit -p1 einzuspielen)

HTH,
-dnh

-- 
Er will sie nicht?
Er, will sie nicht?
Er will, sie nicht?
Er will sie, nicht?    -- Sascha Broich
necpp-compiler_errors.patch (text/plain, 1.2 KB)
diff -u -urN -x *~ necpp-1.4.0+cvs20091005.orig/src/c_geometry.cpp necpp-1.4.0+cvs20091005/src/c_geometry.cpp
--- necpp-1.4.0+cvs20091005.orig/src/c_geometry.cpp	Tue Jan  6 05:34:08 2009
+++ necpp-1.4.0+cvs20091005/src/c_geometry.cpp	Sun Nov 15 23:38:37 2009
@@ -16,12 +16,14 @@
 	along with this program; if not, write to the Free Software
 	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
+#include <cstdlib>
+#include <cstdint>
+#include <cstring>
+
 #include "c_geometry.h"
 
 #include "nec_context.h"
 #include "nec_exception.h"
-
-#include <cstring>
 
 c_geometry::c_geometry()
 {
diff -u -urN -x *~ necpp-1.4.0+cvs20091005.orig/src/nec_exception.cpp necpp-1.4.0+cvs20091005/src/nec_exception.cpp
--- necpp-1.4.0+cvs20091005.orig/src/nec_exception.cpp	Tue Dec  9 00:39:27 2008
+++ necpp-1.4.0+cvs20091005/src/nec_exception.cpp	Sun Nov 15 23:49:51 2009
@@ -18,10 +18,11 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
  ***************************************************************************/
 
+#include <cstdlib>
+#include <cstdarg>
 
 #include "safe_array.h"
 #include "nec_exception.h"
-#include "stdarg.h"
 
 using namespace std;