D
DanielESFA
Hey guys
This is a bit of a funny one... We're four guys working on the same project,
everybody using KDevelop and g++ on Linux. Three of us are using Mandrake,
with g++ 3.4.3 and 3.4.1. Project compiles nicely on these three puters.
On the fourth computer, running SUSE 9.3 using KDevelop also, but g++ 3.3.5,
and on the school's Debian server (which is the one that'll actually be
compiling the code eventually), also running g++ 3.3.5, we get a series of
"'const' qualifiers cannot be applied to..." errors when compiling.
This is the start of the .h file of the class that causes the error. The
error refers to the last line, i.e. the constructor declaration:
<code snippet>
#ifndef STDFILEMGR_H
#define STDFILEMGR_H
#include <dirent.h>
#include <fcntl.h>
#include <string>
#include "reporterfunctiontype.typedef"
namespace std
{
class FileManager
{
public:
FileManager(const string &root_, int bufferSize_, const
reporterFunctionType* reporter_);
</code snippet>
And the error (the reference to line 31 is actually the "FileManager..."
line above, I've not included the comment at the top of the .h file here)
<error>
g++ -c filemanager.cpp
In file included from filemanager.cpp:12:
filemanager.h:31: error: `const' qualifiers cannot be applied to `void (
(const
std::string&)'
filemanager.cpp:18: error: `const' qualifiers cannot be applied to `void
()(const std::string&)'
make: *** [filemanager.o] Error 1
</error>
Is this a known problem with this version of the g++ compiler? Or is it just
us doing something silly that the newer version of the g++ compiler accepts
even though it's not correct?
TIA,
Daniel
This is a bit of a funny one... We're four guys working on the same project,
everybody using KDevelop and g++ on Linux. Three of us are using Mandrake,
with g++ 3.4.3 and 3.4.1. Project compiles nicely on these three puters.
On the fourth computer, running SUSE 9.3 using KDevelop also, but g++ 3.3.5,
and on the school's Debian server (which is the one that'll actually be
compiling the code eventually), also running g++ 3.3.5, we get a series of
"'const' qualifiers cannot be applied to..." errors when compiling.
This is the start of the .h file of the class that causes the error. The
error refers to the last line, i.e. the constructor declaration:
<code snippet>
#ifndef STDFILEMGR_H
#define STDFILEMGR_H
#include <dirent.h>
#include <fcntl.h>
#include <string>
#include "reporterfunctiontype.typedef"
namespace std
{
class FileManager
{
public:
FileManager(const string &root_, int bufferSize_, const
reporterFunctionType* reporter_);
</code snippet>
And the error (the reference to line 31 is actually the "FileManager..."
line above, I've not included the comment at the top of the .h file here)
<error>
g++ -c filemanager.cpp
In file included from filemanager.cpp:12:
filemanager.h:31: error: `const' qualifiers cannot be applied to `void (
(const
std::string&)'
filemanager.cpp:18: error: `const' qualifiers cannot be applied to `void
()(const std::string&)'
make: *** [filemanager.o] Error 1
</error>
Is this a known problem with this version of the g++ compiler? Or is it just
us doing something silly that the newer version of the g++ compiler accepts
even though it's not correct?
TIA,
Daniel