-
Notifications
You must be signed in to change notification settings - Fork 378
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
Trying to build the new SIPp 3.6.1 on CentOS 7 #485
Comments
I think your c++ compiler is too old. Try this: diff --git a/src/screen.cpp b/src/screen.cpp
index bbf9cd2..925bd1f 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -83,15 +83,15 @@ void print_statistics(int last)
void ScreenPrinter::print_closing_stats() {
M_last = true;
get_lines();
- for (auto line : lines) {
- printf("%s\n", line.c_str());
+ for (auto it = lines.begin(); it != lines.end(); ++it) {
+ printf("%s\n", (*it).c_str());
}
if (currentScreenToDisplay != DISPLAY_STAT_SCREEN) {
currentScreenToDisplay = DISPLAY_STAT_SCREEN;
get_lines();
- for (auto line : lines) {
- printf("%s\n", line.c_str());
+ for (auto it = lines.begin(); it != lines.end(); ++it) {
+ printf("%s\n", (*it).c_str());
}
}
@@ -100,8 +100,8 @@ void ScreenPrinter::print_closing_stats() {
void ScreenPrinter::print_to_file(FILE* f)
{
get_lines();
- for (auto line : lines) {
- fprintf(f, "%s\n", line.c_str());
+ for (auto it = lines.begin(); it != lines.end(); ++it) {
+ fprintf(f, "%s\n", (*it).c_str());
}
}
@@ -114,8 +114,8 @@ void ScreenPrinter::redraw()
if (!M_headless) {
get_lines();
erase();
- for (auto line : lines) {
- printw("%s\n", line.c_str());
+ for (auto it = lines.begin(); it != lines.end(); ++it) {
+ printw("%s\n", (*it).c_str());
}
if (command_mode) { |
I have gcc 9.3.1 (from devtoolset-9), this is not sufficient ?
|
Seems odd. I have g++-7.5 and it works just fine over here. Maybe you have some other compiler flag going on, but I cannot tell from your output.
Also, I realise I changed the iterator-stuff, but not the auto-stuff, which the compiler actually complained about. So, the entire change would then be: diff --git a/include/screen.hpp b/include/screen.hpp
index 13a9708..e2ad1f2 100644
--- a/include/screen.hpp
+++ b/include/screen.hpp
@@ -43,6 +43,8 @@ void print_statistics(int last);
extern int key_backspace;
extern int key_dc;
+typedef std::vector<std::string> string_array;
+
class ScreenPrinter {
public:
ScreenPrinter():
@@ -63,7 +65,7 @@ private:
void draw_repartition_detailed(CStat::T_dynamicalRepartition * tabRepartition,
int sizeOfTab);
- std::vector<std::string> lines;
+ string_array lines;
bool M_last = false;
};
diff --git a/src/screen.cpp b/src/screen.cpp
index bbf9cd2..5521a44 100644
--- a/src/screen.cpp
+++ b/src/screen.cpp
@@ -83,15 +83,15 @@ void print_statistics(int last)
void ScreenPrinter::print_closing_stats() {
M_last = true;
get_lines();
- for (auto line : lines) {
- printf("%s\n", line.c_str());
+ for (string_array::iterator it = lines.begin(); it != lines.end(); ++it) {
+ printf("%s\n", (*it).c_str());
}
if (currentScreenToDisplay != DISPLAY_STAT_SCREEN) {
currentScreenToDisplay = DISPLAY_STAT_SCREEN;
get_lines();
- for (auto line : lines) {
- printf("%s\n", line.c_str());
+ for (string_array::iterator it = lines.begin(); it != lines.end(); ++it) {
+ printf("%s\n", (*it).c_str());
}
}
@@ -100,8 +100,8 @@ void ScreenPrinter::print_closing_stats() {
void ScreenPrinter::print_to_file(FILE* f)
{
get_lines();
- for (auto line : lines) {
- fprintf(f, "%s\n", line.c_str());
+ for (string_array::iterator it = lines.begin(); it != lines.end(); ++it) {
+ fprintf(f, "%s\n", (*it).c_str());
}
}
@@ -114,8 +114,8 @@ void ScreenPrinter::redraw()
if (!M_headless) {
get_lines();
erase();
- for (auto line : lines) {
- printw("%s\n", line.c_str());
+ for (string_array::iterator it = lines.begin(); it != lines.end(); ++it) {
+ printw("%s\n", (*it).c_str());
}
if (command_mode) { |
Apparently CMake is explicitly using "/bin/c++" which is the distros default... (gcc version 4.8.5, that's old)
I've solved my issue by editing the "build.sh" as follows:
|
Could you also try the change above? I'll gladly let that land in 3.6.x because I don't want to make the 3.6 branch incompatible because of just those 4 |
Actually CMake does correctly use the newer compiler. |
I tried to build with the older compiler with your source changes above.
|
Ok. So 626de65 made things work with pre-C++11 compilers. And for the dev (master or 3.7.x) branch I added appropriate checks for a newer compiler. Thanks for the report! |
Hello,
I'm trying to build the new SIPp 3.6.1 on CentOS 7.
I'm not sure of the prerequisites, I did not find much information except that I need CMake.
So I tried with:
Which gives me errors:
(etc.)
Is this too old maybe ?
If so could you detail the prerequisites for building SIPp 3.6.1 ?
Thanks for your help.
The text was updated successfully, but these errors were encountered: