internal compiler error

This is a discussion on internal compiler error within the C++ Programming forums, part of the General Programming Boards category; here's the exact error: tx_server.h:17: internal compiler error: in current_ir_type, at cfghooks.c:70 Code: #ifndef _TX_SERVER_H #define _TX_SERVER_H #include "tx_types.h" #include ...

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    245

    internal compiler error

    here's the exact error:

    tx_server.h:17: internal compiler error: in current_ir_type, at cfghooks.c:70

    Code:
    #ifndef _TX_SERVER_H
    #define _TX_SERVER_H
    
    #include "tx_types.h"
    #include "tx_rpc_types.h"
    
    #define NUMCLIENTS 1
    
    void init_server();
    void push_transaction(
                          const unsigned long request_id,
                          const nssi_remote_pid *caller,
                          const push_tx_data *tx,
                          const nssi_rma *data_addr,
                          const nssi_rma *res_addr
                          );
    void process_transaction(tx_info * info, tx_status STATUS);
    
    #endif
    If I remove the header, and put it all in the .cpp for testing purposes, the error goes away..

    The bolded line is line 17, where the error is occurring. I don't see what the error is.

    tx_info and tx_status are defined in tx_types.h.

    I'm using mpicc, but I had this problem before too with g++. Any thoughts on what's wrong with my header file?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Internal compiler errors are always fun. I assume you're not actually trying to compile your .h file (otherwise we've got bigger issues), so this is being included from some .cpp file -- I mean, that this error is coming from the compilation of some particular .cpp file (one assumes you're including this header 53 times, and not getting the error every time). It is possible that someone has #defined STATUS to be something in that file, what with that being the purpose of all-caps names. Can you run the preprocessor only on that file (e.g., with -E) and look at the resulting line?

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    245
    Here's how I compile

    Code:
    mpicc -Wall -c -I. -I $(HOME)/include tx_server.h tx_types.h tx_rpc_types.h txtest.cpp tx_server.cpp tx_rpc_types_xdr.c
    Code:
    mpicc -Wall -o txtest tx_test.o tx_server.o tx_rpc_types_xdr.o -L $(HOME)/lib -L /ascldap/users/jdayal/nessie/build/redsky/lib/ -llib1 -llib2...... -lrt
    tx_server.h is being included in tx_server.cpp and txtest.cpp. txtest.cpp contains the main..

    I'm including it via

    Code:
    #include "tx_server.h"

  4. #4
    Registered User
    Join Date
    May 2010
    Posts
    245
    Quote Originally Posted by tabstop View Post
    Internal compiler errors are always fun. I assume you're not actually trying to compile your .h file (otherwise we've got bigger issues), so this is being included from some .cpp file -- I mean, that this error is coming from the compilation of some particular .cpp file (one assumes you're including this header 53 times, and not getting the error every time). It is possible that someone has #defined STATUS to be something in that file, what with that being the purpose of all-caps names. Can you run the preprocessor only on that file (e.g., with -E) and look at the resulting line?
    Ok, I took out tx_server.c from my mpicc -c command. That seems to get rid of the internal compiler error. I have a slew of other problems though, but that's something i'll try to figure out. Thanks for your help.

    Just a general question, why is adding tx_server.h bad?

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    I don't even know what you mean by "adding tx_server.h". Adding it to what? If you mean "adding it to the compile line", that's because it's a header. The whole point of a header is that it is not actually compilable code (templates being the exception), merely defines and includes and prototypes et cetera that make sure all the pieces of your program are using the same definitions of things, that all your individual .cpp files know about function signatures (via prototypes).

  6. #6
    Registered User
    Join Date
    May 2010
    Posts
    245
    Quote Originally Posted by tabstop View Post
    I don't even know what you mean by "adding tx_server.h". Adding it to what? If you mean "adding it to the compile line", that's because it's a header. The whole point of a header is that it is not actually compilable code (templates being the exception), merely defines and includes and prototypes et cetera that make sure all the pieces of your program are using the same definitions of things, that all your individual .cpp files know about function signatures (via prototypes).
    I understand. Thanks for the explanation!

  7. #7
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,505
    Code:
    mpicc -Wall -c -I. -I $(HOME)/include tx_server.h tx_types.h tx_rpc_types.h txtest.cpp tx_server.cpp tx_rpc_types_xdr.c
    Has as been mentioned already - do NOT compile your header files!
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Internal Compiler Error
    By Elysia in forum C++ Programming
    Replies: 20
    Last Post: 07-05-2008, 03:59 AM
  2. Internal compiler error
    By CoMpuTer NerD in forum C++ Programming
    Replies: 9
    Last Post: 12-10-2007, 11:30 PM
  3. Internal Compiler Error?
    By Munkey01 in forum C++ Programming
    Replies: 9
    Last Post: 02-04-2003, 12:44 PM
  4. Please help, internal compiler error
    By Cap in forum C Programming
    Replies: 5
    Last Post: 08-15-2002, 07:31 PM
  5. fatal error C1001: INTERNAL COMPILER ERROR
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-21-2002, 12:07 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21