[rrd-users] cross-compiling: cannot find -lrrd

Sergey Kopylov copa at yandex.ru
Sun Feb 8 15:30:06 CET 2015


Hello!
I am trying to cross-compile my test program for the OpenWRT
attitude-adjustment 12.09 (router D-Link DIR-320 hw.B1). But at the end of
compiling I have an error: 
"/home/sergey/openwrt/attitude_adjustment/staging_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mipsel-openwrt-linux-uclibc/4.6.3/../../../../mipsel-openwrt-linux-uclibc/bin/ld:
cannot find -lrrd"

What is the reason of this error? I tryied to find the library:
root at debian:/# find /home/sergey/openwrt/attitude_adjustment/ -name
librrd.so*
/home/sergey/openwrt/attitude_adjustment/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ramips/usr/lib/librrd.so.2
/home/sergey/openwrt/attitude_adjustment/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ramips/usr/lib/librrd.so.2.0.15
/home/sergey/openwrt/attitude_adjustment/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/rrdtool-1.2/lib/librrd.so.2
/home/sergey/openwrt/attitude_adjustment/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/rrdtool-1.2/lib/librrd.so
/home/sergey/openwrt/attitude_adjustment/staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/rrdtool-1.2/lib/librrd.so.2.0.15

This library is installed. (For OpenWRT actual version of rrdtool -
1.2.30-3).

My test program: mbrrd.c
#include <string.h>
#include <stdlib.h>

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>

#include "rrd.h" // Положить файл rrd.h рядом с mbrrd.c

#include <unistd.h>    /* UNIX standard function definitions */
#include <fcntl.h>     /* File control definitions */
#include <errno.h>     /* Error number definitions */
#include <termios.h>   /* POSIX terminal control definitions */

int main (int argc,char** argv)
{
  int i=rrd_update(argc,argv);
  return 0;
}

I putted the rrd.h file together with mbrrd.c in a folder /src

My Makefile:
#======================================
# OpenWrt Makefile for mbrrd programm
#======================================

include $(TOPDIR)/rules.mk

PKG_NAME:=mbrrd
PKG_VERSION:=1.0.0
PKG_RELEASE:=1

PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk


define Package/mbrrd
        SECTION:=utils
        CATEGORY:=Utilities
        DEPENDS:=+librrd
#+librrd
        TITLE:=Gatawey-server Modbus RTU to RRD for Arduino
endef

define Package/mbrrd/description
        Gatawey-server Modbus RTU to RRD for Arduino
endef

define Build/Prepare
        mkdir -p $(PKG_BUILD_DIR)
        $(CP) ./src/* $(PKG_BUILD_DIR)/
endef


define Build/Compile
        $(TARGET_CC) $(TARGET_CFLAGS) -c -o $(PKG_BUILD_DIR)/mbrrd.o
$(PKG_BUILD_DIR)/mbrrd.c
        $(TARGET_CC) $(TARGET_LDFLAGS) -lrrd -o $(PKG_BUILD_DIR)/mbrrd
$(PKG_BUILD_DIR)/mbrrd.o
endef

TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/modbus
-I$(STAGING_DIR)/usr/lib -I$(STAGING_DIR)/usr/lib/rrdtool-1.2/lib/

define Package/mbrrd/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/mbrrd $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,mbrrd))


Can you help me, please?



--
View this message in context: http://rrd-mailinglists.937164.n2.nabble.com/cross-compiling-cannot-find-lrrd-tp7582841.html
Sent from the RRDtool Users Mailinglist mailing list archive at Nabble.com.



More information about the rrd-users mailing list