Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

logging_unittest-logging_unittest.o ERROR 1 #104

Closed
waybarrios opened this issue Apr 19, 2016 · 1 comment
Closed

logging_unittest-logging_unittest.o ERROR 1 #104

waybarrios opened this issue Apr 19, 2016 · 1 comment

Comments

@waybarrios
Copy link

waybarrios commented Apr 19, 2016

Hello,

I try to compile this repo but It always show me the following error:

+-DHAVE_CONFIG_H -I. -I./src -I./src -pthread -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare -DNO_FRAME_POINTER -fPIC -MT src/logging_unittest-logging_unittest.o -MD -MP -MF src/.deps/logging_unittest-logging_unittest.Tpo -c -o src/logging_unittest-logging_unittest.otest -f 'src/logging_unittest.cc' || echo './'src/logging_unittest.cc src/logging_unittest.cc:64:17: error: ‘GFLAGS_NAMESPACE’ is not a namespace-name using namespace GFLAGS_NAMESPACE; ^ src/logging_unittest.cc:64:33: error: expected namespace-name before ‘;’ token using namespace GFLAGS_NAMESPACE; ^ src/logging_unittest.cc: In function ‘int main(int, char**)’: src/logging_unittest.cc:180:43: error: ‘ParseCommandLineFlags’ was not declared in this scope ParseCommandLineFlags(&argc, &argv, true); ^ src/logging_unittest.cc:180:43: note: suggested alternative: In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:346:31: note: ‘gflags::ParseCommandLineFlags’ extern GFLAGS_DLL_DECL uint32 ParseCommandLineFlags(int *argc, char*** argv, bool remove_flags); ^ In file included from src/logging_unittest.cc:58:0: src/logging_unittest.cc: In static member function ‘static void Test_DeathNoAllocNewHook_logging::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:297:1: note: in expansion of macro ‘TEST’ TEST(DeathNoAllocNewHook, logging) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:297:1: note: in expansion of macro ‘TEST’ TEST(DeathNoAllocNewHook, logging) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:297:1: note: in expansion of macro ‘TEST’ TEST(DeathNoAllocNewHook, logging) { ^ src/logging_unittest.cc: In function ‘void TestRawLogging()’: src/logging_unittest.cc:309:3: error: ‘FlagSaver’ was not declared in this scope FlagSaver saver; ^ src/logging_unittest.cc:309:3: note: suggested alternative: In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ src/logging_unittest.cc:309:13: error: expected ‘;’ before ‘saver’ FlagSaver saver; ^ src/logging_unittest.cc: In function ‘void LogWithLevels(int, int, bool, bool)’: src/logging_unittest.cc:364:3: error: ‘FlagSaver’ was not declared in this scope FlagSaver saver; ^ src/logging_unittest.cc:364:3: note: suggested alternative: In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ src/logging_unittest.cc:364:13: error: expected ‘;’ before ‘saver’ FlagSaver saver; ^ In file included from src/logging_unittest.cc:58:0: src/logging_unittest.cc: In static member function ‘static void Test_DeathRawCHECK_logging::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:437:1: note: in expansion of macro ‘TEST’ TEST(DeathRawCHECK, logging) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:437:1: note: in expansion of macro ‘TEST’ TEST(DeathRawCHECK, logging) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:437:1: note: in expansion of macro ‘TEST’ TEST(DeathRawCHECK, logging) { ^ src/logging_unittest.cc: In static member function ‘static void Test_DeathSTREQ_logging::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:587:1: note: in expansion of macro ‘TEST’ TEST(DeathSTREQ, logging) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:587:1: note: in expansion of macro ‘TEST’ TEST(DeathSTREQ, logging) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:587:1: note: in expansion of macro ‘TEST’ TEST(DeathSTREQ, logging) { ^ src/logging_unittest.cc: In static member function ‘static void Test_CheckNOTNULL_Simple::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:597:1: note: in expansion of macro ‘TEST’ TEST(CheckNOTNULL, Simple) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:597:1: note: in expansion of macro ‘TEST’ TEST(CheckNOTNULL, Simple) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:597:1: note: in expansion of macro ‘TEST’ TEST(CheckNOTNULL, Simple) { ^ src/logging_unittest.cc: In static member function ‘static void Test_DeathCheckNN_Simple::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:608:1: note: in expansion of macro ‘TEST’ TEST(DeathCheckNN, Simple) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:608:1: note: in expansion of macro ‘TEST’ TEST(DeathCheckNN, Simple) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:608:1: note: in expansion of macro ‘TEST’ TEST(DeathCheckNN, Simple) { ^ src/logging_unittest.cc: In static member function ‘static void Test_SafeFNMatch_logging::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:868:1: note: in expansion of macro ‘TEST’ TEST(SafeFNMatch, logging) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:868:1: note: in expansion of macro ‘TEST’ TEST(SafeFNMatch, logging) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:868:1: note: in expansion of macro ‘TEST’ TEST(SafeFNMatch, logging) { ^ src/logging_unittest.cc: In static member function ‘static void Test_Strerror_logging::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:1043:1: note: in expansion of macro ‘TEST’ TEST(Strerror, logging) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:1043:1: note: in expansion of macro ‘TEST’ TEST(Strerror, logging) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:1043:1: note: in expansion of macro ‘TEST’ TEST(Strerror, logging) { ^ src/logging_unittest.cc: In static member function ‘static void Test_UserDefinedClass_logging::Run()’: src/googletest.h:177:25: error: ‘FlagSaver’ was not declared in this scope static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:1209:1: note: in expansion of macro ‘TEST’ TEST(UserDefinedClass, logging) { ^ src/googletest.h:177:25: note: suggested alternative: static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:1209:1: note: in expansion of macro ‘TEST’ TEST(UserDefinedClass, logging) { ^ In file included from src/glog/logging.h:86:0, from src/utilities.h:82, from src/logging_unittest.cc:33: /usr/include/gflags/gflags.h:277:23: note: ‘gflags::FlagSaver’ class GFLAGS_DLL_DECL FlagSaver { ^ In file included from src/logging_unittest.cc:58:0: src/googletest.h:177:35: error: expected ‘;’ before ‘fs’ static void Run() { FlagSaver fs; RunTest(); } \ ^ src/logging_unittest.cc:1209:1: note: in expansion of macro ‘TEST’ TEST(UserDefinedClass, logging) { ^ make: *** [src/logging_unittest-logging_unittest.o] Error 1

So, Does anyone know how to fix it?

thanks

@kyu-sz
Copy link

kyu-sz commented May 4, 2017

This is probably because the current GLOG depends on a GFLAGS version higher than default provided in your system.

I got this fixed on my CentOS system by cleaning everything, compiling and installing the latest GFLAGS cloned from Github, and build GLOG again.

Note that do not use autoreconf. Use CMake3 to generate Makefile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants