mapsme / omim

🗺️ MAPS.ME — Offline OpenStreetMap maps for iOS and Android
Apache License 2.0
4.56k stars 1.15k forks source link

compilation errors, help #6074

Open ghost opened 7 years ago

ghost commented 7 years ago

In file included from /home/work/omim/editor/opening_hours_ui.hpp:6:0, from /home/work/omim/editor/opening_hours_ui.cpp:1: /home/work/omim/3party/opening_hours/opening_hours.hpp:162:31: error: missing space between ‘""’ and suffix identifier inline constexpr Time::THours operator ""_h(unsigned long long int h)

/home/work/omim/3party/opening_hours/opening_hours.hpp:167:33: error: missing space between ‘""’ and suffix identifier inline constexpr Time::TMinutes operator ""_min(unsigned long long int m)

/home/work/omim/3party/openinghours/opening.hpp:299:26: error: missing space between ‘""’ and suffix identifier inline constexpr Weekday operator ""_weekday(unsigned long long int day)

/home/work/omim/3party/opening_hours/opening_hours.hpp:486:34: error: missing space between ‘""’ and suffix identifier inline constexpr MonthDay::Month operator ""_M(unsigned long long int month)

In file included from /home/work/omim/3party/opening_hours/rules_evaluation.hpp:3:0, from /home/work/omim/3party/opening_hours/rules_evaluation.cpp:1: /home/work/omim/3party/opening_hours/opening_hours.hpp:162:31: error: missing space between ‘""’ and suffix identifier inline constexpr Time::THours operator ""_h(unsigned long long int h)

/home/work/omim/3party/opening_hours/opening_hours.hpp:167:33: error: missing space between ‘""’ and suffix identifier inline constexpr Time::TMinutes operator ""_min(unsigned long long int m)

/home/work/omim/3party/opening_hours/opening_hours.hpp:299:26: error: missing space between ‘""’ and suffix identifier inline constexpr Weekday operator ""_weekday(unsigned long long int day)

/home/work/omim/3party/opening_hours/opening_hours.hpp:486:34: error: missing space between ‘""’ and suffix identifier inline constexpr MonthDay::Month operator ""_M(unsigned long long int month)

/home/work/omim/editor/opening_hours_ui.cpp: In function ‘size_t {anonymous}::SpanLength(const osmoh::Timespan&)’: /home/work/omim/editor/opening_hours_ui.cpp:17:16: error: missing space between ‘""’ and suffix identifier using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:17:24: error: expected ‘;’ before ‘STRING_USERDEF’ token using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:17:24: error: unable to find string literal operator ‘operator"" _h’ /home/work/omim/editor/opening_hours_ui.cpp:20:80: error: unable to find numeric literal operator ‘operator"" _h’ return end - start + (span.HasExtendedHours() ? osmoh::HourMinutes::TMinutes(24_h).count() : 0);

/home/work/omim/editor/opening_hours_ui.cpp: In function ‘bool {anonymous}::FixTimeSpans(osmoh::Timespan, osmoh::TTimespans&)’: /home/work/omim/editor/opening_hours_ui.cpp:41:16: error: missing space between ‘""’ and suffix identifier using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:41:24: error: expected ‘;’ before ‘STRING_USERDEF’ token using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:41:24: error: unable to find string literal operator ‘operator"" _h’ /home/work/omim/editor/opening_hours_ui.cpp:49:50: error: unable to find numeric literal operator ‘operator"" _h’ span.GetEnd().GetHourMinutes().AddDuration(24_h);

/home/work/omim/editor/opening_hours_ui.cpp:91:55: error: unable to find numeric literal operator ‘operator"" _h’ openingTime.GetEnd().GetHourMinutes().AddDuration(24_h);

/home/work/omim/editor/opening_hours_ui.cpp:99:51: error: unable to find numeric literal operator ‘operator"" _h’ span.GetEnd().GetHourMinutes().AddDuration(-24_h);

/home/work/omim/editor/opening_hours_ui.cpp: In member function ‘osmoh::Timespan editor::ui::TimeTable::GetPredefinedOpeningTime() const’: /home/work/omim/editor/opening_hours_ui.cpp:254:16: error: missing space between ‘""’ and suffix identifier using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:254:24: error: expected ‘;’ before ‘STRING_USERDEF’ token using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:254:24: error: unable to find string literal operator ‘operator"" _h’ /home/work/omim/editor/opening_hours_ui.cpp:255:11: error: unable to find numeric literal operator ‘operator"" _h’ return {9_h, 18_h};

/home/work/omim/editor/opening_hours_ui.cpp:255:16: error: unable to find numeric literal operator ‘operator"" _h’ return {9_h, 18_h};

/home/work/omim/editor/opening_hours_ui.cpp:255:20: error: could not convert ‘{, }’ from ‘’ to ‘osmoh::Timespan’ return {9_h, 18_h};

/home/work/omim/editor/opening_hours_ui.cpp: In member function ‘osmoh::Timespan editor::ui::TimeTable::GetPredefinedExcludeTime() const’: /home/work/omim/editor/opening_hours_ui.cpp:260:16: error: missing space between ‘""’ and suffix identifier using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:260:24: error: expected ‘;’ before ‘STRING_USERDEF’ token using osmoh::operator""_h;

/home/work/omim/editor/opening_hours_ui.cpp:260:24: error: unable to find string literal operator ‘operator"" _h’ /home/work/omim/editor/opening_hours_ui.cpp:261:16: error: missing space between ‘""’ and suffix identifier using osmoh::operator""_min;

/home/work/omim/editor/opening_hours_ui.cpp:261:24: error: expected ‘;’ before ‘STRING_USERDEF’ token using osmoh::operator""_min;

/home/work/omim/editor/opening_hours_ui.cpp:261:24: error: unable to find string literal operator ‘operator"" _min’ /home/work/omim/editor/opening_hours_ui.cpp:278:16: error: unable to find numeric literal operator ‘operator"" _h’ if (period < 3_h)

In file included from /home/work/omim/editor/opening_hours_ui.cpp:9:0: /home/work/omim/editor/opening_hours_ui.cpp:283:28: error: unable to find numeric literal operator ‘operator"" _h’ CHECK(excludeTimeStart < 24_h, ());

/home/work/omim/base/assert.hpp:20:32: note: in definition of macro ‘CHECK’

define CHECK(X, msg) do { if (X) {} else { \

/home/work/omim/editor/opening_hours_ui.cpp:286:57: error: unable to find numeric literal operator ‘operator"" _h’ longestOpenSpan.SetEnd(HourMinutes(excludeTimeStart + 1_h));

/home/work/omim/3party/opening_hours/rules_evaluation.cpp:13:14: error: missing space between ‘""’ and suffix identifier using osmoh::operator""_h;

/home/work/omim/3party/opening_hours/rules_evaluation.cpp:13:22: error: expected ‘;’ before ‘STRING_USERDEF’ token using osmoh::operator""_h;

/home/work/omim/3party/opening_hours/rules_evaluation.cpp:13:22: error: expected unqualified-id before ‘STRING_USERDEF’ token /home/work/omim/3party/opening_hours/rules_evaluation.cpp: In function ‘void {anonymous}::NormalizeExtendedEnd(osmoh::Timespan&)’: /home/work/omim/3party/opening_hours/rules_evaluation.cpp:122:18: error: unable to find numeric literal operator ‘operator"" _h’ if (duration < 24_h)

/home/work/omim/3party/opening_hours/rules_evaluation.cpp:123:43: error: unable to find numeric literal operator ‘operator"" _h’ endHourMinutes.SetDuration(duration + 24_h);

/home/work/omim/3party/opening_hours/rules_evaluation.cpp: In function ‘osmoh::TTimespans {anonymous}::SplitExtendedHours(osmoh::Timespan)’: /home/work/omim/3party/opening_hours/rules_evaluation.cpp:136:42: error: unable to find numeric literal operator ‘operator"" _h’ normalSpan.SetEnd(osmoh::HourMinutes(24_h));

/home/work/omim/3party/opening_hours/rules_evaluation.cpp:139:47: error: unable to find numeric literal operator ‘operator"" _h’ spanToBeSplit.SetStart(osmoh::HourMinutes(0_h));

/home/work/omim/3party/opening_hours/rules_evaluation.cpp:140:41: error: unable to find numeric literal operator ‘operator"" _h’ spanToBeSplit.GetEnd().AddDuration(-24_h);

/home/work/omim/3party/opening_hours/rules_evaluation.cpp: In function ‘tm {anonymous}::MakeTimetuple(time_t)’: /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_sec’ [-Wmissing-field-initializers] std::tm tm{};

/home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_min’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_hour’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_mday’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_mon’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_year’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_wday’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_yday’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_isdst’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_gmtoff’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp:182:14: warning: missing initializer for member ‘tm::tm_zone’ [-Wmissing-field-initializers] /home/work/omim/3party/opening_hours/rules_evaluation.cpp: In function ‘osmoh::RuleState {anonymous}::ModifierToRuleState(osmoh::RuleSequence::Modifier)’: /home/work/omim/3party/opening_hours/rules_evaluation.cpp:113:1: warning: control reaches end of non-void function [-Wreturn-type] }

ghost commented 7 years ago

Ubuntu 14.04, I follow https://github.com/mapsme/omim/blob/master/docs/INSTALL.md#ubuntu-1404, but there are still errors

ghost commented 7 years ago

inline constexpr Time::THours operator ""_h(unsigned long long int h) I don't understand this. Why can use operator overloading like this?

jasmeetsahni commented 7 years ago

how to compile this project can u please tell me am not understanding because there are so many files, which one to compile first.

ghost commented 7 years ago

@jasmeetsahni I compile the project by

tools/unix/build_omim.sh

jasmeetsahni commented 7 years ago

@alanclarkx can u tell me complete steps which u follow to compile it.