2012年12月27日 星期四

Introducing Qt 5.0 - Digia Plc

Introducing Qt 5.0 - Digia Plc

2012年9月28日 星期五

手動編譯QT於windows 7

此記錄分別說明QT在 Windows 7上編譯的方法,分別以MinGW、VS2008 x86、VS2008 x64 為主題說明。
1.首先下載QT source 4.8.2 因官方被Digia買走於(2012/9/18),網上FTP已不提供4.8.2版Source,但我因已經編譯成功的為4.8.2版,故設另一個下載點供下載。下載地址
2.將壓縮檔內資料夾qt-everywhere-opensource-src-4.8.2解壓縮到自己決定的位置,我的路徑為E:\Project\workspace\ 3.修正WebKit 程式碼無法編譯問題,此問題顯示如下。
DefaultLocalizationStrategy.cpp
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\yvals.h(21) : warning C4005: '_HAS_TR1' : macro redefinition command-line arguments :  see previous definition of '_HAS_TR1' platform\DefaultLocalizationStrategy.cpp(327) : error C2001: newline in constant

platform\DefaultLocalizationStrategy.cpp(327) : fatal error C1057: unexpected end of file in macro expansion
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
2.1 修正檔案為DefaultLocalizationStrategy.cpp第327行
String DefaultLocalizationStrategy::contextMenuItemTagLookUpInDictionary(const String& selectedString)
{
#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
    UNUSED_PARAM(selectedString);
    return WEB_UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
#else
#if USE(CF)
    RetainPtr<cfstringref> selectedCFString(AdoptCF, truncatedStringForLookupMenuItem(selectedString).createCFString());
    return formatLocalizedString(WEB_UI_STRING("Look Up  “%@”", "Look Up context menu item with selected word"), selectedCFString.get());
#else
    return WEB_UI_STRING("Look Up “<selection>”", "Look Up context menu item with selected word").replace("<selection>", truncatedStringForLookupMenuItem(selectedString));
#endif
#endif
}

改成
String DefaultLocalizationStrategy::contextMenuItemTagLookUpInDictionary(const String& selectedString)
{
#if defined(BUILDING_ON_LEOPARD) || defined(BUILDING_ON_SNOW_LEOPARD)
    UNUSED_PARAM(selectedString);
    return WEB_UI_STRING("Look Up in Dictionary", "Look Up in Dictionary context menu item");
#else
#if USE(CF)
    RetainPtr<cfstringref> selectedCFString(AdoptCF, truncatedStringForLookupMenuItem(selectedString).createCFString());
    return formatLocalizedString(WEB_UI_STRING("Look Up “%@”", "Look Up context menu item with selected word"), selectedCFString.get());
#else
    return WEB_UI_STRING("Look Up \"<selection>\"", "Look Up context menu item with selected word").replace("<selection>", truncatedStringForLookupMenuItem(selectedString));
#endif
#endif
}

MinGW 編譯
1.安裝MinGW參考此頁
2.建立qt_4.8.2資料夾到自己決定的位置,我的路徑為E:\Project\workspace\
3.建立MinGW資料夾到qt_4.8.2資料夾中
4.下載MinGW.bat到qt_4.8.2資料夾中
5.在系統內容,環境變數中加入C:\MinGW\bin;E:\Project\workspace\qt-everywhere-opensource-src-4.8.2;
6.開啟命令提示字元
7.輸入e: 執行
8.輸入cd Project\workspace\qt-everywhere-opensource-src-4.8.2 執行
9.輸入..\qt_4.8.2\MinGW.bat
10.輸入o(open source)
11.輸入y(yes),等待Makefile建立完成
12.輸入make
13.輸入make install

VS2008 x86 編譯
1.安裝VS2008,此部份略過
2.建立qt_4.8.2資料夾到自己決定的位置,我的路徑為E:\Project\workspace\
3.建立VS2008_x86資料夾到qt_4.8.2資料夾中
4.下載VS2008_x86.bat到qt_4.8.2資料夾中
5.在系統內容,環境變數中加入C:\MinGW\bin;E:\Project\workspace\qt-everywhere-opensource-src-4.8.2;
6.開啟Visual Studio 2008命令提示字元
7.輸入e: 執行
8.輸入cd Project\workspace\qt-everywhere-opensource-src-4.8.2 執行
9.輸入..\qt_4.8.2\VS2008_x86.bat
10.輸入o(open source)
11.輸入y(yes),等待Makefile建立完成
12.輸入nmake
13.輸入nmake install

VS2008 x64 編譯
1.安裝VS2008,此部份略過
2.建立qt_4.8.2資料夾到自己決定的位置,我的路徑為E:\Project\workspace\
3.建立VS2008_x64資料夾到qt_4.8.2資料夾中
4.下載VS2008_x64.bat到qt_4.8.2資料夾中
5.在系統內容,環境變數中加入C:\MinGW\bin;E:\Project\workspace\qt-everywhere-opensource-src-4.8.2;
6.開啟Visual Studio 2008 x64 Win64命令提示字元
7.輸入e: 執行
8.輸入cd Project\workspace\qt-everywhere-opensource-src-4.8.2 執行
9.輸入..\qt_4.8.2\VS2008_x64.bat
10.輸入o(open source)
11.輸入y(yes),等待Makefile建立完成
12.輸入nmake
13.輸入nmake install

PS:1.以上路徑設定請依喜好修改BAT檔內路徑以及輸出路徑,本日誌主要以架設[多種編譯檔案]為架構撰寫。
2.輸出路徑參數為[-prefix 輸出路徑]
3.如果想加速VS2008編譯在E:\Project\workspace\qt-everywhere-opensource-src-4.8.2\mkspecs\win32-msvc2008\qmake.conf 中的
QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t-
後面加入
QMAKE_CFLAGS            = -nologo -Zm200 -Zc:wchar_t- -MP
以上部份轉載於
1.VC和MinGW编译Qt的方法
2.编译qt-win-opensource-4.8.2-vs2010中出现的一个bug
3.win7系统下64位Qt的编译
4.QT编译./configure参数的详细解释[新手充电必读]
5.使用 Visual C++ 2010 建置 Qt 4.6.3 6.[提问]Qt4.8.1编译安装最后出现问题

2012年7月30日 星期一

在windows 7 下編譯 emacs

1.下載Mingw32
2.下載GnuWin32
3.下載emacs source
4.下載xpm source
5.下載 gnutls
6.安裝Mingw32(請連上網路)
  執行mingw-get-inst-20120426.exe,照以下圖示安裝






















6.安裝GnuWin32(請連上網路)
  執行http://sourceforge.net/projects/getgnuwin32/files/latest/download?source=files,照以下圖示安裝











執行download.bat














執行install.bat












按Enter繼續











按Enter繼續










按Enter繼續











7.設定MinGW 環境變數,加入C:\GetGnuWin32\gnuwin32\bin;C:\MinGW;
 


















8.從C:\GetGnuWin32\packages中搜尋giflib-4.1.4-1-lib.zip、jpeg-6b-4-lib.zip、libpng-1.2.37-lib.zip、tiff-3.8.2-1-lib.zip、xpm-3.5.1-1-lib.zip、zlib-1.2.3-lib.zip,並下載gnutls-3.0.21-w32.zip,把以上檔案建資料夾放入,如D:\Project\workspace\emacs-lib,如下圖。


9.選擇emacs-lib內所有壓縮檔,用winrar解壓縮至此
10.將xpm Source 中的simx.h放入emacs-lib\include\X11
11.到emacs source資料夾下的nt 資料夾,開啟命令提示字元。
12.執行 configure.bat --with-gcc --prefix=d:/emacs --cflags -ID:/Project/workspace/emacs-lib/include   --cflags -LD:/Project/workspace/emacs-lib/lib
13.執行 dos2unix makefile
14.執行 make bootstrap
15.執行 make info
16.執行 make install
17.在D:/emacs/ 編譯出執行檔
PS:1.第8項檔名僅供參考。
         2.用VS2008編譯,編譯失敗,目前無解。

2011年11月6日 星期日

Git Server 架設,使用APACHE(windows 7)


*重要1:Git 在Windows對於UTF-8 支援不好,使用時請三思,確定檔名和記錄只會使用英文撰寫(此問題已在最新版本修正)
          2:Git 初部練習並不需要架APACH, 如果入門者,請先學好Git 再架網頁型資料庫
          3:請先對GIT 的資料庫有初步認識,以及正則表達式的初部認識,在操做下面配置才能了解原理
1.apache 安裝
2.下載svn 到此下載http://code.google.com/p/msysgit/downloads/list?can=3,我使用Git-1.7.7.1-preview20111027.exe
3.安裝 git
  照以下圖示安裝





注意此處指檔案內部換行符要什麼模式,我是選第1項



4.開啟apache 安裝資料夾,我的是C:\Program Files (x86)\Apache Software Foundation\Apache2.2
  如果是XP 或32位元win7系統則會是C:\Program Files\Apache Software Foundation\Apache2.2
5.找conf 資料夾中的httpd.conf 檔,並用記事本軟體開啟編輯。
6.找到 標籤,確認其設定如下:

  Options FollowSymLinks
  AllowOverride None
  Order deny,allow
  Allow from all

7.接著在最下面加入以下內容
#Set this to the root folder containing your Git repositories.
SetEnv GIT_PROJECT_ROOT E:/DataBase/GIT

# Set this to export all projects by default (by default, 
# git will only publish those repositories that contain a 
# file named “git-daemon-export-ok”
SetEnv GIT_HTTP_EXPORT_ALL

# Route specific URLS matching this regular expression to the git http server. 
ScriptAliasMatch \
  "(?x)^/git/(.*/(HEAD | \
    info/refs | \
    objects/(info/[^/]+ | \
      [0-9a-f]{2}/[0-9a-f]{38} | \
      pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
    git-(upload|receive)-pack))$" \
    "C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/$1"

 
 AuthType Basic 
 AuthName "GIT Repository" 
 AuthUserFile "E:/DataBase/Access/Account.conf"
 Require valid-user

PS.1.(?x)^/git/ 指apache http://你的網址路徑/git/
   2.SetEnv GIT_PROJECT_ROOT E:/DataBase/GIT 此行指專案路徑
   3."C:/Program Files (x86)/Git/libexec/git-core/git-http-backend.exe/$1" 指能讓HTTP取出資料庫的程式
 
參考
    1.http://huan-lin.blogspot.com/2011/05/install-git-server-and-apache-on.html
    2.http://www-cs-students.stanford.edu/~blynn/gitmagic/intl/zh_tw/
    如果想支援 git-svn 中文
    2.http://oznyang.iteye.com/blog/993195
    3.http://3ad73f86.dotcloud.com/?p=175

2011年9月30日 星期五

SVN Server 架設,使用APACHE(windows 7)

1.apache 安裝
2.下載svn 到此下載http://sourceforge.net/projects/win32svn/,我使用Setup-Subversion-1.6.17.msi
3.安裝 svn
4.開啟apache 安裝資料夾,我的是C:\Program Files (x86)\Apache Software Foundation\Apache2.2
  如果是XP 或32位元win7系統則會是C:\Program Files\Apache Software Foundation\Apache2.2
5.找conf 資料夾中的httpd.conf 檔,並用記事本軟體開啟編輯。
6.找到這兩行
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
改成
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
7.在它們下面加入這兩行
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so
8.在檔尾加入

	DAV svn
	SVNListParentPath on
	SVNParentPath E:/DataBase/SVN/
	AuthType Basic
	AuthName "Subversion repositories"
	AuthUserFile E:/DataBase/Access/Account.conf
	AuthzSVNAccessFile E:/DataBase/Access/Permissions.conf
	SVNIndexXSLT "/repos-web/view/repos.xsl" #這個是較美觀的資料庫網頁
	Require valid-user

9.在C:\Program Files (x86)\Subversion\bin 資料夾中複製 mod_dav_svn.so 和 mod_authz_svn.so這兩個檔 到C:\Program Files (x86)\Apache Software Foundation\Apache2.2\modules (PS:路徑自行參考調整)
10.在命令題示字元中,切換路徑到 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\bin 輸入 htpasswd -c E:/DataBase/Access/Account.conf 「帳號」
11.要求輸入密碼後,便建立帳號,以後建帳號用htpasswd E:/DataBase/Access/Account.conf 「帳號」
12.建立 E:/DataBase/Access/Permissions.conf 檔案,內容參考如下
[groups]
admin = dk
#readonly = user

[/]
* = r
@admin = rw

[test:/]
13. 下載美觀資料庫網頁 http://reposstyle.com/
14.安裝美觀資料庫網頁,解壓縮檔案到 C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs
15.上面 加入SVNIndexXSLT "/repos-web/view/repos.xsl"
16.建立資料庫在 E:/DataBase/SVN/下的 test資料夾
17.重新執行apache
18.在瀏覽器輸入http://localhost/svn/test/
19.輸入建立Account.conf檔時的密碼
20.出現下圖












21.OK

apache 安裝

1.下載apache 到此下載http://httpd.apache.org/download.cgi#apache22,而我使用httpd-2.2.21-win32-x86-openssl-0.9.8r.msi 這個版本
2.照以下圖示進行安裝

 
 
 
3.第ㄧ項和第二項都設localhost,第三項輸入常用的信箱,當伺服器掛掉時才會收到信。
 
 
 
 

2011年8月4日 星期四

emacs 跨平台配置(el配置檔備份篇)

自從上次的慘痛經驗(恨死Fedora),考慮找一個免錢的網路備份端當重要的系統備份,此時找到了Dropbox,它跨很多平台,且有「版本控制」記錄(雖然沒辦法設定回到那一版,但也夠了),而且是雲端備份系統。
Dropbox網址
希望大家有使用的加我Dropbox為好友,我會共享一些Emacs配置給大家。
我的帳號是:d.k.studio.cms@gmail.com