2

After some research, i still don't understand the problem.

Const.hpp :

#ifndef CONST_HPP
#define CONST_HPP

#include <QString>

    const QString   CONFFILENAME("dsibubble.ini"),
                    STRSEP(" | ");

    const int       MAXIMGWIDTH = 960;

#endif // CONST_HPP  

TabDataBase.cpp :

#include "Const.hpp"
func() {

    QString abc = STRSEP;

}

The use of STRSEP generate an expected unqualified-id before string constant error. Moreover i use CONFFILENAME in an other class and i have no error.

QString path = QString("..//") + CONFFILENAME;

EDIT: Error's detail :

In file included ..\TabDataBase.cpp: #include "Const.hpp"  
expected unqualified-id before string constant: Const.hpp : STRSEP(" | ");
canardman
  • 3,103
  • 6
  • 26
  • 28

2 Answers2

7

I think you have defined STRSEP as a string literal somewhere like:

#define STRSEP "blahblah"

Because I compiled your snippet and it's fine, but adding a define like the previous one I get the same error.

Simone
  • 11,655
  • 1
  • 30
  • 43
2

Try defining the two constants using two separate statements. It's the only thing that I can think of that might have an effect.

Mark B
  • 95,107
  • 10
  • 109
  • 188