qmule / libed2k

79 stars 27 forks source link

unrecognized command line option ‘-m64’ #5

Closed UnknownObject000 closed 4 years ago

UnknownObject000 commented 4 years ago

I am building this on a arm based ubuntu system.When I use command make , there is an error: c++: error: unrecognized command line option ‘-m64’.Here are all command I have runed:

root@localhost:~# git clone https://github.com/qmule/libed2k.git
Cloning into 'libed2k'...
remote: Enumerating objects: 10339, done.
remote: Total 10339 (delta 0), reused 0 (delta 0), pack-reused 10339
Receiving objects: 100% (10339/10339), 7.56 MiB | 96.00 KiB/s, done.
Resolving deltas: 100% (6512/6512), done.
root@localhost:~# cd libed2k/
root@localhost:~/libed2k# ls
CMakeLists.txt  README.md  SConstruct  cmake  docs  include  libed2k  logging.zip  src  test  unit
root@localhost:~/libed2k# mkdir build
root@localhost:~/libed2k# cd build/
root@localhost:~/libed2k/build# ls
root@localhost:~/libed2k/build# cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 64 bits compiler detected
-- DATA_MODEL is not set. Use platform 64
-- DATA_MODEL      = 64
-- PRODUCTION      = OFF
-- BUILD_TESTS     = ON
-- BUILD_TOOLS     = ON
-- BUILD_SHARED    = OFF
-- DHT  = enabled
-- DHT_VERBOSE  = OFF
-- UPNP_VERBOSE = OFF
-- C++ compiler version: 7.5.0 [/usr/bin/c++]
-- Boost 1.40 found.
-- Found Boost components:
   system;thread;random;date_time;unit_test_framework;unit_test_framework   
 -- Configuring done
-- Generating done   
-- Build files have been written to: /root/libed2k/build                                                        
root@localhost:~/libed2k/build# make
Scanning dependencies of target ed2k                                                                            
[  1%] Building CXX object CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o
c++: error: unrecognized command line option ‘-m64’                    
CMakeFiles/ed2k.dir/build.make:62: recipe for target' CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o' failed
make[2]: *** [CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o] Error 1              
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/ed2k.dir/all' failed        
make[1]: *** [CMakeFiles/ed2k.dir/all] Error 2                         
Makefile:83: recipe for target 'all' failed                                                                     
make: *** [all] Error 2

What can I do to solve this?

a-pavlov commented 4 years ago

@UnknownObject000 Nowadays mostly compilers come with default x64 mode and looks like -m64 options is obsolete. Please comment https://github.com/qmule/libed2k/blob/5408c6503b8eb94d0f59f16a1f0c2a8a578f4bba/cmake/Linux.cmake#L27 and https://github.com/qmule/libed2k/blob/5408c6503b8eb94d0f59f16a1f0c2a8a578f4bba/cmake/Linux.cmake#L28 using #, generate make files again from scratch and try again.

UnknownObject000 commented 4 years ago
CMake Error at cmake/Targets.cmake:45 (set_target_properties):
  set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
  CMakeLists.txt:22 (include)

CMake Error at cmake/Targets.cmake:56 (set_target_properties):
  set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
  CMakeLists.txt:22 (include)

CMake Error at cmake/Targets.cmake:56 (set_target_properties):
  set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
  CMakeLists.txt:22 (include)

CMake Error at cmake/Targets.cmake:56 (set_target_properties):
  set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
  CMakeLists.txt:22 (include)

CMake Error at cmake/Targets.cmake:76 (set_target_properties):
  set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
  CMakeLists.txt:22 (include)

-- Configuring incomplete, errors occurred!

I commented the line 45,56,76 using # ,cmake passed.But some complier error caused.

root@localhost:~/libed2k/build# make
Scanning dependencies of target ed2k
[  1%] Building CXX object CMakeFiles/ed2k.dir/src/ConvertUTF.cpp.o
[  2%] Building CXX object CMakeFiles/ed2k.dir/src/add_transfer_params.cpp.o
In file included from /root/libed2k/include/libed2k/escape_string.hpp:41:0,
                 from /root/libed2k/include/libed2k/peer_id.hpp:45,
                 from /root/libed2k/include/libed2k/hasher.hpp:6,
                 from /root/libed2k/include/libed2k/add_transfer_params.hpp:4,
                 from /root/libed2k/src/add_transfer_params.cpp:1:
/root/libed2k/include/libed2k/error_code.hpp: In function ‘const boost::system::error_category& libed2k::get_system_category()’:
/root/libed2k/include/libed2k/error_code.hpp:174:29: error: ‘get_system_category’ is not a member of ‘boost::system’
     { return boost::system::get_system_category(); }
                             ^~~~~~~~~~~~~~~~~~~
/root/libed2k/include/libed2k/error_code.hpp:174:29: note: suggested alternative: ‘system_category’
     { return boost::system::get_system_category(); }
                             ^~~~~~~~~~~~~~~~~~~
                             system_category
/root/libed2k/include/libed2k/error_code.hpp: In function ‘const boost::system::error_category& libed2k::get_posix_category()’:
/root/libed2k/include/libed2k/error_code.hpp:181:29: error: ‘get_generic_category’ is not a member of ‘boost::system’
     { return boost::system::get_generic_category(); }
                             ^~~~~~~~~~~~~~~~~~~~
/root/libed2k/include/libed2k/error_code.hpp:181:29: note: suggested alternative: ‘generic_category’
     { return boost::system::get_generic_category(); }
                             ^~~~~~~~~~~~~~~~~~~~
                             generic_category
In file included from /root/libed2k/include/boost/logging/detail/tss/tss_impl.hpp:54:0,
                 from /root/libed2k/include/boost/logging/detail/tss/tss.hpp:30,
                 from /root/libed2k/include/boost/logging/detail/ts/ts_resource.hpp:25,
                 from /usr/local/include/boost/shared_ptr.hpp:17,
                 from /root/libed2k/include/libed2k/error_code.hpp:6,
                 from /root/libed2k/include/libed2k/escape_string.hpp:41,
                 from /root/libed2k/include/libed2k/peer_id.hpp:45,
                 from /root/libed2k/include/libed2k/hasher.hpp:6,
                 from /root/libed2k/include/libed2k/add_transfer_params.hpp:4,
                 from /root/libed2k/src/add_transfer_params.cpp:1:
/usr/include/c++/7/bits/unique_ptr.h:51:28: note: declared here
   template<typename> class auto_ptr;
                            ^~~~~~~~
CMakeFiles/ed2k.dir/build.make:86: recipe for target 'CMakeFiles/ed2k.dir/src/add_transfer_params.cpp.o' failed
make[2]: *** [CMakeFiles/ed2k.dir/src/add_transfer_params.cpp.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/ed2k.dir/all' failed
make[1]: *** [CMakeFiles/ed2k.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
UnknownObject000 commented 4 years ago

Is this a boost version problem?Dose the hint from gcc right?

a-pavlov commented 4 years ago

Boost 1.49 is minimal version as I remember. Please see https://github.com/qmule/libed2k/wiki/Boost

UnknownObject000 commented 4 years ago

I've checked the document of Boost,they removed get_io_service() in 1.70+...