Filosoft / vabamorf

Eesti keele morfanalüsaator
Other
24 stars 14 forks source link

Compile error: unable to find string literal operator ‘operator"" L’ #11

Closed tpetmanson closed 9 years ago

tpetmanson commented 9 years ago

I failed to compile both the analyzer and synthesizer with gcc version 4.7.2 (Debian 4.7.2-5) with the latest code in the repository.

For example, in case of the synthesizer, the relevant error log is here:

$ make -f Makefile.etsyn 
g++ -O2 -DNDEBUG -Wall -std=gnu++0x -fdata-sections -ffunction-sections -Wl,--gc-sections -o etsyn ../../etsyn/*.cpp ../../../../lib/proof/*.cpp ../../../../lib/etana/*.cpp ../../../lib/*.cpp ../../../../lib/fsc/*.cpp -pthread
../../../../lib/proof/suggestor.cpp:9:82: error: unable to find string literal operator ‘operator"" L’
../../../../lib/proof/suggestor.cpp:10:75: error: unable to find string literal operator ‘operator"" L’
In file included from ../../../../lib/etana/post-fsc.h:13:0,
                 from ../../../../lib/etana/ahel2.h:4,
                 from ../../../../lib/etana/mrf-mrf.h:5,
                 from ../../../../lib/etana/arvapn1.cpp:4:
...
make: *** [all] Error 1

I modified lines 9 and 10 of lib/proof/suggestor.cpp and added spaces between the string literals:

static const CFSWString szInsertLettersBeg=L"KPSTVLMRAHNEJIO\x00dc" L"DFUB\x00d5" L"G";
static const CFSWString szInsertLetters=L"AEISTLUNKMODRVGHJP\x00c4\x00d5" L"B\x00dc\x00d6";

After this change, I managed to compile both programs.

It seems that the subject error occurs because in the new c++11 a space between string concatenation is mandatory: http://stackoverflow.com/questions/10329942/error-unable-to-find-string-literal-operator-slashes Although I do not see anywhere in the makefile that C++11 flag is set.

PRR24 commented 9 years ago

Fixed.

kristiank commented 9 years ago

It would have been nice to get the Pull Request merged. Nice that it got fixed.

PRR24 commented 9 years ago

I appreciate your pull request. I didn't accept it as the fix was already done on our side yesterday, just not committed yet :) Anyway, thanks again for your support.