Skip to content

Does not compile on gcc 6.3.1 #3

@fergusq

Description

@fergusq

The code produces multiple compiler errors. I'm using GCC 6.3.1 on Fedora 25.

It seems that the cmath library is not included in some files. Also there are unnecessary static-modifiers before some structs.

gcc -O4 -I/usr/local/include Nakloid.cpp wmain.cpp core/UnitWaveformMaker.cpp core/PitchMarker.cpp core/UnitWaveformOverlapper.cpp format/UnitWaveformContainer.cpp format/PitchmarkParameters.cpp format/PronunciationAlias.cpp format/Wav.cpp parser/SmfHandler.cpp parser/WavParser.cpp parser/SmfParser.cpp score/ScoreNAK.cpp score/Score.cpp score/ScoreUST.cpp score/ScoreSMF.cpp score/Note.cpp vocal_lib/Voice.cpp vocal_lib/VoiceWAV.cpp vocal_lib/VoiceUWC.cpp vocal_lib/VocalLibrary.cpp -L/usr/local/lib -lstdc++ -lboost_filesystem -lm -o Nakloid
In file included from score/../vocal_lib/VocalLibrary.h:13:0,
                 from score/Score.h:22,
                 from Nakloid.h:8,
                 from Nakloid.cpp:1:
score/../vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from score/../vocal_lib/VocalLibrary.h:13:0,
                 from score/Score.h:22,
                 from wmain.cpp:10:
score/../vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
format/Wav.cpp: Jäsenfunktio ”double WavData::getRMS() const”:
format/Wav.cpp:139:26: virhe: ”pow” on esittelemättä tällä näkyvyysalueella
     rms += pow(data[i], 2) / data.size();
                          ^
format/Wav.cpp:141:18: virhe: ”sqrt” on esittelemättä tällä näkyvyysalueella
   return sqrt(rms);
                  ^
format/Wav.cpp: Jäsenfunktio ”void Wav::save(const boost::filesystem::path&)”:
format/Wav.cpp:195:54: virhe: invalid initialization of non-const reference of type ”std::vector<short int>&” from an rvalue of type ”std::vector<short int>”
   vector<short>& output_data = data.getDataForWavFile();
                                ~~~~~~~~~~~~~~~~~~~~~~^~
In file included from score/../vocal_lib/VocalLibrary.h:13:0,
                 from score/Score.h:22,
                 from score/Note.h:12,
                 from score/ScoreNAK.h:11,
                 from score/ScoreNAK.cpp:1:
score/../vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from score/../vocal_lib/VocalLibrary.h:13:0,
                 from score/Score.h:22,
                 from score/Score.cpp:1:
score/../vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from score/../vocal_lib/VocalLibrary.h:13:0,
                 from score/Score.h:22,
                 from score/Note.h:12,
                 from score/ScoreUST.h:10,
                 from score/ScoreUST.cpp:1:
score/../vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from score/../vocal_lib/VocalLibrary.h:13:0,
                 from score/Score.h:22,
                 from score/Note.h:12,
                 from score/ScoreSMF.h:8,
                 from score/ScoreSMF.cpp:1:
score/../vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from score/../vocal_lib/VocalLibrary.h:13:0,
                 from score/Score.h:22,
                 from score/Note.h:12,
                 from score/Note.cpp:1:
score/../vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from vocal_lib/Voice.cpp:1:0:
vocal_lib/Voice.h: Jäsenfunktio ”double Voice::getRMS(std::vector<double>::const_iterator, std::vector<double>::const_iterator) const”:
vocal_lib/Voice.h:94:30: virhe: ”pow” on esittelemättä tällä näkyvyysalueella
     rms += pow((double)*it, 2) / (to - from);
                              ^
vocal_lib/Voice.h:96:18: virhe: ”sqrt” on esittelemättä tällä näkyvyysalueella
   return sqrt(rms);
                  ^
In file included from vocal_lib/VoiceWAV.h:6:0,
                 from vocal_lib/VoiceWAV.cpp:1:
vocal_lib/Voice.h: Jäsenfunktio ”double Voice::getRMS(std::vector<double>::const_iterator, std::vector<double>::const_iterator) const”:
vocal_lib/Voice.h:94:30: virhe: ”pow” on esittelemättä tällä näkyvyysalueella
     rms += pow((double)*it, 2) / (to - from);
                              ^
vocal_lib/Voice.h:96:18: virhe: ”sqrt” on esittelemättä tällä näkyvyysalueella
   return sqrt(rms);
                  ^
In file included from vocal_lib/VoiceWAV.h:7:0,
                 from vocal_lib/VoiceWAV.cpp:1:
vocal_lib/../core/core-inl.h: Funktio ”double dB2val(const std::pair<bool, double>&)”:
vocal_lib/../core/core-inl.h:13:110: virhe: ”pow” on esittelemättä tällä näkyvyysalueella
 inline double dB2val(const std::pair<bool, double>& dB) { return (dB.second>0) ? 0.0 : pow(10, dB.second / 20)*(dB.first ? 1 : -1); };
                                                                                                              ^
In file included from vocal_lib/VoiceWAV.h:7:0,
                 from vocal_lib/VoiceWAV.cpp:1:
vocal_lib/../core/core-inl.h: Funktio ”double sinc(double)”:
vocal_lib/../core/core-inl.h:14:48: virhe: ”sin” on esittelemättä tällä näkyvyysalueella
 inline double sinc(double x){ return sin(M_PI*x) / (M_PI*x); }
                                                ^
vocal_lib/../core/core-inl.h: Funktio ”std::pair<bool, double> val2dB(double)”:
vocal_lib/../core/core-inl.h:27:58: virhe: ”log10” on esittelemättä tällä näkyvyysalueella
   return std::make_pair(wav_value>0, log10(abs(wav_value)) * 20);
                                                          ^
vocal_lib/../core/core-inl.h: Funktio ”std::vector<double> getWindow(long int, unsigned char)”:
vocal_lib/../core/core-inl.h:50:46: virhe: ”cos” on esittelemättä tällä näkyvyysalueella
       filter[i] = 0.5 - (0.5 * cos(2 * M_PI*x));
                                              ^
vocal_lib/../core/core-inl.h: Funktio ”std::vector<double> getWindow(long int, unsigned char, long int)”:
vocal_lib/../core/core-inl.h:68:24: virhe: ”log” on esittelemättä tällä näkyvyysalueella
   double coeff = -log(2) / log(sin(M_PI*(0.5-(output_pitch/2.0/len))));
                        ^
vocal_lib/../core/core-inl.h:68:69: virhe: ”sin” on esittelemättä tällä näkyvyysalueella
   double coeff = -log(2) / log(sin(M_PI*(0.5-(output_pitch/2.0/len))));
                                                                     ^
vocal_lib/../core/core-inl.h:71:61: virhe: ”pow” on esittelemättä tällä näkyvyysalueella
     filter[i] = filter[len-i-1] = pow(sin(M_PI*i/len), coeff);
                                                             ^
In file included from vocal_lib/VoiceWAV.cpp:1:0:
vocal_lib/VoiceWAV.h: Globaalilla näkyvyysalueella:
vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from vocal_lib/VocalLibrary.h:13:0,
                 from vocal_lib/VoiceUWC.h:4,
                 from vocal_lib/VoiceUWC.cpp:1:
vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
In file included from vocal_lib/VocalLibrary.h:13:0,
                 from vocal_lib/VocalLibrary.cpp:1:
vocal_lib/VoiceWAV.h:29:3: virhe: tallennusluokan voi antaa vain olioille ja funktioille
   static struct PitchmarkTemplateParameters {
   ^~~~~~
Makefile:17: recipe for target 'Nakloid' failed
make: *** [Nakloid] Error 1

I fixed the errors manually by adding includes and removing static-modifiers. What compiler was used to compile the files?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions