If you're getting into compilation of code, definitely check out the GCC man page and docs. Not sure your what GCC version you're using (btw on some libraries it matters), but the following is for v4.9.4. It sounds like you're include paths do not have the correct path for the location of the libftdi headers. Read up the following and check your includes.
GCC Man Page: https://linux.die.net/man/1/gcc GCC Documentation: https://gcc.gnu.org/onlinedocs/gcc-4.9.4/gcc/ On Sat, Oct 1, 2016 at 2:09 AM, mackowiakp <[email protected]> wrote: > Sorry for my ignorance, but I just started with libFTDI. > OK. I download ftdi.h from > http://www.intra2net.com/en/developer/libftdi/download.php and place it in > /opt/include. OpenWTR does not provide libftdi1-dev. Now I try to compile > program again using the same compiler command. That is: > > gcc -v -Wl,-rpath=/opt/usr/local/lib > -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3 -L/opt/lib -O2 -pipe > -march=armv7-a -mtune=cortex-a9 -fno-caller-saves -mfloat-abi=soft -l ftdi1 > d.c -o d > > It fails because "/opt/bin/ld: cannot find -lftdi1". > > But there is /opt/usr/local/lib/libftdi1.so linked to libftdi1.so.2 > > My LD_LIBRARY_PATH looks like this: > /lib:/usr/lib:/usr/local/lib:/opt/lib:/opt/usr/lib:/opt/ > include:/opt/usr/local/lib:/opt/usr/include > > So what the problem is? > > Below output from compilation process: > > Using built-in specs. > COLLECT_GCC=gcc > COLLECT_LTO_WRAPPER=/opt/lib/gcc/arm-openwrt-linux-gnueabi/ > 5.4.0/lto-wrapper > Target: arm-openwrt-linux-gnueabi > Configured with: > /media/ware3/Entware-ng.2016.08/build_dir/target-arm_ > cortex-a9_glibc-2.23_eabi/gcc-5.4.0/configure > --target=arm-openwrt-linux --host=arm-openwrt-linux > --build=x86_64-linux-gnu > --program-prefix= --program-suffix= --prefix=/opt --exec-prefix=/opt > --bindir=/opt/bin --sbindir=/opt/sbin --libexecdir=/opt/lib > --sysconfdir=/opt/etc --datadir=/opt/share --localstatedir=/opt/var > --mandir=/opt/man --infodir=/opt/info --disable-nls > --build=x86_64-linux-gnu > --host=arm-openwrt-linux-gnueabi --target=arm-openwrt-linux-gnueabi > --enable-languages=c,c++ --with-bugurl=https://dev.openwrt.org/ > --with-pkgversion='OpenWrt GCC 5.4.0' --enable-shared --enable-__cxa_atexit > --with-default-libstdcxx-abi=gcc4-compatible --enable-target-optspace > --with-gnu-ld --with-stage1-ldflags='-Wl,-rpath=/opt/lib > -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3' > --with-boot-ldflags='static-libstdc++ -static-libgcc -Wl,-rpath=/opt/lib > -Wl,--dynamic-linker=/opt/lib/ld-linux.so.3' --disable-nls > --disable-libsanitizer --disable-libvtv --disable-libcilkrts > --disable-libmudflap --disable-multilib --disable-libgomp > --disable-libquadmath --disable-libssp --disable-decimal-float > --disable-libstdcxx-pch --with-host-libstdcxx=-lstdc++ --prefix=/opt > --libexecdir=/opt/lib --with-local-prefix=/opt --with-float=soft > --with-default-libstdcxx-abi=gcc4-compatible > Thread model: posix > gcc version 5.4.0 (OpenWrt GCC 5.4.0) > COLLECT_GCC_OPTIONS='-v' '-L/opt/lib' '-O2' '-pipe' '-march=armv7-a' > '-mtune=cortex-a9' '-fno-caller-saves' '-mfloat-abi=soft' '-o' 'd' > '-mtls-dialect=gnu' > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/cc1 -quiet -v -imultilib . > -imultiarch arm-linux-gnueabi d.c -quiet -dumpbase d.c -march=armv7-a > -mtune=cortex-a9 -mfloat-abi=soft -mtls-dialect=gnu -auxbase d -O2 -version > -fno-caller-saves -o - | > as -v -march=armv7-a -mfloat-abi=soft -meabi=5 -o /opt/tmp/ccbT3J1L.o > GNU assembler version 2.26.1 (arm-openwrt-linux-gnueabi) using BFD version > (GNU Binutils) 2.26.1 > GNU C11 (OpenWrt GCC 5.4.0) version 5.4.0 (arm-openwrt-linux-gnueabi) > compiled by GNU C version 5.4.0, GMP version 4.3.2, MPFR version > 2.4.2, MPC version 0.8.1 > GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31954 > ignoring nonexistent directory "/opt/include/arm-linux-gnueabi" > ignoring nonexistent directory > "/opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/../../../. > ./arm-openwrt-linux-gnueabi/include" > ignoring nonexistent directory "/usr/include/arm-linux-gnueabi" > ignoring nonexistent directory "/usr/include" > #include "..." search starts here: > #include <...> search starts here: > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/include > /opt/include > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/include-fixed > End of search list. > GNU C11 (OpenWrt GCC 5.4.0) version 5.4.0 (arm-openwrt-linux-gnueabi) > compiled by GNU C version 5.4.0, GMP version 4.3.2, MPFR version > 2.4.2, MPC version 0.8.1 > GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31954 > Compiler executable checksum: a589712d81e28a1300ccb0e03d994135 > d.c: In function 'main': > d.c:4:18: warning: implicit declaration of function 'Sleep' > [-Wimplicit-function-declaration] > #define sleep(x) Sleep(x) > ^ > d.c:34:5: note: in expansion of macro 'sleep' > sleep(3); > ^ > COMPILER_PATH=/opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4. > 0/:/opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/:/opt/lib/ > gcc/arm-openwrt-linux-gnueabi/:/opt/lib/gcc/arm-openwrt- > linux-gnueabi/5.4.0/:/opt/lib/gcc/arm-openwrt-linux-gnueabi/ > LIBRARY_PATH=/opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/:/ > opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/../../../:/lib/:/usr/lib/ > COLLECT_GCC_OPTIONS='-v' '-L/opt/lib' '-O2' '-pipe' '-march=armv7-a' > '-mtune=cortex-a9' '-fno-caller-saves' '-mfloat-abi=soft' '-o' 'd' > '-mtls-dialect=gnu' > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/collect2 -plugin > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/liblto_plugin.so > -plugin-opt=/opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/lto-wrapper > -plugin-opt=-fresolution=/opt/tmp/cc87OOFR.res > -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s > -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc > -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -dynamic-linker > /lib/ld-linux.so.3 -X -m armelf_linux_eabi -o d > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/crt1.o > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/crti.o > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/crtbegin.o -L/opt/lib > -L/opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0 > -L/opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/../../.. > -rpath=/opt/usr/local/lib --dynamic-linker=/opt/lib/ld-linux.so.3 -lftdi1 > /opt/tmp/ccbT3J1L.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc > --as-needed -lgcc_s --no-as-needed > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/crtend.o > /opt/lib/gcc/arm-openwrt-linux-gnueabi/5.4.0/crtn.o > /opt/bin/ld: cannot find -lftdi1 > collect2: error: ld returned 1 exit status > > > > > -- > View this message in context: http://libftdi.141977.n3. > nabble.com/Can-not-compile-program-on-ARMv7-native- > platform-tp4026111p4026113.html > Sent from the libFTDI mailing list archive at Nabble.com. > > -- > libftdi - see http://www.intra2net.com/en/developer/libftdi for details. > To unsubscribe send a mail to [email protected] > > -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to [email protected]
