在 linux 服务器上编译 (u2) warning long long

compiling on linux server (u2) warning long long

当我在 eclipse (3.8) 上编译时,我没有警告和错误,但是在服务器 "u2" 上编译时,屏幕上出现以下警告:

In file included from gtest-all.cc:39:
gtest.h:17459:47: warning: anonymous variadic macros were introduced in C99
In file included from gtest-all.cc:39:
gtest.h:2756: warning: ISO C++ 1998 does not support 'long long'
gtest.h:3001: warning: ISO C++ 1998 does not support 'long long'
gtest.h:3002: warning: ISO C++ 1998 does not support 'long long'
gtest-all.cc: In function 'bool testing::internal::ParseNaturalNumber 
(const   std::string&, Integer*)':
gtest-all.cc:1424: warning: ISO C++ 1998 does not support 'long long'

警告出现在 gtest.h 中引用 long long 的一行中。 这是我的 类:

#include "gtest/gtest.h"
#include "MovieSystem.h"
#include "Menu.h"
class TestMenu: public::testing::Test {
protected:
Menu menu;

public:
virtual void SetUp(){
}
virtual void TearDown(){
}
public:
TestMenu() :
    menu(){}
};

/***********************************************
 * test the printing of the function show menu *
 ***********************************************/
TEST_F(TestMenu, ShowMenuCheck){
string ExpectedOut = "choose an option: \n"
        "1. Create new movie. \n"
        "2. Create new cast member. \n"
        "3. Add a cast member to a movie. \n"
        "4. Add genre to a movie. \n"
        "5. Define sort type to cast members of a movie. \n"
        "6. Print cast of a movie. \n"
        "7. Print a movie. \n"
        "8. Add movies. \n"
        "9. Print all movies of a cast member. \n"
        "10. Remove a movie. \n"
        "11. Remove a cast member. \n"
        "12. Remove a cast member from a movie. \n"
        "13. Print all movies. \n"
        "14. Print all cast members. \n";
testing::internal::CaptureStdout();
menu.showMenu();
std::string ActualOut = testing::internal::GetCapturedStdout();
EXPECT_STREQ(ExpectedOut.c_str(), ActualOut.c_str());
}

有人知道问题出在哪里吗? 请..

您正在使用 "pedantic" 标志进行编译。如果你真的不需要它,请将其关闭。