Hello all, The C++ interface doesn't work with recent versions of GCC using the default options. For example, trying to compile the eg_cc_main.cc file (one of the examples included with Eclipse) results in the following errors: $ g++-4.1 eg_cc_main.cc -I${ECLIPSEDIR}/include/${ARCH} -L${ECLIPSEDIR}/lib/${ARCH} -leclipse eg_cc_main.cc: In function ‘int main()’: eg_cc_main.cc:55: error: ‘newvar’ was not declared in this scope eg_cc_main.cc:59: error: ‘list’ was not declared in this scope eg_cc_main.cc:59: error: ‘list’ was not declared in this scope eg_cc_main.cc:59: error: declaration of ‘<typeprefixerror>list’ eg_cc_main.cc:59: error: conflicts with previous declaration ‘<typeprefixerror>list’ The result is similar for g++-4.2 and g++-4.3. The compilation succeeds with g++-3.3. The problem is due to a change explained here: http://gcc.gnu.org/gcc-4.1/changes.html , as the first point in the C++ section. Specifically: ARM-style name-injection of friend declarations is no longer the default. For example: struct S { friend void f(); }; void g() { f(); } will not be accepted; instead a declaration of f will need to be present outside of the scope of S. The new -ffriend-injection option will enable the old behavior. Indeed, using the -ffriend-injection option does make Eclipse's C++ interface work properly. The proper fix, I think, is to add declarations for functions like newvar, list etc. to Eclipse's C++ header file. In the meantime, adding -ffriend-injection is a fine workaround. Chris MearsReceived on Mon Feb 09 2009 - 23:30:03 CET
This archive was generated by hypermail 2.2.0 : Thu Feb 02 2012 - 02:31:58 CET