compiling and linking is not working ubuntu 17.10/clang - aws-sdk-cpp

I am unable to link and compile the AWS SDK with the following link error:
/usr/bin/ld: CMakeFiles/ns_api.dir/src/main.cpp.o: undefined
reference to symbol '_ZN3Aws4FreeEPv'
/usr/bin/ld: //deps/aws_sdk/aws-cpp-sdk-core/libaws-cpp-sdk-
core.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ns_api.dir/build.make:95: ns_api] Error 1
make[1]: *** [CMakeFiles/Makefile2:68: CMakeFiles/ns_api.dir/all]
Error 2
make: *** [Makefile:84: all] Error 2
Additionally, it seems that I need to specify the build directory with aws-sdk-cpp_DIR even though I did a make install - should this not have placed the lib in the systems lib dir?
I installed the package as follows:
cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_TESTING="FALSE" -DBUILD_ONLY="s3" . && make install -j8
I am under the impression that this issue should not be present given I following the install instructions exactly within an isolated ubuntu environment
Please advise
Thank you very much!

Wanted to follow up here with my own answer:
target_link_libraries( ... aws-cpp-sdk-core aws-cpp-sdk-s3 ... )
was required in my cmake file
adding the core lib for the linker was not required in other installations, so this a ton of caused confusion on my end.

Related

How to install humanoid_navigation ROS kinetic Ubuntu 16.04?

When installing ROS Kinetic packages (Ubuntu 16.04), namely humanoid_navigation, it throws an error when executing catkin_make. Without this package, catkin_make runs without error. Everything was done according to the instructions https://emanual.robotis.com/docs/en/platform/op3/recovery/#op3-manual-installation
[ 97%] Building CXX object humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o
/home/user/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp:23:42: fatal error: pcl/filters/uniform_sampling.h: No such file or directory
compilation terminated.
humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/build.make:62: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o' failed
make[2]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o] Error 1
CMakeFiles/Makefile2:12108: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all' failed
make[1]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 97%] Linking CXX executable /home/user/catkin_ws/devel/lib/footstep_planner/footstep_planner_node
[ 97%] Built target footstep_planner_node
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j2 -l2" failed
After this error, installed pcl from github https://github.com/PointCloudLibrary/pcl in src, ran catkin make, and gave an error
/home/user/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp:23:42: fatal error: pcl/filters/uniform_sampling.h: No such file or directory
compilation terminated.
humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/build.make:62: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o' failed
make[2]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/src/HumanoidLocalization.cpp.o] Error 1
CMakeFiles/Makefile2:12108: recipe for target 'humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all' failed
make[1]: *** [humanoid_navigation/humanoid_localization/CMakeFiles/humanoidlocalization.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Help please!
Did you terminate/interrupt any build recently? This might be due to the fact that the object code was not generated successfully. One way is to clean the build and devel folder's associated content with the package and then build again.
UPDATE!!!
So I replicated your problem and followed my steps to solve them. In my case I had issues with my ros_control package and pcl. Not it works. Cheers!!!
[100%] Linking CXX executable
/home/aadi/catkin_ws/devel/lib/robot_state_publisher/state_publisher
[100%] Built target joint_state_listener
[100%] Built target state_publisher
[100%] Built target robot_state_publisher
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed
The problem is that in PCL 1.7.2, UniformSampling is located in the "keypoints" module, and in 1.8.0, it has been moved to the "filters" module.
Please check your PCL version
Okay, I have a working solution:
nano /home/<user>/catkin_ws/src/humanoid_navigation/humanoid_localization/src/HumanoidLocalization.cpp
And change to following:
//#include <pcl/filters/uniform_sampling.h>
#include <pcl/keypoints/uniform_sampling.h>
Then go and run catkin_make with cd ~/catkin_ws && catkin_make.
It now should work without any errors.
You can try following
cd ~/catkin_ws/src
wget https://github.com/PointCloudLibrary/pcl/archive/refs/tags/pcl-1.8.1.zip
unzip pcl-1.8.1.zip
cd pcl-pcl-1.8.1
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
make -j4
sudo make install -j4
cd ~/catkin_ws && catkin_make
If you have installed another pcl version before go to this library and enter
sudo make uninstall
make uninstall
and then remove this directory.

How do I develop bare-metal i.mx6sx code using eclipse?

I was wondering if you could help me with some issues and questions I have for developing for the i.MX6 SoloX in bare-metal. I was looking at this link https://community.nxp.com/docs/DOC-106253 and downloaded the files there to use as an example of how to develop bare-metal c code for the i.MX6.
Then I setup my eclipse environment according to this tutorial https://community.nxp.com/docs/DOC-103736 but just the toolchain because I'm not interested in processor expert.
Since I'm working on Linux I didn't installed the Code Sourcery thing, instead I'm working with the gcc-arm-none-eabi which I installed using:
$ sudo apt-get install gcc-arm-none-eabi
And therefore I had to change the cs-rm and cs-make for rm and make respectively.
And I was able to create an eclipse project with the downloaded code and configure the project to make it work, nevertheless, I had the first error:
main.c:8:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
make: *** [cortex_A9/main.o] Error 1
cortex_A9/subdir.mk:24: recipe for target 'cortex_A9/main.o' failed
And I was able to solve it adding "/usr/include" in the include directories at project > properties. But I'm not sure if this is a correct way of solving this error.
After fixing this error I got a new one:
syscalls.c:168:1: error: unknown type name 'caddr_t'
caddr_t _sbrk(int incr)
And for solving that I had to include explicitly the file "/usr/include/x86_64-linux-gnu/sys/types.h" and also I don't know if that is the correct way to solve it.
Now having eliminated those two errors I have the following one:
Building target: imx6-A9.elf
Invoking: Cross ARM C Linker
arm-none-eabi-gcc -mcpu=cortex-a9 -march=armv7-a -marm -mlittle-endian -mfloat-abi=softfp -mfpu=neon -mno-unaligned-access -fno-zero-initialized-in-bss -O0 -g -T "/home/mmalagon/iMX6/MX6SX_hello_MFG/cortex_A9/mx6slx.ld" -nostartfiles -Wl,-Map,"imx6-A9.map" -o "imx6-A9.elf" ./cortex_A9/main.o ./cortex_A9/syscalls.o ./cortex_A9/uart.o
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: cannot find -lg
makefile:42: recipe for target 'imx6-A9.elf' failed
/usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make: *** [imx6-A9.elf] Error 1
Which I haven't been able to resolve.
I don't know if this error is a consequence of the way I solved the two previous errors.
Does anybody know how to properly setup eclipse for i.MX6 bare-metal development?
Thank you very much for helping!!
If you want to develop bare-metal code for the i.MX6SoloX without using CodeSourcery then you need to execute this:
sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi -y
And then choose "Custom (arm-none-eabi-gcc)" at Project>Settings>C/C++ Build in the 'Toolchains' tab.

Building Cyanogenmod from source - recipe for target failed (libnativehelper.so)

I'm getting the following error about an hour into my build of Cyanogenmod 12.1 for hlte, using the latest repo checkout. I am using Debian testing, have all dependencies installed as listed in Google's build guide and am using OpenJDK 7. I also have all proprietary files under vendor/samsung. What am I missing or what direction should I look in to solve this problem?
...
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
libnativehelper/JniInvocation.cpp:165: error: unsupported reloc 43
clang: error: linker command failed with exit code 1 (use -v to see invocation)
build/core/host_shared_library_internal.mk:44: recipe for target '/home/james/android/cm/out/host/linux-x86/obj32/lib/libnativehelper.so' failed
make: *** [/home/james/android/cm/out/host/linux-x86/obj32/lib/libnativehelper.so] Error 1

/usr/bin/ld cannot find lib files when compiling openCv matlab source

I am getting the following error when trying to compile openCV with the matlab module.
I just run $make in the realse folder that I created like in the tutorial from opencv.org
[ 98%] Compiling Matlab source files. This could take a while...
CMake Error at /home/alex/Downloads/opencv-master/modules/matlab/compile.cmake:47 (message):
Failed to compile drawChessboardCorners: /usr/bin/ld: cannot find
-lopencv_core
/usr/bin/ld: cannot find -lopencv_imgproc
(Removed alot of lines with lib files here)
collect2: error: ld returned 1 exit status
mex: link of ' "drawChessboardCorners.mexa64"' failed.
How do I fix the link error? Does it have something to do with matlab?
MATLAB 2013a
Ubuntu 13.10
I don't think this is related to MATLAB. The:
/usr/bin/ld: cannot find
points probably to a missing path for the opencv_core library that the linker cannot find during compilation. See: usr/bin/ld: cannot find -l<nameOfTheLibrary>
If you are building manually you could add an -L option, e.g.,
-L<path_to_opencv_core> before the -lopencv_core or -lopencv_imgproc
to the command line build command. If you are using a CMake file, there may be an ${OPENCV_LIB_INSTALL_PATH} (or something similar) that you can set, e.g., using ccmake.

Error while building binutils 2.21.1a on Solaris

I'm trying to build binutils 2.21.1a from http://ftp.gnu.org/gnu/binutils on Solaris sun4u sparc SunOS 5.10. I am using gcc version 4.0.2. When I built this is the error:
cc1: warnings being treated as errors
compress.c: In function 'bfd_compress_section_contents':
compress.c:100: warning: implicit declaration of function 'compressBound'
make[2]: *** [compress.lo] Error 1
make[2]: Leaving directory `/nfs/netapp0/user/home/hart/downloads/binutils-2.21.1/bfd'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/nfs/netapp0/user/home/hart/downloads/binutils-2.21.1/bfd'
*** Error code 2
make: Fatal error: Command failed for target `all'
I added the --disable-werror to the configure line to try to bypass it and hopefully continue the build. Unfortunately this did not work either and I got this new, related, error at link time:
Undefined first referenced
symbol in file
compressBound ../bfd/.libs/libbfd.a(compress.o)
ld: fatal: Symbol referencing errors. No output written to size
collect2: ld returned 1 exit status
I have searched for an existing issue but I have found nothing related. Any ideas? I prefer to use this version of binutils, but if you know of a version that builds OK on this platform with gcc 4.0.2 specifically please let me know.
I finally found the issue was indeed filed as a BUG. The workaround is to add --without-zlib to the configure script or install an up to date version of zlib on the system.