Hi, I am trying to write a simple gcc plugin and am getting the following errors.
In file included from /home/aj/gcc/trunk/gcc/rtl.h:49, from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:22: /home/aj/gcc/trunk/gcc/rtl.def:336: error: expected identifier before ‘const’ In file included from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:22: /home/aj/gcc/trunk/gcc/rtl.h:99: error: ‘LAST_AND_UNUSED_RTX_CODE’ undeclared here (not in a function) In file included from /home/aj/gcc/trunk/gcc/basic-block.h:28, from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:23: /home/aj/gcc/trunk/gcc/hard-reg-set.h: In function ‘hard_reg_set_iter_set’: /home/aj/gcc/trunk/gcc/hard-reg-set.h:545: error: ‘FIRST_PSEUDO_REGISTER’ undeclared (first use in this function) /home/aj/gcc/trunk/gcc/hard-reg-set.h:545: error: (Each undeclared identifier is reported only once /home/aj/gcc/trunk/gcc/hard-reg-set.h:545: error: for each function it appears in.) /home/aj/gcc/trunk/gcc/hard-reg-set.h: At top level: /home/aj/gcc/trunk/gcc/hard-reg-set.h:583: error: ‘FIRST_PSEUDO_REGISTER’ undeclared here (not in a function) /home/aj/gcc/trunk/gcc/hard-reg-set.h:644: error: ‘N_REG_CLASSES’ undeclared here (not in a function) In file included from /home/aj/gcc/trunk/gcc/basic-block.h:31, from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:23: /home/aj/gcc/trunk/gcc/function.h:222: error: expected specifier-qualifier-list before ‘CUMULATIVE_ARGS’ /home/aj/gcc/trunk/gcc/function.h:698: error: expected ‘)’ before ‘*’ token /home/aj/gcc/trunk/gcc/function.h:700: error: expected ‘)’ before ‘*’ token In file included from /home/aj/gcc/testcode/plugin/ctla_gcc_plugin.c:32: /home/aj/gcc/trunk/gcc/target.h:910: error: expected ‘)’ before ‘*’ token /home/aj/gcc/trunk/gcc/target.h:913: error: expected ‘;’ before ‘rtx’ I googled for a solution and found a similar message in which it was suggested to include "tm.h". I verified my code, and I am getting the same error even after including the file. My CMake file is as follows: set( GCC_SRC_DIR "/home/aj/gcc/trunk") set( GCC_BUILD_DIR "/home/aj/gcc/trunk-obj" ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ) include_directories( ${GCC_BUILD_DIR}/gcc ) include_directories( ${GCC_SRC_DIR}/gcc ) include_directories( ${GCC_SRC_DIR}/libcpp/include ) include_directories( ${GCC_SRC_DIR}/include ) include_directories( ${GCC_SRC_DIR}/host-i686-pc-linux-gnu/gcc ) I am not able to figure out what is going wrong, can you please guide me on where am I making a mistake? Thanks, Ashish Your Mail works best with the New Yahoo Optimized IE8. Get it NOW! http://downloads.yahoo.com/in/internetexplorer/