Open sidharthasajeev2000 opened 11 months ago
Hi, It should. Best Regards Michel
Hi,I tried to compile with my cross-compiler like I did for v4l2rtspserver . But I think it only compiles the v4l2rtspserver part in the onvif folder not the other files and gave me this.
/usr/bin/ld: liblibv4l2rtspserver.a(BasicTaskScheduler.cpp.o): Relocations in generic ELF (EM: 243) /usr/bin/ld: liblibv4l2rtspserver.a(BasicTaskScheduler.cpp.o): Relocations in generic ELF (EM: 243) /usr/bin/ld: liblibv4l2rtspserver.a(BasicTaskScheduler.cpp.o): Relocations in generic ELF (EM: 243) /usr/bin/ld: liblibv4l2rtspserver.a(BasicTaskScheduler.cpp.o): Relocations in generic ELF (EM: 243) /usr/bin/ld: liblibv4l2rtspserver.a(BasicTaskScheduler.cpp.o): Relocations in generic ELF (EM: 243) /usr/bin/ld: liblibv4l2rtspserver.a(BasicTaskScheduler.cpp.o): Relocations in generic ELF (EM: 243) /usr/bin/ld: liblibv4l2rtspserver.a: error adding symbols: file in wrong format collect2: error: ld returned 1 exit status make: *** [Makefile:76: onvif-server.exe] Error 1
Do you know,what should i do?
It is possible, I have done it. From your error message, it looks like your libv4l2rtspserver was built for the host architecture instead of risc-v. The cross compiling flags are not relayed to some of the dependencies, including v4l2rtspserver. You have to look at the Makefiles and use the commands of the targets manually to build it. These were the commands I used to build liblibrtspserver.a:
git submodule update --recursive --init v4l2rtspserver
cd v4l2rtspserver && cmake -DALSA=OFF -DCMAKE_CXX_FLAGS=-I[openssl/ssl.h folder] -DCMAKE_CXX_COMPILER=your-riscv-c++-cross-compiler -DCMAKE_C_COMPILER=your-riscv-c-cross-compiler
make libv4l2rtspserver
riscv64-eyenix-linux-gnu-c++ -std=c++11 -g2 -I inc -I ws-discovery/gsoap/ -I gen -I /usr/include -I /usr/share/gsoap/plugin -DWITH_DOM -DWITH_OPENSSL -DSOAP_PURE_VIRTUAL -fpermissive -pthread -DVERSION=\"a59b554-dirty\" -I v4l2rtspserver/live/groupsock/include -I v4l2rtspserver/live/liveMedia/include -I v4l2rtspserver/live/UsageEnvironment/include -I v4l2rtspserver/live/BasicUsageEnvironment/include -I v4l2rtspserver/inc -I v4l2rtspserver/libv4l2cpp/inc -c -o src/onvif-server.o src/onvif-server.cpp
In file included from /usr/include/ctype.h:39,
from /opt/riscv/eyenix/riscv64-eyenix-linux-gnu/include/c++/10.1.0/cctype:42,
from /opt/riscv/eyenix/riscv64-eyenix-linux-gnu/include/c++/10.1.0/bits/localefwd.h:42,
from /opt/riscv/eyenix/riscv64-eyenix-linux-gnu/include/c++/10.1.0/ios:41,
from /opt/riscv/eyenix/riscv64-eyenix-linux-gnu/include/c++/10.1.0/istream:38,
from /opt/riscv/eyenix/riscv64-eyenix-linux-gnu/include/c++/10.1.0/sstream:38,
from src/onvif-server.cpp:20:
/opt/riscv/eyenix/sysroot/usr/include/bits/endian.h:2:3: error: #error "Never use <bits/endian.h> directly; include
what file should I edit to rectify it?
when making the new repository v4l2rtspserver builds in rsicV rest are being build in x86 .This causes linking problem.so we edited the make file a bit a got the above response.
we hardcoded CC and CXX
-DCMAKE_CXX_COMPILER=riscv64-eyenix-linux-gnu-c++ -DCMAKE_C_COMPILER=riscv64-eyenix-linux-gnu-gcc
and made changes here also
CXX:=riscv64-eyenix-linux-gnu-c++
Hi,
Did you try ?
make CC=riscv64-eyenix-linux-gnu-gcc CXX=riscv64-eyenix-linux-gnu-g++
Best Regards, Michel.
it provided me with this error PREFIX=/usr SYSROOT=/opt/riscv/eyenix/bin/../sysroot DESTDIR=/usr/bin VERSION=a59b554 mkdir -p gen /opt/riscv/eyenix/bin/../sysroot/usr/bin/wsdl2h -d -Ntev -W -L -o gen/onvif.h wsdl/b-2.xsd wsdl/bf-2.xsd wsdl/bw-2.wsdl wsdl/common.xsd wsdl/deviceio.wsdl wsdl/devicemgmt.wsdl wsdl/display.wsdl wsdl/event.wsdl wsdl/imaging.wsdl wsdl/include wsdl/media.wsdl wsdl/onvif.xsd wsdl/ptz.wsdl wsdl/r-2.xsd wsdl/receiver.wsdl wsdl/recording.wsdl wsdl/replay.wsdl wsdl/rw-2.wsdl wsdl/search.wsdl wsdl/t-1.xsd make: /opt/riscv/eyenix/bin/../sysroot/usr/bin/wsdl2h: No such file or directory make: *** [Makefile:44: gen/onvif.h] Error 127
Hi,
You need to specify GSOAP_BIN to get wsdl2h from the host, something like:
make CC=riscv64-eyenix-linux-gnu-gcc CXX=riscv64-eyenix-linux-gnu-g++ GSOAP_BIN=/usr/bin
Best Regards, Michel.
hi While cross-compiling i am encountering problems with gsoap should I try and cross compile it for my project and then do this?
Hi Is it possible to cross-compile the source code for RISC-V Architecture?