Windows MobileÏ·ÃÎÊSqliteµÄNative C++·â×°
±³¾°
µ±Ç°Òƶ¯É豸¿ª·¢ÁìÓò£¬ÔÚ±¾µØÊý¾Ý´æ´¢·½Ã棬Sqlite¼¸ºõ³ÉÁËÊÂʵ±ê×¼£¬Andriod (android.database.sqlite)£¬iPhone (SQLite for iPhone SDK ºÍ FMDB for iPhone)£¬Palm WebOS (webOS SQL Tutorial)£¬Ð°汾µÄSymbianÒ²Ö±½Óbuilt-in SqliteÁË(20 million Symbian smartphones shipped in Q3 2007 Newer versions of the SymbianOS have SQLite built in.)¡£ÄÇô×÷ΪÒƶ¯É豸ÁìÓòµÄÖØÒªÒ»Ô±Windows MobileÔõô¿ÉÄÜ´í¹ýSqliteÄØ¡£
¼ò½é
Sqlite¼¸ºõ³ÉÁ¢Òƶ¯É豸¿ª·¢ÁìÓòÊý¾Ý´æ´¢·½ÃæµÄÊÂʵ±ê×¼¡£SqliteÒѾ¹ã·º±»Ê¹Óõ½Andriod£¬iPhone£¬WebOSÒÔ¼°SymbianµÈƽ̨ÁË£¬±¾ÎĽ²ÊöÔÚWindows Mobileƽ̨ÏÂÈçºÎʹÓÃNative C++·ÃÎÊSqlite£¬Í¬Ê±½²ÊöÒ»¸ö·â×°ÀàµÄʵÏÖºÍʹÓá£
SqliteÔ´Âë
SqliteÔ´Âë¿ÉÒÔµ½ SQLite Download Page ÏÂÔØ£¬ÎÒΪÁËÊ¡ÊÂÖ±½ÓʹÓÃÁËsqlite.phxsoftware.comµÄÔÚWindows MobileϵÄbuild¹¤³Ì¡£
SqliteµÄC++·â×°
·â×°ÎÒʹÓÃÁËTyushkov NikolayµÄ·â×°CppSQLite3U¡£ÕâÀï¸ÐлegmkangµÄÍƼö¡£CppSQLite3U·â×°ÊǶÔSqliteÔÓд¿CµÄapi½øÐÐOOµÄC++µÄ·â×°¡£Ö÷Òª·â×°ÒÔϼ¸¸öÀࣺ
1. CppSQLite3DB Êý¾Ý¿âÀ࣬ÓÃÓÚн¨Êý¾Ý¿â£¬´ò¿ª¹Ø±ÕÁ´½Ó£¬Ö´ÐÐDDLºÍDML¡£
2. CppSQLite3Statement ÓÃÓÚÖ´ÐвÎÊý»¯µÄSQL¡£CppSQLite3DB ¿ÉÒÔÖ´ÐÐSQLµ«ÊDz»Ö§³Ö²ÎÊý»¯¡£
3. CppSQLite3Query ÓÃÓÚ¶Á³öÖ´ÐÐSelectºóµÄ²éѯ½á¹û¡£
4. CppSQLite3Exception ÓÃÓÚ²¶×½Òì³£¡£
¼òµ¥Ã÷Á˵ķâ×°ÁËSqlite¡£
·â×°ÀàµÄʹÓÃ
ʹÓ÷½·¨Ô´×ÔÓÚÎÒ¶ÔCppSQLite3UÀàµÄµ¥Ôª²âÊÔ¡£¼ûÔ´ÎļþµÄSqliteHelperTest.h¡£
´´½¨Êý¾Ý¿âÎļþ
TEST(SqliteHelper, CreateDatabase){ try { CppSQLite3DB db; DeleteFile(DB_FILE_NAME); db.open(DB_FILE_NAME); db.close(); } catch(CppSQLite3Exception e) { FAIL(ToString(e.errorMessage()).c_str()); } TRACE("Create database successful.");}µ÷ÓÃCppSQLite3DB µÄopen()º¯ÊýµÄʱºòÈç¹û·¢ÏÖûÓÐÊý¾Ý¿âÎļþ¾Í»áн¨Ò»¸öÊý¾Ý¿âÎļþ¡£SqliteµÄÔ´´úÂëÈçÏÂ(¼ûsqlite3.c)£º
rc = ope
Ïà¹ØÎĵµ£º
±¾ÎÄÊÇд¸ø gcc ÐÂÊÖµÄÈëÃÅÎÄÕ£¬ËùÒÔÄÚÈݱȽϼòµ¥¡£Èç¹ûÄãÖªµÀÏÂÃæ3ÌõÃüÁ¿ÉÒÔ±àÒëc++µÄ»°£¬¾Í²»ÓÃÔÚ±¾ÎÄÀË·Ñʱ¼äÁË
´úÂë:
g++ -Wall hellocpp.cpp
gcc -Wall hellocpp.cpp -lstdc++
gfortran -Wall hellocpp.cpp -lstdc++
×¢£º±¾ÎÄ×îаæÔÚwikiÖÐ http://wiki.ubuntu.org.cn/Gcchowto
£¨½¨Òé´ó¼ÒÖ±½Ó·ÃÎÊwikiÖ ......
µÚÒ»Ì⣺
ÏÂÃæ³ÌÐòµÄÊä³ö½á¹û£¿
#include <stdio.h>
#include <iostream>
void main()
{
char str1[] = "";
char str2[] = "";
const char str3[] = "abc";
const char str4[] = "abc";
const char* str5 = "abc";
const char* str6 = "a ......
Ç°ÑÔ£ºÇ°¶Îʱ¼äÔÚCSDNµÄC++ÉçÇøÓöµ½Ò»¸öÐèÒª·â×°¿¼ÇÚ»ú½Ó¿ÚµÄ¶¯Ì¬¿â¸øJAVAµ÷ÓõÄÌû×Ó£¬¹´ÆðÁËÎÒ¶ÔJAVAµÄÎÞÏÞ»³Äî¡£ÔÚ´Ë£¬ÎÒÏë°ÑÕâÏî¼¼Êõ¼òµ¥ÔÙ½éÉÜһϡ£
Ò»¡¢¹ØÓÚJava Native Interface (JNI)
JNIÊÇJAVA±¾µØ±à³Ì½Ó¿Ú£¬ÊôÓÚJDKµÄÒ»²¿·Ö¡£ËüÔÊÐíJAVAÄܹ»²Ù×÷±¾µØAPI»òÓÉÆäËûÓïÑÔ±àдµÄ¶¯Ì¬¿â¡£²»¹ýµ±ÄãʹÓÃÕâÏî¼¼ÊõµÄʱºò£ ......
1¡¢ һЩͷÎļþµÄ×÷Óãº
<assert.h>£ºANSI C¡£Ìṩ¶ÏÑÔ£¬assert(±í´ïʽ)
<glib.h>£ºGCC¡£GTK£¬GNOMEµÄ»ù´¡¿â£¬ÌṩºÜ¶àÓÐÓõĺ¯Êý£¬ÈçÓÐÊý¾Ý½á¹¹²Ù×÷º¯Êý¡£Ê¹ÓÃglibÖ»ÐèÒª°üº¬<glib.h>
<dirent.h>£ºGCC¡£Îļþ¼Ð²Ù×÷º¯Êý¡£struct dirent,struct DIR,opendir(),closedir(),readdir(),readdi ......
ΪÁËÓÃvcдһ¸ö×î¼òµ¥µÄ socket ³ÌÐò£¬»¨·ÑÁËÒ»¸öÏÂÎçµÄʱ¼ä£¬¹ý³ÌÖгöÏֵĴíÎóÓУº
'SOCKET' : illegal use of this type as an expression
syntax error : missing ';' before 'type'
syntax error : identifier 'InitWinsock' --> bool InitWinsock( ......