0

I am trying to compile a project that uses log4cxx, a c++ logging framework. Once I downloaded the framework and added it as a dependency, however, I get this error:

'Locale' : looks like a function definition, but there is no parameter list; skipping apparent body

This happens in locale.h which looks like this:

#ifndef _LOG4CXX_HELPERS_LOCALE_H
#define _LOG4CXX_HELPERS_LOCALE_H

#include <log4cxx/logstring.h>

namespace log4cxx
{
        namespace helpers
        {
                class LOG4CXX_EXPORT Locale
                {
                public:
                        Locale(const LogString& language);
                        Locale(const LogString& language, const LogString& country);
                        Locale(const LogString& language, const LogString& country,
                                const LogString& variant);

                        const LogString& getLanguage() const;
                        const LogString& getCountry() const;
                        const LogString& getVariant() const;

                protected:
                        Locale(const Locale&);
                        Locale& operator=(const Locale&);
                        const LogString language;
                        const LogString country;
                        const LogString variant;
                }; // class Locale
        }  // namespace helpers
} // namespace log4cxx

#endif // _LOG4CXX_HELPERS_LOCALE_H

Is there anything wrong with this syntax? I am not knowledgeable in C++ at all but I do not see what would be wrong with it.

The one single thing on the internet I could find was this: https://issues.apache.org/jira/browse/LOGCXX-147 which makes perfect sense because I am targetting a windows ce device (although, using Visual Studio 2008 instead of 2005). The suggestion there is to include log4cxx/logstring.h inside "the cpp file" which I assume they mean locale.cpp although if I am clearly misinterpreting this please let me know. It said that would get rid of the compilation error but unfortunately I did that and it did not do anything to help :(.

I know it may be a bit of a longshot but does anyone know how one might fix this?

  • Out of morbid curiosity, which line exactly is this error on? Also, you might want to add a tag for VS 2008, or Windows CE, or both, since this issue looks like it's specific to that environment. – Omnifarious Nov 01 '17 at 18:19
  • probably the error is in the line with `LOG4CXX_EXPORT`. What is that? Did you try to find where this is defined? – 463035818_is_not_an_ai Nov 01 '17 at 18:23
  • @Omnifarious it is on the line with LOG4CXX_EXPORT as tobi guessed. –  Nov 01 '17 at 18:36
  • @tobi303 I did not try because I actually assumed that LOG4CXX_EXPORT was being defined right there, as I misunderstood the syntax.. I can attempt to look for where that's defined. –  Nov 01 '17 at 18:36
  • 2
    no it is most likely a macro, as it stands the code is not correct (probably with the definition of that macro it is fine, but who knows..) – 463035818_is_not_an_ai Nov 01 '17 at 18:39
  • `LOG4CXX_EXPORT` is probably defined as empty (basically it turns into nothing) on some platforms and as `__export__` or something like that on others where that's a keyword for that compiler. Check on what the preprocessor turns your file into. – Omnifarious Nov 01 '17 at 22:46

0 Answers0