C: ctype_base.h errors with gcc 4

  • Thread starter Thread starter neurocomp2003
  • Start date Start date
  • Tags Tags
    Errors Gcc
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 4K views
neurocomp2003
Messages
1,359
Reaction score
4
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:
Physics news on Phys.org
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?
 
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.
 
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.
 
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.