Hello,
This is related to the closed post in the forum for the installation of the same software called arachne, but with different error message:
In file included from ueberal/MiniSuperizer.cc:5:0:
./random/GnuRandom.h:54:5: error: �_G_uint32_t� does not name a type
_G_uint32_t u;
^
./random/GnuRandom.h:59:5: error: �_G_uint32_t� does not name a type
_G_uint32_t u[2];
^
./random/GnuRandom.h:73:13: error: �_G_uint32_t� does not name a type
virtual _G_uint32_t asLong() = 0;
It seems the error is related to the #ifndef ... #endif block at the very beginning, but I am not sure how to debug this.
33 #ifndef GNURANDOM
34 #ifdef __GNUG__
35 #pragma interface
36 #else
37 typedef int _G_int32_t
38 #endif
39 #define GNURANDOM
40
41 #include <math.h>
42 #ifdef __linux
43 #include <_G_config.h>
44 #else
45 #include "random/GnuTypes.h"
46 #include "random/GnuRandom.h"
47 #endif
48 #include "system/Assert.h"
49
50 // RNG.h
51
52 union PrivateRNGSingleType { // used to access floats as unsigneds
53 float s;
54 _G_uint32_t u;
55 };
56
57 union PrivateRNGDoubleType { // used to access doubles as unsigneds
58 double d;
59 _G_uint32_t u[2];
60 };
61
The whole header file is "GnuRandom.h" but renamed as "GnuRandom.txt" here and attached for your reference. My PC kernel is:
Linux HP32 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
There would be a simple change but I just do not know. Thank you in advance!
@achenle:
Embedded spaces in preprocessor #defines are always a cause of confusion and error...however the issue with the OP is one of supplying a compiler statement to a preprocessor...
That was a simple off-the-cuff example to demonstrate the semantic and syntax differences between "typedef" and "#define".
The fact that whitespace is treated completely differently in typedef and #define code is another reason to never replace typedef's with #define's.
If you read the link the OP provided, you'd see his problem is compiling. He's not feeding code to a preprocessor except as part of compiling. And I'd love to see a preprocessor so lame it couldn't handle typedef's, which are part of the language spec.
"Find out what's broken and fix it" is much better than "change this and hope it works".
Did some reading, it seems to me the problem is this part of the header:
#ifndef GNURANDOM
#ifdef __GNUG__
#pragma interface
#else
typedef int _G_int32_t ; //This is the problem line
#endif
#define GNURANDOM
#include <math.h>
#ifdef __linux
#include <_G_config.h>
#else
#include "random/GnuTypes.h"
#include "random/GnuRandom.h"
#endif
#include "system/Assert.h"
which probably is NOT standard unsigned integer type.
The #ifdef/ifndef and #pragma make me confused with my OS Linux HP32 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux I conceptually understand #ifdef/#ifndef , and #pragma , but not sure under my present OS whether they are defined or not. How should I fix this? Thanks a lot!
Thank you everybody!
After reading this post, finally I got a workaround by replacing the problematic line with this one:
typedef int int32_t ;
The problem may be related to the non-standard definitions of _G_int32_t and _G_uint32_t in the source code.
It worked after I made the replacements, anyway.