我不能让Comctl32.lib与我的程序链接使用GCC (MinGW)。
GCC输入:
gcc -o program.exe main.c images.o -lgdi32 -lcomctl32 -mwindowsGCC输出
main.c: In function 'WinMain':
main.c:120:2: error: unknown type name 'INITCOMMONCONTROLSEX'
main.c:124:9: error: request for member 'dwICC' in something not a structure or unionmain.c中的相关代码
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#include <windows.h>
#include <commctrl.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmd)
{
Line 120: INITCOMMONCONTROLSEX icex;
Line 124: icex.dwICC = ICC_LISTVIEW_CLASSES;
InitCommonControlsEx(&icex);
}感谢您能提供的任何帮助或信息。我已经在这个问题上研究太久了,就是想不出一个答案。
发布于 2013-04-23 23:29:13
多亏了David H,我才解决了这个问题。
#define _WIN32_IE 0x0900我的印象是commctrl.h在默认情况下定义了0x0500 (我的函数需要0x0300),但看起来并非如此。
如果您没有在项目中定义_WIN32_IE宏,它将自动定义为0x0500。-- MSDN Source
https://stackoverflow.com/questions/16172910
复制相似问题