在linux服务器(u2)上编译警告long-long

compiling on linux server (u2) warning long long

本文关键字:编译 警告 long-long u2 linux 服务器      更新时间:2023-10-16

当我在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"标志进行编译。如果你真的不需要它,就把它关掉。