Closed ehabtanta closed 9 years ago
What's the OS (version) your trying it on? Which openssl version have you installed/compiled?
As for the google test issue, you can probably try to comment out the
add_subdirectory(tests)
in https://github.com/awidegreen/tr064/blob/master/CMakeLists.txt#L41 for the time being
tnx for replying i am using centOS 7 for the time being and i workaround the openssl issue by this command cmake -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_LIBRARIES=/usr/local/ssl/lib but when i try to make -j 4 i receive the following errors
[ 61%] Building CXX object lib/CMakeFiles/tr064.dir/soap/Session.cc.o Linking CXX shared library libtr064.so /usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(md5_one.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC /usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value collect2: error: ld returned 1 exit status make[2]: * [lib/libtr064.so] Error 1 make[1]: * [lib/CMakeFiles/tr064.dir/all] Error 2 make: *\ [all] Error 2
os: centos 7 openssl v: OpenSSL 1.0.1e-fips 11 Feb 2013 i complied 1.0.2a multi times but the system still reads this version gcc version : gcc (GCC) 4.8.3 20140911 cmake :cmake version 3.2.2 gtest v :1.7 ( cant get it with gtest version nor GTEST --VERION COMMANDS ) bosst : 1.54
this is the cmake output
[ehab@localhost x]$ cmake .. -DOPENSSL_ROOT_DIR=/usr/local/ssl -DOPENSSL_LIBRARIES=/usr/local/ssl/lib
-- Found OpenSSL: /usr/local/ssl/lib/libssl.a;/usr/local/ssl/lib/libcrypto.a (found version "1.0.2a")
-- Boost version: 1.54.0
-- Found the following Boost libraries:
-- system
-- OPENSSL_LIBRARIES defined.
-- OPENSSL_INCLUDE_DIR defined.
-- Found GTest: /usr/lib/libgtest.so
-- Found Gtest, including unit tests.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ehab/Desktop/tr64/x
I tried it myself on centos7; worked for me. However I only used standard yum packages
openssl-devel
openssl-libs
boost-devel
gcc-c++.x86_64 4.8.3-9.el7
I needed to remove the REQUIRED
in the CMakeLists.txt
when finding gtest, because I couldn't find a gtest package for centos easily. I will probably push this, so that the unittest is only compiled and used when gtest is available.
Anyway, that worked perfectly for me.
[vagrant@localhost build]$ cmake ..
-- The C compiler identification is GNU 4.8.3
-- The CXX compiler identification is GNU 4.8.3
-- 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
-- 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
-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.1e")
-- Boost version: 1.53.0
-- Found the following Boost libraries:
-- system
-- OPENSSL_LIBRARIES defined.
-- OPENSSL_INCLUDE_DIR defined.
-- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
-- Found NOT Gtest, unit tests not included in build.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/vagrant/tr064/build
As for your problem, I can see that your openssl is a static lib (*.a) ... any specific reason for that? The compiler is actually telling you what the problem is:
/usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(md5_one.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
Using a shared lib for openssl should solve your issue, I guess.
yep i konw that this is the issue but honestly i dont know why it is that way and couldnt replace it with a new version
can u please tel me how to replace the static openssl with a shared lib one ?
well ... provide the shared
parameter, I guess
see https://wiki.openssl.org/index.php/Compilation_and_Installation
./cofig shared make make install doing it right now will see the result by the way i want to use it with another cpe not the firtiz box i know the device ip and the tr064 port & xml file path how to integrate the info ?
it wont work tried alot of shared comands even tried to remove openssl and recomplie it but sitll gives this error
make[4]: * [link_a.gnu] Error 1 make[4]: Leaving directory '/home/e/Downloads/openssl-1.0.2a' Makefile:349: recipe for target 'do_linux-shared' failed make[3]: * [do_linux-shared] Error 2 make[3]: Leaving directory '/home/e/Downloads/openssl-1.0.2a' Makefile:302: recipe for target 'libcrypto.so.1.0.0' failed make[2]: * [libcrypto.so.1.0.0] Error 2 make[2]: Leaving directory '/home/e/Downloads/openssl-1.0.2a' Makefile:109: recipe for target 'shared' failed make[1]: * [shared] Error 2 make[1]: Leaving directory '/home/e/Downloads/openssl-1.0.2a/crypto' Makefile:279: recipe for target 'build_crypto' failed make: *\ [build_crypto] Error 1
can u pleas tel me what to do ?
For compiling openssl, I haven't tried it myself. Therefore you should maybe ask the openssl community.
For now, tr064tool always performs a device discovery, or you need to provide a json file -i|--import
; which you can create with tr064export
.
Adding a parameter to specify a device (ip-addr/hostname) which should be used, is not a bad idea.
ok after days of trail and error i complied the project ignoring the gtest just like u did for konw i cant use the project i ues the tr064tool & tr064export commands from within the made folder but the commands arent recognized what is the right way of executing the program and communicating wih a device that has an ip 192.168.1.1 and a port 1900 open and i only know the tr064 pwd with no login tnx
[root@localhost tr064]# '/root/Downloads/tr064/x/src/tr064tool' Perform RootDevice discovey. ^C [root@localhost tr064]# '/root/Downloads/tr064/x/src/tr064tool' Perform RootDevice discovey. ^C
the tool wont discover the router i use vm with bridged connection the vm have no nat it gets a dhcp ip from the router 192.168.1.x and i know the path of the xml file in the router but i want to invoke the actions with the tool what to do
tnx alooot for ur replies
I just pushed the implementation for providing a location option to tr064tool
, see bfd703e584b81f5965f1efc4b44e47655a008f02 I hope it works :smile:
use it like:
tr064tool -L http://192.168.1.1:49000/tr64desc.xml
Note that you need to have this url format!
I gonna close this issue. If you need more feature, please open a separate issue!
hi i am totally new to this but i really need to use the app to test some tr064 routers
so i hardly got the Dependencies and had them red right by the cmake
after that i got this error and i dont know how to fix it
[ 23%] Building CXX object lib/CMakeFiles/tr064.dir/soap/Session.cc.o In file included from /home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc:1:0: /home/ehab/Desktop/tr064/include/tr064/ResourceRetrieval.hh:60:15: error: field ‘_host’ has incomplete type /home/ehab/Desktop/tr064/include/tr064/ResourceRetrieval.hh:61:15: error: field ‘_port’ has incomplete type /home/ehab/Desktop/tr064/include/tr064/ResourceRetrieval.hh:52:51: error: default argument for parameter of type ‘const string& {aka const std::basic_string&}’ has type ‘const char [5]’
In file included from /home/ehab/Desktop/tr064/include/tr064/CpeElementBuilder.hh:5:0,
from /home/ehab/Desktop/tr064/lib/CpeElementBuilder.cc:2:
/home/ehab/Desktop/tr064/include/tr064/ResourceRetrieval.hh:60:15: error: field ‘_host’ has incomplete type
/home/ehab/Desktop/tr064/include/tr064/ResourceRetrieval.hh:61:15: error: field ‘_port’ has incomplete type
/home/ehab/Desktop/tr064/include/tr064/ResourceRetrieval.hh:52:51: error: default argument for parameter of type ‘const string& {aka const std::basic_string&}’ has type ‘const char [5]’
/home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc: In constructor ‘tr064::ResourceRetreivalHttp::ResourceRetreivalHttp(const string&, const string&)’:
/home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc:24:3: error: class ‘tr064::ResourceRetreivalHttp’ does not have any field named ‘_host’
/home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc:25:3: error: class ‘tr064::ResourceRetreivalHttp’ does not have any field named ‘_port’
/home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc: In member function ‘virtual tr064::ResourceStream tr064::ResourceRetreivalHttp::get(const string&) const’:
/home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc:33:8: error: ‘_host’ was not declared in this scope
/home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc:39:16: error: ‘_host’ was not declared in this scope
/home/ehab/Desktop/tr064/lib/ResourceRetrieval.cc:39:32: error: ‘_port’ was not declared in this scope
make[2]: * [lib/CMakeFiles/tr064.dir/ResourceRetrieval.cc.o] Error 1
make[2]: * Waiting for unfinished jobs....
make[2]: * [lib/CMakeFiles/tr064.dir/CpeElementBuilder.cc.o] Error 1
make[1]: * [lib/CMakeFiles/tr064.dir/all] Error 2
make: *\ [all] Error 2
so please can u tell me what to do with it ? shoud i edit it and put my host and port data ?|
tnx n advance
after lost of searching it turnd out to be an old gcc installiation proplem now i updateted it and face issues with openssl and tried to solve them but still no use