easy_profiler icon indicating copy to clipboard operation
easy_profiler copied to clipboard

Not building with gcc 4.8.5 - Unsupported

Open zyth0s opened this issue 5 years ago • 4 comments

When I tried to compile easy_profiler with gcc 4.8.5 I encountered the following error:

profiler_gui/main_window.cpp:2163:17: note: #pragma message: Warning: in gcc 4 and lower std::stringstream has no swap()! Memory consumption may increase! Better use gcc 5 or higher instead.
 #pragma message "Warning: in gcc 4 and lower std::stringstream has no swap()! Memory consumption may increase! Better use gcc 5 or higher instead."
...
easy_profiler_converter/include/json.hpp:67:10: error: #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"
         #error "unsupported GCC version - see https://github.com/nlohmann/json#supported-compilers"


When I compile with Clang 7.0.0: profiler_gui/main_window.cpp:2166:14: error: no member named 'swap' in 'std::basic_stringstream<char>'

Both compilers are expected to work after reading the prerequisites:

  • Compiler with c++11 support

    • for Unix systems: compiler with thread_local support is highly recommended: GCC >=4.8, Clang>=3.3

Fortunately, it compiled with gcc-8.

zyth0s avatar Dec 17 '18 13:12 zyth0s

Honestly, using anything related to streams in C++ was a bad idea. I believe the first case (4.8.5) just requires better documentation saying that gcc version X is required for the json converter. If you just want core and/or the gui, then you can just not build the json converter. It's not needed for anything.

rationalcoder avatar Dec 24 '18 03:12 rationalcoder

Oops, we haven't checked gcc-4 build after adding json-cpp :man_facepalming:
But, as @rationalcoder already mentioned, you can exclude profiler_converter when building with gcc-4.
And thanks for reporting about clang-7!

cas4ey avatar Jan 09 '19 22:01 cas4ey

It is good to know prerequisites is CMake >= 3.0 and GCC >= 4.8, I misunderstand compile easy_profiler may be need GCC7+ when I was reading "https://github.com/yse/easy_profiler/wiki/Known-bugs-and-issues". I will search for solution want to compile easy profiler core for embedded system which installed centos 7.4, and compile easy profiler gui for ubuntu 16.04 desktop. Any ideas?

Haffon avatar Mar 02 '19 09:03 Haffon

When I compile with Clang 7.0.0: profiler_gui/main_window.cpp:2166:14: error: no member named 'swap' in 'std::basic_stringstream<char>'

BTW, compiled with clang-7 without errors. Also downloaded clang libc++ source code from clang.llvm.org and there is a public basic_stringstream::swap in include/sstream :man_shrugging:

I will search for solution want to compile easy profiler core for embedded system which installed centos 7.4, and compile easy profiler gui for ubuntu 16.04 desktop. Any ideas?

Faced any problems?

cas4ey avatar Oct 30 '19 13:10 cas4ey