Dear developers, libnutclient has been added as a C++ alternative to libupsclient in 2.7.1. As a result I can't compile nut 2.7.3 with gcc-3.3.6. There wasn't such a problem with nut-2.6.5. Is it possible to add a configuration parameter like '-without-libnutclient' to provide better compatibility with older gcc versions please (since libnutclient is an alternative to libupsclient)? Or maybe use C instead of C++ for libnutclient? Unfortunately, is not that easy to upgrade glibc in an embedded system. Thank you, Sergey -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20150706/cf9ecd36/attachment.html>
On Jul 6, 2015, at 4:40 AM, Sergey Talchuk wrote:> Dear developers, > > libnutclient has been added as a C++ alternative to libupsclient in 2.7.1. As a result I can't compile nut 2.7.3 with gcc-3.3.6.What does the error message look like? Does the configure script fail when checking for the C++ compiler, or later on?> There wasn't such a problem with nut-2.6.5. > > Is it possible to add a configuration parameter like '-without-libnutclient' to provide better compatibility with older gcc versions please (since libnutclient is an alternative to libupsclient)?Certainly possible - the NUT clients (upsc, upsmon, etc.) do not use libnutclient. I would like the defaults to work, though - hence the previous question.> Or maybe use C instead of C++ for libnutclient?As I understand it, the purpose of libnutclient was to provide a more object-oriented API to NUT. I'm not sure we need two different C APIs.> > Unfortunately, is not that easy to upgrade glibc in an embedded system. >Thanks for the feedback. I agree that libnutclient should be optional, but it is good to confirm that it is a problem in the field. No need to email both NUT lists - we can post results to nut-upsuser later. -- Charles Lepple clepple at gmail -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150706/cbf5eb19/attachment.html>
Hi Charles, Thanks for the prompt reply! Errors occur when execute make: /bin/sh ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I../include -MT nutclient.lo -MD -MP -MF $depbase.Tpo -c -o nutclient.lo nutclient.cpp &&\ mv -f $depbase.Tpo $depbase.Plo libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../include -MT nutclient.lo -MD -MP -MF .deps/nutclient.Tpo -c nutclient.cpp -fPIC -DPIC -o .libs/nutclient.o In file included from nutclient.cpp:20: nutclient.h:26:18: string: No such file or directory nutclient.h:27:18: vector: No such file or directory nutclient.h:28:15: map: No such file or directory nutclient.h:29:15: set: No such file or directory nutclient.h:30:21: exception: No such file or directory In file included from nutclient.cpp:20: nutclient.h:51: error: `exception' is not a class or namespace nutclient.h:51: error: invalid base-class specification nutclient.h:53: error: syntax error before `&' token nutclient.h:53: error: missing ';' before right brace nutclient.h:54: error: ISO C++ forbids defining types within return type nutclient.h:54: error: destructors must be member functions nutclient.h:54: error: return type specification for destructor invalid nutclient.h:54: error: virtual outside class declaration nutclient.h:55: error: virtual outside class declaration nutclient.h:55: error: non-member function `const char* nut::what()' cannot have `const' method qualifier nutclient.h: In function `const char* nut::what()': nutclient.h:55: error: invalid use of `this' in non-member function nutclient.h: At global scope: nutclient.h:56: error: syntax error before `(' token nutclient.h:65: error: syntax error before `{' token nutclient.h:68: error: destructors must be member functions nutclient.h:68: error: virtual outside class declaration nutclient.h:69: error: syntax error before `private' nutclient.h:78: error: syntax error before `{' token nutclient.h:81: error: destructors must be member functions nutclient.h:81: error: virtual outside class declaration nutclient.h:82: error: syntax error before `}' token nutclient.h:88: error: base class `IOException' has incomplete type nutclient.h: In constructor `UnknownHostException::UnknownHostException()': nutclient.h:90: error: class `UnknownHostException' does not have any field named `IOException' etc... ------ Sergey On Mon, Jul 6, 2015 at 4:56 PM, Charles Lepple <clepple at gmail.com> wrote:> On Jul 6, 2015, at 4:40 AM, Sergey Talchuk wrote: > > Dear developers, > > libnutclient has been added as a C++ alternative to libupsclient in 2.7.1. > As a result I can't compile nut 2.7.3 with gcc-3.3.6. > > > What does the error message look like? Does the configure script fail when > checking for the C++ compiler, or later on? > > There wasn't such a problem with nut-2.6.5. > > Is it possible to add a configuration parameter like > '-without-libnutclient' to provide better compatibility with older gcc > versions please (since libnutclient is an alternative to libupsclient)? > > > Certainly possible - the NUT clients (upsc, upsmon, etc.) do not use > libnutclient. I would like the defaults to work, though - hence the > previous question. > > Or maybe use C instead of C++ for libnutclient? > > > As I understand it, the purpose of libnutclient was to provide a more > object-oriented API to NUT. I'm not sure we need two different C APIs. > > > Unfortunately, is not that easy to upgrade glibc in an embedded system. > > > Thanks for the feedback. I agree that libnutclient should be optional, but > it is good to confirm that it is a problem in the field. > > No need to email both NUT lists - we can post results to nut-upsuser later. > > -- > Charles Lepple > clepple at gmail > > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150706/74366af5/attachment.html>
2015-07-06 10:40 GMT+02:00 Sergey Talchuk <tals1975 at gmail.com>:> Dear developers, > > libnutclient has been added as a C++ alternative to libupsclient in 2.7.1. > As a result I can't compile nut 2.7.3 with gcc-3.3.6. There wasn't such a > problem with nut-2.6.5. > > Is it possible to add a configuration parameter like > '-without-libnutclient' to provide better compatibility with older gcc > versions please (since libnutclient is an alternative to libupsclient)? > Or maybe use C instead of C++ for libnutclient? > > Unfortunately, is not that easy to upgrade glibc in an embedded system. > > Thank you, > Sergey >Hello Sergey thanks for your mail. I'm adding explicitly Emilien, who may have some additional comments... I got some complementary questions, to ensure we bring a suitable solution to your issue: - which exact system are you running? - which version of glibc? - you said that stl is present. Do you have actually the "libstdc++-dev" (Debian like) equivalent package / files installed for glibc. I.e, is there something under /usr/include/c++/3.3.6 and / or /usr/include/c++/3.3 For the sake of completion, libnutclient is more a developer oriented lib, more high level and easier to use, and C++ / C usable. While libupsclient is just the historic internal lib that I once exported to create the first external NUT client (wmnut, back in 2001) and later more 3rd party ones... thanks and cheers, Arno -- Eaton Data Center Automation - Opensource Leader NUT (Network UPS Tools) Project Leader - http://www.networkupstools.org Debian Developer - http://www.debian.org Free Software Developer - http://arnaud.quette.fr -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150721/27bd51cf/attachment.html>
Hello Arnaud, Thanks for your reply! I have an embedded system: linux kernel 2.4.28 uGlibc 0.9.27 The build env. (GPL) contains /usr/include/c++/3.3.6 and there is NO stl presented. Even if I build g++ with STL it is not that easy to update it on the target system because of the read-only fs (ROM). Installing NUT on the HDD I just extend some features on the device. But the system libraries can't be changed, unfortunately... So, that is the reason I removed it from the makefile. It looks like this is just my specific case. Thank you, Sergey On Tue, Jul 21, 2015 at 12:19 PM, Arnaud Quette <arnaud.quette at gmail.com> wrote:> > > 2015-07-06 10:40 GMT+02:00 Sergey Talchuk <tals1975 at gmail.com>: > >> Dear developers, >> >> libnutclient has been added as a C++ alternative to libupsclient in >> 2.7.1. As a result I can't compile nut 2.7.3 with gcc-3.3.6. There wasn't >> such a problem with nut-2.6.5. >> >> Is it possible to add a configuration parameter like >> '-without-libnutclient' to provide better compatibility with older gcc >> versions please (since libnutclient is an alternative to libupsclient)? >> Or maybe use C instead of C++ for libnutclient? >> >> Unfortunately, is not that easy to upgrade glibc in an embedded system. >> >> Thank you, >> Sergey >> > > Hello Sergey > > thanks for your mail. > I'm adding explicitly Emilien, who may have some additional comments... > > > I got some complementary questions, to ensure we bring a suitable solution > to your issue: > > - which exact system are you running? > - which version of glibc? > - you said that stl is present. Do you have actually the "libstdc++-dev" > (Debian like) equivalent package / files installed for glibc. > I.e, is there something under /usr/include/c++/3.3.6 and / or > /usr/include/c++/3.3 > > For the sake of completion, libnutclient is more a developer oriented lib, > more high level and easier to use, and C++ / C usable. > While libupsclient is just the historic internal lib that I once exported > to create the first external NUT client (wmnut, back in 2001) and later > more 3rd party ones... > > thanks and cheers, > Arno > -- > Eaton Data Center Automation - Opensource Leader > NUT (Network UPS Tools) Project Leader - http://www.networkupstools.org > Debian Developer - http://www.debian.org > Free Software Developer - http://arnaud.quette.fr > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20150721/9bbc4b53/attachment.html>