※ 引述《mosquito520 (賣頻寬控制分享器)》之銘言:
: 這裡順帶請問一下...
: 那要怎麼下參數可以暫時把warning給ignore掉呢?
加上 -w 參數可以關掉所有的 warning messages。
: 找到錯誤之後...
: 發覺他的makefile少寫了一個檔案進去...
: 手動修一修之後...
: 發現另外一個問題...
: ../src/WinControls/TaskList/TaskList.cpp:30: error: `INITCOMMONCONTROLSEX'
: undeclared (first use this function)
: 這個東西沒有被宣告在整個source裡面...
: 我查了一下...這是windows sdk裡面的Structure...
: MSDN來的訊息...
: Structure Information
: Minimum DLL Version comctl32.dll version 4.71 or later
: Header commctrl.h
: Minimum operating systems
: Windows 2000, Windows NT 4.0 with Internet Explorer 4.0,
: Windows 98, Windows 95 with Internet Explorer 4.0
: 不過問題來了...
: Mingw裡面有包含Windows SDK的檔案嗎?
: 我有注意到makefile裡面有一行的flag...
: LDFLAGS = -mwindows -Wl,-s -Wl,--gc-sections -lcomctl32 -lshlwapi -lodbc32
: 這裡有指定要GCC去load comct132這個libary...
: 剛好就是那個Structure所在的libary...
: 不過他沒找到?
這裡要澄清一個觀念,
compile-time 的錯誤看 link options 是一點意義都沒有的,
linker 去 link 什麼 library 跟 compiler 完全無關,
你應該在 source code 裡 #include "commctrl.h",
然後確定 commctrl.h 在你的 include path 裡,
對 mingw32 或 gcc 來說,
-I 選項是指定 incldue path 的方法,
path 要直接黏在 I 的後面不可以有空格。
要是還是編不過,
那就打開 commctrl.h 看看 INITCOMMONCONTROLSEX 的周圍,
是不是有 #ifdef ... #endif 之類的東西包住,
有的話就在 #include 之前先 #define 該 #define 的東西,
或是用 -D 參數讓 mingw32 假設有 #define 過那個東西。
: 所以我想請問...是版本不同所造成的?
: 還是怎樣呢?
--
Name: Tseng, Ling-hua E-mail Address: uranus@it.muds.net
School: National Tsing Hua University Department: Computer Science
Interesting: C++, Compiler, PL/PD, OS, VM, Large-scale software design
Researching: Software pipelining for VLIW architectures
Homepage: https://it.muds.net/~uranus
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.230.221.71