USERNAME PASSWORD LOST PASSWORD? REGISTER
"A Complete Mobile Application Development Environment"
Advertisement

Downloads
Documentation
Forums
Blog
Press
Bug Tracking
Creator IDs
Contact Us




ACCESS Developer Network
Welcome, Guest
Please Login or Register.
Lost Password?
_GEN_GOTOBOTTOM Post Reply Favoured: 0
TOPIC: Library for sqlite
#555
angel (User)
Senior Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Library for sqlite 2008/07/09 13:15 Karma: 0  
Hi,
i'm trying to build a simple code (sqlite)
i have included sqlite3.h as header file,
in the make
i have alp_appmgr and alp_bundlemgr as libraries
alp and sqlite3 as packages
but when trying to build this i have this error

[b]src/appmain.c:36: error: 'sqlite3_api' undeclared (first use in this function)[/b]

can anyone help me please
thanks
  The administrator has disabled public write access.
#557
frank.flonnoy (Moderator)
Moderator
Posts: 24
graphgraph
User Offline Click here to see the profile of this user
Re:Library for sqlite 2008/07/09 17:47 Karma: 0  
Let me look into this. What version of Linux are you developing under??
  The administrator has disabled public write access.
#562
angel (User)
Senior Boarder
Posts: 18
graphgraph
User Offline Click here to see the profile of this user
Re:Library for sqlite 2008/07/10 08:04 Karma: 0  
hi,
i created an acces c/c++ application projectused template (basic application)
then i set the target (alp-simulator)

this is my appmain.C


/*!
* @file appmain.c
*
* @brief Basic Application with just the entrypoint defined.
*/

#include <stdio.h>
#include <sqlite3.h>
#include <sqlite3ext.h>

#ifdef __cplusplus
extern "C"
#endif

static int callback(void *NotUsed, int argc, char **argv, char **azColName){
int i;
for(i=0; i<argc; i++){
printf("%s = %sn", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("n");
return 0;
}

int alp_main(int argc, char *argv[])
{
sqlite3 *db;
char *zErrMsg = 0;
int rc;

if( argc!=3 )
{
fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENTn", argv[0]);
exit(1);
}

rc = sqlite3_open("base", &db);

if( rc ){
fprintf(stderr, "Can't open database: %sn", sqlite3_errmsg(db));
sqlite3_close(db);
exit(1);
}
rc = sqlite3_exec(db, argv[2], callback, 0, &zErrMsg);
if( rc!=SQLITE_OK )
{
fprintf(stderr, "SQL error: %sn", zErrMsg);
sqlite3_free(zErrMsg);
}
sqlite3_close(db);
printf("BasicAppn");
return 0;
}



and this is my makefile


include make/defs.mk

SOURCES = appmain.c
RESOURCES = appicon.png
DEFINES =
INCLUDES =
LIBRARIES = alp_appmgr alp_bundlemgr alp_ui
PACKAGES = alp sqlite3

include make/rules.mk
  The administrator has disabled public write access.
_GEN_GOTOTOP Post Reply
Powered by FireBoardget the latest posts directly to your desktop


© 2008 ACCESS Developer Network    |    Joomla! is Free Software released under the GNU/GPL License.    |    ACCESS Global Website
Events Support Community Platforms Home