linkingvision / rapidonvif

ONVIF C++ lib, support ProfileS
https://linkingvision.com/
GNU General Public License v3.0
259 stars 178 forks source link

Example runs,but reports it can't find the agent. #10

Open tvonderhaar opened 7 years ago

tvonderhaar commented 7 years ago

Upon running the example program "../output/raspberry-pi2-32bit/bin/onvifagentcli" on a raspberry PI I2 I get the repeated error message: sh: 1: onvifagent: not found include/onvifagentlib.hpp 109 onvif Agent process exit !!! I had some problems getting it to make, but after installing automake tools(not mentioned in the readme) it seemed to finish make after compiling the example program. There were a ton of warnings, mostly about shadowed classes. I also found that "onvifagent.o" was never made. I found no make recipe for it for Linux although there were instructions on how to build it for windows.

An example of how compile ones own program would be nice. A complete g++ command line or a make file which compiles just the files in the current directory. There seems to be a lot of search paths required.

All I need to do is goto a camera's PTZ preset. Can you give an example?

Thanks, Tom

vinifr commented 6 years ago

I have this same issue. The problem is because the onvifagent or libonvifagentcli.a were not compiled. That is problem in compilation: _g++ -o onvifagent -DLINUX -Os -fPIC -DUSE_WEBSOCKET -DWITH_OPENSSL -DWITH_DOM -DWITH_PURE_VIRTUAL -DWITH_NONAMESPACES src/webserver.o ./lib/linux//libonvifcpplib.a -L/home/vini/projs/ams_projs/evd/onvifoutput/output/Debian-8.7-64bit/lib -g -L../../3rdparty/openssl-linux/ -lprotobuf -lssl -lcrypto -lpthread -ldl -lstdc++ -lm -Wl,-Bdynamic -lcrypt g++: error: ./lib/linux//libonvifcpplib.a: No such file or directory

vinifr commented 6 years ago

I figured out the problem. We cannot use make -jX because will compile out of order and will fail. We have to compile with make without -j argument.

tvonderhaar commented 6 years ago

Hi, I can't find the -j option in any of the make files. I have found a significant error while compiling soapC.cpp. After a long time of outputting warnings about an obsolete type casting and a hang of Linux for some time the following error is reported:

g++: internal compiler error: Killed (program cc1plus) Please submit a full bug report, with preprocessed source if appropriate. See file:///usr/share/doc/gcc-4.9/README.Bugs for instructions. make[1]: *** [onvifgen/soapC.o] Error 4

I tried again on the latest version of an RPI 3 with a Giga-byte of ram in case this was due to a lack of memory on my RPI 2 (512M), but the same error occurs. This seems like an error unlikely to be fixed soon by the maintainers of g++ for Raspbian. I also tried to compile it using MS visual studio 2017. The libraries used in MS visual studio 2013 are not included with 2017 and many link errors are occuring. MS visual C is such a pain as each new version breaks the last major release. I have Visual C code from visual studio 6 I can't compile without visual studio 6.

If any one has a solution I would appreciate any help. Maybe cross compiling?

Tom

vinifr commented 6 years ago

i have cross compiled successfully using rules-arm.mk: $ source successfully $ make

tvonderhaar commented 6 years ago

Hi everybody,

I had to build my own cross compiler tool chain for g++ version 4.9.2 to get this to properly process symbolic links under a Windows 7 cygwin environment. The cross compiler crashed at this point processing the protobuf package:

libtool: compile: arm-linux-gnueabihf-g++ -std=c++11 -DHAVE_CONFIG_H -I. -I.. -pthread -DHAVE_PTHREAD=1 -DHAVE_ZLIB=1 -Wall -Wno-sign-compare -O2 -g -DNDEBUG -MT google/protobuf/compiler/cpp/cpp_message.lo -MD -MP -MF google/protobuf/compiler/cpp/.deps/cpp_message.Tpo -c google/protobuf/compiler/cpp/cpp_message.cc -fPIC -DPIC -o google/protobuf/compiler/cpp/.libs/cpp_message.o google/protobuf/compiler/cpp/cpp_message.cc: In member function 'void google::protobuf::compiler::cpp::MessageGenerator::GenerateFieldAccessorDefinitions(google::protobuf::io::Printer*, bool)': google/protobuf/compiler/cpp/cpp_message.cc:943:24: internal compiler error: Segmentation fault vars["field_name"] = UnderscoresToCamelCase(field->name(), true); ^ Please submit a full bug report, with preprocessed source if appropriate. See http://gcc.gnu.org/bugs.html for instructions.

The compiler crashes under Raspbian with a PI 3 and now under windows 7 CYGWIN cross with 16GB of memory. What build machine and O.S. did you do your cross compile under? This is really becoming a nightmare. The compilation units are so big and complex GNU compilers seem to be having a real problem compiling this code. If a newer version of the compiler is known to succeeded in compiling this code, then it might be worth building that tool chain, but it took many days to get 4.9.2 working and I not making it my life mission to finding one that succeeds. The process of compiling the cross compiler had several bugs I had to overcome. The number of warning the maintainers allow in their code is unbelievable. Depending on the options one gives to the build you may run into significant bugs in the cross compiler code(like trying to load a static library into a dynamic library "lto" code.) Getting the sysroot for includes and library paths setup properly so the tools find those files by default is buggy. I had to kludge it together with symbolic links.
Can anyone help?

Frustrated, Tom