Problem with gcc/4.5.0-g++and boost::function

I have legacy code in my library using boost::function. This works fine if I am using gcc/4.2.2-g++ and BOOST/1.41. But if I switch myself to using gcc/4.5.0-g++ and BOOST/1.44 I get below ERROR:
I do not see anything wrong with code.
/export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:51: error: 'function' in namespace 'boost' does not name a type
/export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:58: error: ISO C++ forbids declaration of 'parameter' with no type
/export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:66: error: expected ',' or '...' before '<' token
../../../../../../marketdata/IMDMXP/server/wombat/management.cpp:126:10: error: prototype for 'void datasource::management::stop(const std::string&, const boost::function

AMDG On 03/31/2011 09:27 AM, Shah, Gaurav N wrote:
I have legacy code in my library using boost::function. This works fine if I am using gcc/4.2.2-g++ and BOOST/1.41. But if I switch myself to using gcc/4.5.0-g++ and BOOST/1.44 I get below ERROR: I do not see anything wrong with code.
/export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:51: error: 'function' in namespace 'boost' does not name a type /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:58: error: ISO C++ forbids declaration of 'parameter' with no type /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:66: error: expected ',' or '...' before '<' token ../../../../../../marketdata/IMDMXP/server/wombat/management.cpp:126:10: error: prototype for 'void datasource::management::stop(const std::string&, const boost::function
&)' does not match any in class 'datasource::management' /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:14: error: candidate is: void datasource::management::stop(const std::string&, int) make[6]: *** [management.lo] Error 1 make[6]: *** Waiting for unfinished jobs.... Code lines throw ERROR:
68 */ 69 void stop(const std::string& topic, const boost::function< void (void)>& action); 70
Thanks for help in advance.
Have you verified that boost/function.hpp is #included? In Christ, Steven Watanabe

On 03/31/2011 06:42 PM, Steven Watanabe wrote:
AMDG
On 03/31/2011 09:27 AM, Shah, Gaurav N wrote:
I have legacy code in my library using boost::function. This works fine if I am using gcc/4.2.2-g++ and BOOST/1.41. But if I switch myself to using gcc/4.5.0-g++ and BOOST/1.44 I get below ERROR: I do not see anything wrong with code.
/export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:51: error: 'function' in namespace 'boost' does not name a type /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:58: error: ISO C++ forbids declaration of 'parameter' with no type /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:66: error: expected ',' or '...' before '<' token ../../../../../../marketdata/IMDMXP/server/wombat/management.cpp:126:10: error: prototype for 'void datasource::management::stop(const std::string&, const boost::function
&)' does not match any in class 'datasource::management' /export/home/a_besnad/Perforce/eq-thebeast-build-linux-Beast_8.08/TheBeast/marketdata/IMDMXP/server/wombat/management.hpp:69:14: error: candidate is: void datasource::management::stop(const std::string&, int) make[6]: *** [management.lo] Error 1 make[6]: *** Waiting for unfinished jobs.... Code lines throw ERROR:
68 */ 69 void stop(const std::string& topic, const boost::function< void (void)>& action); 70
Thanks for help in advance.
Have you verified that boost/function.hpp is #included?
In Christ, Steven Watanabe _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
This is the first thing I would check, since the compiler has become stricter, meaning indirect inclusions won't work anymore. I ran across the same problem when upgrading from 4.2.x to 4.4.x and 4.5.x respectively. Regards, Andreas -- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com
participants (3)
-
Andreas Wehrmann
-
Shah, Gaurav N
-
Steven Watanabe