C: ctype_base.h errors with gcc 4

  • Thread starter neurocomp2003
  • Start date
  • Tags
    Errors Gcc
In summary: If that still doesn't produce the correct result, you might need to post more information about the build environment and the code you're trying to run.
  • #1
neurocomp2003
1,366
3
Hi all,
I was wondering if anyone has ever run into ctype_base.h errors
like:
'<anonymous enum>' is/uses anonymous type.'
error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'

some sites that i have visited
say its an error with gcc4

GUI-mandriva
sfwr-charm++ for NchiladaNC
 
Last edited:
Technology news on Phys.org
  • #2
I haven't run into any problems with that header, though I've never explicitly included it. Can you post an example that reproduces the problem?
 
  • #3
Try enabling concept checks to get a better diagnostic if there's an error in your code.
 
  • #4
I'm trying to build a released software called
ChaNGa(astrophysics N-body sim) that uses charm++ as its parallel framework. Thus i haven't actuallly coded anything on my own.
----------------------------
/1/home/kongw/_Code/API/charm-mpi/mpi-linux/bin/charmc -O3 -I../structures -I../ParallelGravity -DCACHE_TREE -I.. -c -o Reductions.o Reductions.cpp
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: '<anonymous enum>' is/uses anonymous type
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: '<anonymous enum>' is/uses anonymous type
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:58: error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:61: error: '<anonymous enum>' is/uses anonymous type
/usr/lib/gcc/i586-mandriva-linux-gnu/4.0.1/../../../../include/c++/4.0.1/i586-mandriva-linux-gnu/bits/ctype_base.h:61: error: trying to instantiate 'template<class T> void operator|(PUP::er&, T&)'
Fatal Error by charmc in directory /home/kongw/_Code/API2/ChaNGa/changa
Command mpicxx -I/1/home/kongw/_Code/API/charm-mpi/mpi-linux/bin/../include -D__CHARMC__=1 -I../structures -I../ParallelGravity -DCACHE_TREE -I.. -O3 -I/usr/include -c Reductions.cpp -o Reductions.o returned error code 1
charmc exiting...
make: *** [Reductions.o] Error 1
----------------------------

The error builds pointing to the parallel language Charm++...
and technically you don't include this header it is included by other system headers. Hurkyl:"Try enabling concept checks to get a better diagnostic if there's an error in your code." How do you do this, I'm not a native linux programmer.
 
  • #5
neurocomp2003 said:
Hurkyl:"Try enabling concept checks to get a better diagnostic if there's an error in your code." How do you do this, I'm not a native linux programmer.
It's one of gcc's comand line options. I forget the exact command, but you should be able to find it in the man page, or in the online documentation.
 
  • #6
Given that you were building in changa when the error occurred, I would first look in changa, specifically Reductions.cpp. It looks like they're trying to instantiate a function with inadequate type information. See if you can take their mpicxx command and pump up the verbosity. gcc points me to the site at which the instantiation was attempted in these situations, makes it easier to locate the problem. Try -Wall.
 

Related to C: ctype_base.h errors with gcc 4

1. What is "ctype_base.h" in C and why am I getting errors with it?

"ctype_base.h" is a header file in the C programming language that contains functions for character classification and conversion. You may be getting errors with it if there is an issue with your code, such as missing or incorrect function calls, or if there is an issue with your compiler.

2. How can I fix "ctype_base.h" errors in my code?

To fix "ctype_base.h" errors, you can check your code for any missing or incorrect function calls. You can also try updating your compiler to a newer version, as there may be bug fixes that address these errors.

3. Can "ctype_base.h" errors affect the functionality of my program?

Yes, "ctype_base.h" errors can affect the functionality of your program if they are not fixed. These errors may cause unexpected behavior or crashes in your program.

4. Are "ctype_base.h" errors specific to gcc 4?

No, "ctype_base.h" errors can occur with any version of the gcc compiler. However, they may be more common in older versions and can potentially be resolved by updating to a newer version of gcc.

5. Is there any documentation available for "ctype_base.h" and its functions?

Yes, there is documentation available for "ctype_base.h" and its functions. You can refer to the C standard library documentation, or your compiler's documentation for more information on the specific functions and their usage.

Similar threads

Replies
63
Views
3K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
2
Replies
49
Views
10K
  • Programming and Computer Science
Replies
5
Views
5K
  • Engineering and Comp Sci Homework Help
Replies
28
Views
8K
  • Programming and Computer Science
Replies
15
Views
4K
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • STEM Academic Advising
Replies
27
Views
4K
Back
Top