Hello
I have an application that works fine in Ubuntu and I know it has been compiled for cris os on foxboard before. Now i have made some changes and have added Sqlite to this application. It compiles fine in eclipse with dynamic linking to sqlite. Sqlite do compile fine in openwrt when i dont compile it at the same time as my app. But when i try to compile my app with openwrt to the foxboard it gives me errors like:
Logger.cpp:12:21: error: sqlite3.h: No such file or directory
Logger.cpp: In member function 'void Logger::runLogger()':
Logger.cpp:131: error: 'SQLITE_OPEN_READWRITE' was not declared in this scope
and
/home/lars/WRT/kamikaze/staging_dir/toolchain-cris_gcc-4.3.3_uClibc-0.9.30.1/usr/lib/gcc/cris-openwrt-linux-uclibc/4.3.3/../../../../cris-openwrt-linux-uclibc/include/c++/4.3.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated.
Settings.cpp:17:21: error: sqlite3.h: No such file or directory
Settings.cpp: In member function 'void Settings::readConfigFile()':
Settings.cpp:91: warning: cannot pass objects of non-POD type 'struct std::string' through '...'; call will abort at runtime
Settings.cpp: In member function 'void Settings::readSettingsTable()':
Settings.cpp:214: error: 'SQLITE_OPEN_READONLY' was not declared in this scope
Settings.cpp:214: error: 'sqlite3_open_v2' was not declared in this scope
The makefile i am using for my app looks like:
include $(TOPDIR)/rules.mk
# Name and release number of this package
PKG_NAME:=DAIM
PKG_VERSION:=1
PKG_RELEASE:=1
# This specifies the directory where we're going to build the program.
# The root build directory, $(BUILD_DIR), is by default the build_mipsel
# directory in your OpenWrt SDK directory
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
PKG_BUILD_DEPENDS:=sqlite3
# Specify package information for this program.
# The variables defined here should be self explanatory.
define Package/DAIM
SECTION:=utils
CATEGORY:=Utilities
TITLE:=DAIM
DEPENDS:=+sqlite3
endef
define Package/DAIM/description
DAIM is a Data Aquisition I.. Module
endef
# Specify what needs to be done to prepare for building the package.
# In our case, we need to copy the source files to the build directory.
# This is NOT the default. The default uses the PKG_SOURCE_URL and the
# PKG_SOURCE which is not defined here to download the source from the web.
# In order to just build a simple program that we have just written, it is
# much easier to do it this way.
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
# Specify where and how to install the program. Since we only have one file,
# the DAIM executable, install it by copying it to the /bin directory on
# the router. The $(1) variable represents the root directory on the router running
# OpenWrt. The $(INSTALL_DIR) variable contains a command to prepare the install
# directory if it does not already exist. Likewise $(INSTALL_BIN) contains the
# command to copy the binary file from its current location (in our case the build
# directory) to the install directory.
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(TARGET_CFLAGS)"
endef
define Package/DAIM/install
$(INSTALL_DIR) $(1)/usr/local/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/DAIM $(1)/usr/local/bin/
$(INSTALL_DIR) $(1)/etc/DAIM
$(INSTALL_DATA) ./conf.dist/config.xml.dist $(1)/etc/DAIM/
$(INSTALL_DIR) $(1)/etc/config/DAIM
$(INSTALL_DATA) ./conf.dist/data.xml.dist $(1)/etc/DAIM/
$(INSTALL_DIR) $(1)/var/run/DAIM
endef
# This line executes the necessary commands to compile our program.
# The above define directives specify all the information needed, but this
# line calls BuildPackage which in turn actually uses this information to
# build a package.
$(eval $(call BuildPackage,DAIM))
the makefile used to sqlite:
#
# Copyright (C) 2006-2009 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=sqlite
PKG_VERSION:=3.6.22
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-amalgamation-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.sqlite.org/
PKG_BUILD_DEPENDS:=libncurses libreadline
include $(INCLUDE_DIR)/package.mk
define Package/sqlite3/Default
SUBMENU:=database
TITLE:=SQLite (v3.x) database engine
URL:=http://www.sqlite.org/
endef
define Package/sqlite3/Default/description
SQLite is a small C library that implements a self-contained, embeddable,
zero-configuration SQL database engine.
endef
define Package/libsqlite3
$(call Package/sqlite3/Default)
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libpthread
TITLE+= (library)
endef
define Package/libsqlite3/description
$(call Package/sqlite3/Default/description)
This package contains the SQLite (v3.x) shared library, used by other
programs.
endef
define Package/sqlite3-cli
$(call Package/sqlite3/Default)
SECTION:=utils
CATEGORY:=Utilities
DEPENDS:=+libsqlite3 +libncurses +libreadline
TITLE+= (cli)
endef
define Package/sqlite3-cli/description
$(call Package/sqlite3/Default/description)
This package contains a terminal-based front-end to the SQLite (v3.x) library
that can evaluate queries interactively and display the results in multiple
formats.
endef
TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
CONFIGURE_VARS += \
config_BUILD_CC="$(HOSTCC)" \
config_BUILD_CFLAGS="-O2" \
config_TARGET_CC="$(TARGET_CC)" \
config_TARGET_CFLAGS="$(TARGET_CFLAGS)" \
config_TARGET_READLINE_INC="$(TARGET_CPPFLAGS)" \
config_TARGET_READLINE_LIBS="$(TARGET_LDFLAGS) -lreadline -lncurses" \
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
DESTDIR="$(PKG_INSTALL_DIR)" \
all install
endef
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/sqlite3.h $(1)/usr/include/
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.{a,so*} $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/sqlite3.pc $(1)/usr/lib/pkgconfig/
endef
define Package/libsqlite3/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsqlite3.so.* $(1)/usr/lib/
endef
define Package/sqlite3-cli/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/sqlite3 $(1)/usr/bin/
endef
$(eval $(call BuildPackage,libsqlite3))
$(eval $(call BuildPackage,sqlite3-cli))
I am very greatfull for any tips.