jeudi 28 avril 2016

google API client library based C++ build error about sample source

I have to Explain the step by step .When i was to build error.

http://ift.tt/12aLcRc

133 ./prepare_dependencies.py

134 ls

135 mkdir build

136 cd build/

137 ../external_dependencies/install/bin/cmake ..

138 make

First i have to fallowing this Error.

/home/david/workspace/src/google-api-cpp-client/src/googleapis/client/data/jsoncpp_data.cc: In member function ‘virtual googleapis::util::Status googleapis::client::JsonCppData::LoadFromJsonReader(googleapis::client::DataReader)’: /home/david/workspace/src/google-api-cpp-client/src/googleapis/client/data/jsoncpp_data.cc:64:46: error: ‘class Json::Reader’ has no member named ‘getFormattedErrorMessages’ return StatusInvalidArgument(json_reader.getFormattedErrorMessages());

^
make[2]: ** [src/googleapis/client/CMakeFiles/googleapis_jsoncpp.dir/data/jsoncpp_data.cc.o] 
make[1]: *** [src/googleapis/client/CMakeFiles/googleapis_jsoncpp.dir/all] 2
make: *** [all] 2

I was correct the bad word ‘getFormattedErrorMessages- >‘getFormatedErrorMessages

140 ls

141 cd ..

142 ls

143 vi CMakeLists.txt

144 vi /home/david/workspace/src/google-api-cpp-client/src/googleapis/client/data/jsoncpp_data.cc

145 cd build/

146 make

[ 87%] Building CXX object src/samples/CMakeFiles/calendar_sample.dir/calendar_sample_main.cc.o
Linking CXX executable ../../bin/calendar_sample
/usr/bin/ld: cannot find -lgoogle_calendar_api
collect2: error: ld returned 1 exit status
make[2]: *** [bin/calendar_sample] 1
make[1]: *** [src/samples/CMakeFiles/calendar_sample.dir/all] 2
make: *** [all] 2
Second I was Correct the CMakefile in root dir.

    OFF -> option(googleapis_build_service_apis "Build specialized service APIs." ON)
    OFF -> option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." ON)

    and Service_api/Cmakefile.txt
    if(${dir} MATCHES "^([^/])//CMakeLists.txt")
    -> if(${dir} MATCHES "^([^/])/CMakeLists.txt")

CMakeFiles/calendar_sample.dir/calendar_sample_main.cc.o: In function googleapis::Display(std::string const&, google_calendar_api::Event const&)': calendar_sample_main.cc:(.text+0x8ef): undefined reference togoogle_calendar_api::Event::get_start() const' calendar_sample_main.cc:(.text+0x924): undefined reference to google_calendar_api::Event::get_start() const' calendar_sample_main.cc:(.text+0x9bb): undefined reference togoogle_calendar_api::Event::get_end() const'

calendar_sample_main.cc:(.text+0x9f0): undefined reference to google_calendar_api::Event::get_end() const' CMakeFiles/calendar_sample.dir/calendar_sample_main.cc.o: In functiongoogleapis::CalendarSample::Startup(int, char*)': calendar_sample_main.cc:(.text+0xd6e): undefined reference to `googleapis::client::OAuth2AuthorizationFlow::MakeFlowFromClientSecretsPath(std::string const&, googleapis::client::HttpTransport, googleapis::util::Status)'

  CMakeFiles/calendar_sample.dir/calendar_sample_main.cc.o: In function googleapis::CalendarSample::Run()': calendar_sample_main.cc:(.text+0x2659): undefined reference togoogle_calendar_api::Event::mutable_start()'
    calendar_sample_main.cc:(.text+0x26dc): undefined reference to google_calendar_api::Event::mutable_end()' calendar_sample_main.cc:(.text+0x28ba): undefined reference togoogle_calendar_api::Event::mutable_start()'
    calendar_sample_main.cc:(.text+0x293d): undefined reference to google_calendar_api::Event::mutable_end()' calendar_sample_main.cc:(.text+0x2b2f): undefined reference togoogle_calendar_api::Event::mutable_start()'
    calendar_sample_main.cc:(.text+0x2bc4): undefined reference to google_calendar_api::Event::mutable_end()' CMakeFiles/calendar_sample.dir/calendar_sample_main.cc.o: In functionvoid googleapis::DisplayList(std::string const&, std::string const&, google_calendar_api::CalendarList const&)':
    calendar_sample_main.cc:(.text.ZN10googleapis11DisplayListIN19google_calendar_api12CalendarListENS1_17CalendarListEntryEEEvRKSsS5_RKT[ZN10googleapis11DisplayListIN19google_calendar_api12CalendarListENS1_17CalendarListEntryEEEvRKSsS5_RKT]+0xda): undefined reference to google_calendar_api::CalendarList::get_items() const' CMakeFiles/calendar_sample.dir/calendar_sample_main.cc.o: In functionvoid googleapis::DisplayList(std::string const&, std::string const&, google_calendar_api::Events const&)':
    calendar_sample_main.cc:(.text.ZN10googleapis11DisplayListIN19google_calendar_api6EventsENS1_5EventEEEvRKSsS5_RKT[ZN10googleapis11DisplayListIN19google_calendar_api6EventsENS1_5EventEEEvRKSsS5_RKT]+0xda): undefined reference to `google_calendar_api::Events::get_items() const'
    collect2: error: ld returned 1 exit status
    make[2]: ** [bin/calendar_sample] 1
    make[1]: *** [src/samples/CMakeFiles/calendar_sample.dir/all] 2
    make: *** [all] 2

So i can`t build to success . Plz Anyone help me ~

Aucun commentaire:

Enregistrer un commentaire