C++ 在linux服务器(u2)上编译警告长
我在eclipse(3.8)上编译时没有警告和错误,但在服务器“u2”上编译时,屏幕上会出现以下警告:C++ 在linux服务器(u2)上编译警告长,c++,linux,long-integer,C++,Linux,Long Integer,我在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
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中的一行中,表示长。
这是我的课程之一:
#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”标志进行编译。如果你真的不需要它,就把它关掉。编译器太旧了。可能是因为佐哈尔·阿戈夫于1987年去世。他从来不知道比gcc 0.9更新的编译器。这个编译器太旧了。可能是因为Zohar Argov在1987年去世了。他从未见过比gcc 0.9更新的编译器。