chronoxor / CppServer

Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
MIT License
1.43k stars 284 forks source link

Errors about bfd_section_vma, bfd_section_size, and bfd_section_flags #60

Closed arjangupta closed 2 years ago

arjangupta commented 3 years ago

When executing unix.sh on Ubuntu 20, I get the following errors:

[ 36%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stack_trace.cpp.o
[ 36%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stack_trace_manager.cpp.o
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:165:50: error: macro "bfd_section_vma" requires 2 arguments, but only 1 given
             bfd_vma vma = bfd_section_vma(section);
                                                  ^
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:169:61: error: macro "bfd_section_size" requires 2 arguments, but only 1 given
             bfd_size_type secsize = bfd_section_size(section);
                                                             ^
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp: In constructor ‘CppCommon::StackTrace::StackTrace(int)’:
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:162:18: error: ‘bfd_section_flags’ was not declared in this scope
             if ((bfd_section_flags(section) & SEC_ALLOC) == 0)
                  ^~~~~~~~~~~~~~~~~
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:162:18: note: suggested alternative: ‘bfd_set_section_flags’
             if ((bfd_section_flags(section) & SEC_ALLOC) == 0)
                  ^~~~~~~~~~~~~~~~~
                  bfd_set_section_flags
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:165:27: error: ‘bfd_section_vma’ was not declared in this scope
             bfd_vma vma = bfd_section_vma(section);
                           ^~~~~~~~~~~~~~~
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:165:27: note: suggested alternative: ‘bfd_scan_vma’
             bfd_vma vma = bfd_section_vma(section);
                           ^~~~~~~~~~~~~~~
                           bfd_scan_vma
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:169:37: error: ‘bfd_section_size’ was not declared in this scope
             bfd_size_type secsize = bfd_section_size(section);
                                     ^~~~~~~~~~~~~~~~
/home/CppServer/modules/CppCommon/source/system/stack_trace.cpp:169:37: note: suggested alternative: ‘bfd_set_gp_size’
             bfd_size_type secsize = bfd_section_size(section);
                                     ^~~~~~~~~~~~~~~~
                                     bfd_set_gp_size
[ 37%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stream.cpp.o
modules/CppCommon/CMakeFiles/cppcommon.dir/build.make:453: recipe for target 'modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stack_trace.cpp.o' failed
make[2]: *** [modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stack_trace.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:1788: recipe for target 'modules/CppCommon/CMakeFiles/cppcommon.dir/all' failed
make[1]: *** [modules/CppCommon/CMakeFiles/cppcommon.dir/all] Error 2
Makefile:145: recipe for target 'all' failed
make: *** [all] Error 2

All of these seem to be coming from CppCommon.

chronoxor commented 3 years ago

Please try to install required Linux packages: sudo apt-get update -y sudo apt-get install -y binutils-dev uuid-dev libssl-dev

KamranArain commented 3 years ago

same issue here I installed packages bit it didn't worked for me.

kamran@ubuntu:~/kaam/CppServer/build$ sudo apt-get install -y binutils-dev uuid-dev libssl-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
binutils-dev is already the newest version (2.30-21ubuntu1~18.04.5).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.9).
uuid-dev is already the newest version (2.31.1-0.4ubuntu3.7).

Here is error

/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:165:50: error: macro "bfd_section_vma" requires 2 arguments, but only 1 given
             bfd_vma vma = bfd_section_vma(section);
                                                  ^
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:169:61: error: macro "bfd_section_size" requires 2 arguments, but only 1 given
             bfd_size_type secsize = bfd_section_size(section);
                                                             ^
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp: In constructor ‘CppCommon::StackTrace::StackTrace(int)’:
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:162:18: error: ‘bfd_section_flags’ was not declared in this scope
             if ((bfd_section_flags(section) & SEC_ALLOC) == 0)
                  ^~~~~~~~~~~~~~~~~
[ 28%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/threads/latch.cpp.o
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:162:18: note: suggested alternative: ‘bfd_set_section_flags’
             if ((bfd_section_flags(section) & SEC_ALLOC) == 0)
                  ^~~~~~~~~~~~~~~~~
                  bfd_set_section_flags
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:165:27: error: ‘bfd_section_vma’ was not declared in this scope
             bfd_vma vma = bfd_section_vma(section);
                           ^~~~~~~~~~~~~~~
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:165:27: note: suggested alternative: ‘bfd_scan_vma’
             bfd_vma vma = bfd_section_vma(section);
                           ^~~~~~~~~~~~~~~
                           bfd_scan_vma
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:169:37: error: ‘bfd_section_size’ was not declared in this scope
             bfd_size_type secsize = bfd_section_size(section);
                                     ^~~~~~~~~~~~~~~~
/home/kamran/kaam/CppServer/modules/CppCommon/source/system/stack_trace.cpp:169:37: note: suggested alternative: ‘bfd_set_gp_size’
             bfd_size_type secsize = bfd_section_size(section);
                                     ^~~~~~~~~~~~~~~~
                                     bfd_set_gp_size
[ 29%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/threads/mutex.cpp.o
modules/CppCommon/CMakeFiles/cppcommon.dir/build.make:710: recipe for target 'modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stack_trace.cpp.o' failed

there are 2 paramters for

#define bfd_section_vma(bfd, ptr) ((ptr)->vma)

there are also some other errors as well as written above

tariromukute commented 3 years ago

Hi @KamranArain. I had the same issue on ubuntu 18.04. This seems to be an issue with binutils-dev version 2.30 which you installed. This issue was resolved in https://github.com/bombela/backward-cpp/pull/165. However on ubuntu 18.04 the latest version of binutils-dev is 2.30. I resolved this by upgrading to ubuntu 20.04 and installing binutils-dev version 2.34.