Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tvonderhaar opened this issue Nov 10, 2017 · 5 comments
Open

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

tvonderhaar opened this issue Nov 10, 2017 · 5 comments

Comments

@tvonderhaar
Copy link

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
Copy link

vinifr commented Nov 15, 2017

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/onvif_output/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
Copy link

vinifr commented Nov 15, 2017

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
Copy link
Author

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
Copy link

vinifr commented Nov 21, 2017

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

@tvonderhaar
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants