Reputation: 11
(Please do not scold me, this is my first question here.)
I'm using Yocto 2.3.1 under Ubuntu. I create image for Raspebrry Pi 3 without any problem. I install Eclipse and yocto-plugin for Eclipse. I create HelloWorld Autotools project and debug it on target hardware - no problems. But, when I try to add some library, besides standart stdlib.h and stdio.h, I get "undefined reference to 'name'" Where I can add a library to Eclipse with Yocto Plugin? I can't find this place!
Source: %)
#include <stdlib.h>
#include <stdio.h>
#include <dbm.h>
int main(void){
char fn = "someFile";
dbminit(&fn);
return 0;
}
Toolchain Root Location: /opt/poky/2.3.1/
Sysroot Location: /opt/poky/2.3.1/sysroots/cortexa7hf-neon-vfpv4-poky-linux-gnueabi
(I'm using SDK for my image)
Thanks in advance.
UPD:
Upvotes: 1
Views: 1066
Reputation: 1
I have faced this issue before and I solved it by adding needed libraries in Makefile.am file (in the same directory of the source code) to AM_LDFLAGS = ...
here is an example of how the Makefile.am file looks like after adding two OpenCV libraries:
bin_PROGRAMS = nxp
nxp_SOURCES = nxp.cpp
AM_CXXFLAGS = @nxp_CFLAGS@
AM_LDFLAGS = @nxp_LIBS@ -lopencv_core -lopencv_imgproc
CLEANFILES = *~
save changes, then right click on the project and choose Reconfigure Project before building.
Upvotes: 0