This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
由於之前一直拿Linux(GNU GCC)當作我的開發環境,所以這一次實習我也硬是先拿GNU編譯器當作開發環境了 | |
不過在完成所有的要求,要移植到Visual Studio時遇到了一些問題: | |
1.在C++程式中include C library會出現關於不相容Common Language Runtime的錯誤 | |
解法:在專案選項中關閉Common Language Runtime(/clr)(似乎是.NET程式才會用到的功能)。 | |
2.UTF-8文字編碼(encoding)的原始程式碼檔案用Visual C++ compiler 編譯會出現很多無法從code中找到的error(似乎是編譯器的parsing出問題) | |
Build log如下:https://gist.github.com/1907441 | |
目前的(暫時)解決方法是全部轉成BIG5(Codepage 950)才能順利編譯 | |
不過網路上有人提到UTF-8程式原始碼要加上BOM(Byte Order Mark),我還沒試 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1>------ 已開始建置: 專案: 1_1, 組態: Debug Win32 ------ | |
1> Swap_algorithm.c | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c : warning C4819: 檔案含有無法在目前字碼頁 (950) 中表示的字元。請以 Unicode 格式儲存檔案以防止資料遺失 | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c(40): error C2065: 'swap_a' : 未宣告的識別項 | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c(40): error C2100: 不合法的間接取值 | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c(40): error C2099: 初始設定式不是常數 | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c(41): error C2065: 'swap_b' : 未宣告的識別項 | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c(41): error C2100: 不合法的間接取值 | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c(41): error C2099: 初始設定式不是常數 | |
1>i:\test_git\lab_1_1\visual_studio_2010_environment\1_1\source_code\swap_algorithm.c(42): error C209 |
NewerOlder