rpicopter / mw-mavlink

Control you MultiWii with QGroundControl!
5 stars 1 forks source link

Having difficulties for compilling #6

Open goulum29 opened 4 years ago

goulum29 commented 4 years ago

Hi, To begin with, a very interesting project. I wanted to use my mutiwii drone with a joystick on pc. It seems there are some librairies missing : for mw-service make /bin/bash ./libtool --tag=CC --mode=link gcc -Wall -g -O2 -o mw mw-mw.o mw-routines.o mw-uart.o mw-gpio.o -lmw_core -lrt -lpthread libtool: link: gcc -Wall -g -O2 -o mw mw-mw.o mw-routines.o mw-uart.o mw-gpio.o -lmw_core -lrt -lpthread /usr/bin/ld: cannot find -lmw_core collect2: error: ld returned 1 exit status make: *** [Makefile:535: mw] Error 1

and for mw-mavlink gcc -Wall -g -O2 -o mw-mavlink mw_mavlink-main.o mw_mavlink-udp.o mw_mavlink-mw.o mw_mavlink-mavlink.o mw_mavlink-params.o mw_mavlink-gamepad.o -lmw_core -lrt -lpthread -lssl -lcrypto -lresolv -lm -lconfig /usr/bin/ld: cannot find -lmw_core collect2: error: ld returned 1 exit status make: *** [Makefile:375: mw-mavlink] Error 1 I can't find wich lib is it... Maybe it will appears evident for you

Best regards

gregd72002 commented 4 years ago

mw_core is part of mw-service; to compile mw-service:

git clone https://github.com/rpicopter/mw-service & cd mw-service libtoolize ./autogen.sh make make install

goulum29 commented 4 years ago

I did excatly these command. I redo it and post the result here, I have the same error.

pi@raspberrypi:~/test/mw-service $ libtoolize libtoolize: putting auxiliary files in '.'. libtoolize: linking file './ltmain.sh' libtoolize: You should add the contents of the following files to 'aclocal.m4': libtoolize: '/usr/share/aclocal/libtool.m4' libtoolize: '/usr/share/aclocal/ltoptions.m4' libtoolize: '/usr/share/aclocal/ltsugar.m4' libtoolize: '/usr/share/aclocal/ltversion.m4' libtoolize: '/usr/share/aclocal/lt~obsolete.m4' libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

then

pi@raspberrypi:~/test/mw-service $ ./autogen.sh aclocal: installing 'm4/libtool.m4' from '/usr/share/aclocal/libtool.m4' aclocal: installing 'm4/ltoptions.m4' from '/usr/share/aclocal/ltoptions.m4' aclocal: installing 'm4/ltsugar.m4' from '/usr/share/aclocal/ltsugar.m4' aclocal: installing 'm4/ltversion.m4' from '/usr/share/aclocal/ltversion.m4' aclocal: installing 'm4/lt~obsolete.m4' from '/usr/share/aclocal/lt~obsolete.m4' configure.ac:4: installing './compile' configure.ac:4: installing './config.guess' configure.ac:4: installing './config.sub' configure.ac:2: installing './install-sh' configure.ac:2: installing './missing' Makefile.am: installing './depcomp' checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking build system type... armv7l-unknown-linux-gnueabihf checking host system type... armv7l-unknown-linux-gnueabihf checking how to print strings... printf checking whether make supports the include directive... yes (GNU style) checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking whether gcc understands -c and -o together... yes checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking how to convert armv7l-unknown-linux-gnueabihf file names to armv7l-unknown-linux-gnueabihf format... func_convert_file_noop checking how to convert armv7l-unknown-linux-gnueabihf file names to toolchain format... func_convert_file_noop checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking for sysroot... no checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for mt... mt checking if mt is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gcc... (cached) gcc checking whether we are using the GNU C compiler... (cached) yes checking whether gcc accepts -g... (cached) yes checking for gcc option to accept ISO C89... (cached) none needed checking whether gcc understands -c and -o together... (cached) yes checking dependency style of gcc... (cached) gcc3 checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: executing depfiles commands config.status: executing libtool commands for finish

pi@raspberrypi:~/test/mw-service $ make gcc -DPACKAGE_NAME=\"mw\" -DPACKAGE_TARNAME=\"mw\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"mw\ 0.0.1\" -DPACKAGE_BUGREPORT=\"gregory.dymarek@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mw\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -Wall -g -O2 -MT mw-mw.o -MD -MP -MF .deps/mw-mw.Tpo -c -o mw-mw.otest -f 'mw.c' || echo './'mw.c mw.c: In function ‘set_defaults’: mw.c:54:26: warning: implicit declaration of function ‘atoi’ [-Wimplicit-function-declaration] case 'v': verbosity = atoi(optarg); break; ^~~~ mw.c: In function ‘main’: mw.c:274:12: warning: suggest parentheses around assignment used as truth value [-Wparentheses] while (ret=msg_parse(&msg,bufin+bufin_start,bufin_end-bufin_start)) { //retrieve msg from buffer ^~~ mv -f .deps/mw-mw.Tpo .deps/mw-mw.Po gcc -DPACKAGE_NAME=\"mw\" -DPACKAGE_TARNAME=\"mw\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"mw\ 0.0.1\" -DPACKAGE_BUGREPORT=\"gregory.dymarek@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mw\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -Wall -g -O2 -MT mw-routines.o -MD -MP -MF .deps/mw-routines.Tpo -c -o mw-routines.otest -f 'routines.c' || echo './'routines.c mv -f .deps/mw-routines.Tpo .deps/mw-routines.Po gcc -DPACKAGE_NAME=\"mw\" -DPACKAGE_TARNAME=\"mw\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"mw\ 0.0.1\" -DPACKAGE_BUGREPORT=\"gregory.dymarek@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mw\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -Wall -g -O2 -MT mw-uart.o -MD -MP -MF .deps/mw-uart.Tpo -c -o mw-uart.otest -f 'uart.c' || echo './'uart.c mv -f .deps/mw-uart.Tpo .deps/mw-uart.Po gcc -DPACKAGE_NAME=\"mw\" -DPACKAGE_TARNAME=\"mw\" -DPACKAGE_VERSION=\"0.0.1\" -DPACKAGE_STRING=\"mw\ 0.0.1\" -DPACKAGE_BUGREPORT=\"gregory.dymarek@gmail.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"mw\" -DVERSION=\"0.0.1\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -Wall -g -O2 -MT mw-gpio.o -MD -MP -MF .deps/mw-gpio.Tpo -c -o mw-gpio.otest -f 'gpio.c' || echo './'gpio.c mv -f .deps/mw-gpio.Tpo .deps/mw-gpio.Po /bin/bash ./libtool --tag=CC --mode=link gcc -Wall -g -O2 -o mw mw-mw.o mw-routines.o mw-uart.o mw-gpio.o -lmw_core -lrt -lpthread libtool: link: gcc -Wall -g -O2 -o mw mw-mw.o mw-routines.o mw-uart.o mw-gpio.o -lmw_core -lrt -lpthread **/usr/bin/ld: cannot find -lmw_core** collect2: error: ld returned 1 exit status make: *** [Makefile:535: mw] Error 1

I don't understand why there is this error if it's part if the project itself.

gregd72002 commented 4 years ago

I cannot reproduce it. It works on my RPi as well as my PC every single time.

Looking at the log, it tries to compile and link sources that should be done at the end. mw_core should be compiled as first thing in the process but for some reason in your setup it does not.

gregd72002 commented 4 years ago

You can always force compile the library using:

make libmw_core.la

followed by:

make

goulum29 commented 4 years ago

I seem's to be working, i don't have any error when launching. I wil try this with mission planner. Thanks for the support