關於嵌入式mysql開發資料很少,有幾篇帖子只說自己編譯通過了,卻不說說關鍵的步驟。
還是mysql的工程師厚道,給出了嵌入式mysql開發的ptt( - 根據ppt上詳細的介紹,你還會找到鏈結這是作者寫的乙個win32 dialog 嵌入式mysql 的demo,相當的給力。
準備bd.cmd 和 errmsg.sys,errmsg.sys在mysql的安裝目錄中去找,我找的是mysql安裝目錄中的:share\english\errmsg.sys,然後把這個檔案errmsg.sys放入demo資料夾中的language子資料夾,把bd.cmd放入demo資料夾中。
bd.cmd檔案內容如下:
@echo off
echo + batch script for windows sdk(c version).
echo + usage : type "bd" or "bd ndebug" or "bd clean".
echo + "bd" : build debug version.
echo + "bd ndebug": build release version.
echo + "bd clean" : delete result files.
if "%1" equ "clean" goto clean
if "%1" neq "" (if "%1" equ "ndebug" (echo + & echo + build release version. & echo + & goto release) else (echo + & echo + invalidate parameter. & echo + & goto end)) else (echo + & echo + build debug version. & echo + & goto debug)
:clean
echo + & echo + delete result files. & echo + & del *.obj & del *.exe & del *.res & del *.exp & del *.lib & del *.dll
goto end
:release
rc libmysqld_demo.rc
cl /c /md /d%1 /i%qssdk%\include\mysql *.c
link /libpath:%qssdk%\lib\x86 libmysqld_demo.obj libmysqld_demo.res kernel32.lib gdi32.lib user32.lib libmysqld.lib
goto end
:debug
rc libmysqld_demo.rc
cl /c /mdd /i%qssdk%\include\mysql *.c
link /libpath:%qssdk%\lib\x86 libmysqld_demo.obj libmysqld_demo.res kernel32.lib gdi32.lib user32.lib libmysqld.lib
goto end
:end
if exist libmysqld_demo.dll.manifest mt -manifest libmysqld_demo.dll.manifest -outputresource:libmysqld_demo.dll;2
if exist libmysqld_demo.exe.manifest mt -manifest libmysqld_demo.exe.manifest -outputresource:libmysqld_demo.exe
del *.manifest
qssdk這個環境變數是我自己建立的,mysql的.h檔案和.lib檔案就放在其中的子資料夾中方便管理,這個你可以直接設定你喜歡的目錄。
編譯:
c:\documents and settings\qs\桌面\libmysqld_demo_1_0>bd ndebug
+ batch script for windows sdk(c version).
+ usage : type "bd" or "bd ndebug" or "bd clean".
+ "bd" : build debug version.
+ "bd ndebug": build release version.
+ "bd clean" : delete result files.
++ build release version.
+microsoft (r) 32-bit c/c++ optimizing compiler version 14.00.50727.762 for 80x86
libmysqld_demo.c
microsoft (r) incremental linker version 8.00.50727.762
microsoft (r) manifest tool version 5.2.3790.2075
c:\documents and settings\qs\桌面\libmysqld_demo_1_0>dir *.exe
驅動器 c 中的卷是 winxp
卷的序列號是 3cf9-95f7
c:\documents and settings\qs\桌面\libmysqld_demo_1_0 的目錄
2011-11-14 10:43 13,824 libmysqld_demo.exe
1 個檔案 13,824 位元組
0 個目錄 21,090,557,952 可用位元組
c:\documents and settings\qs\桌面\libmysqld_demo_1_0>libmysqld_demo.exe
c:\documents and settings\qs\桌面\libmysqld_demo_1_0>
自己編譯的例子傳到了csdn資源,有興趣就download -
mysql 嵌入式c 嵌入式MYSQL伺服器實現
嵌入式mysql伺服器實現 embeddedmysql.h inte ce for the cembeddedmysql class.if defined afx embeddedmysql h 516724e2 889c 4899 9dae 330cd4c5954f included defi 嵌...
嵌入式mysql 什麼意思 嵌入式資料庫介紹
sqlite資料庫是一種嵌入式資料庫,是d.richard hipp開發出來的,它用乙個小型c 庫實現的,是一種強有力的嵌入式關聯式資料庫,它為了追求盡量簡單的目標,放棄了傳統的企業級資料庫的複雜特性,只是實現了資料庫一些必備的基本功能。由此可見,大多數標準的sql92語句都能夠得到sqlite的支...
微型嵌入式系統mysql 微型嵌入式作業系統對比
gpl general public license 即gnu通用公共許可證 1 ucos ii ucos ii 商業和gpl雙許可。c os ii是一種可移植的,可植入rom的,可裁剪的,搶占式的,實時多工作業系統核心。是實現乙個基於優先順序排程的搶占式的實時核心,並在這個核心之上提供最基本的系統...