TDM-GCC编译win32程序
来源:互联网 发布:赛奇排名优化查询工具 编辑:程序博客网 时间:2024/06/08 12:03
#include<windows.h>//#pragma comment(lib,"user32.lib")//#pragma comment(lib,"gdi32.lib")int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd){HDC hdc;HWND hwnd;COLORREF clr;TCHAR szBuffer[] = TEXT("您好呀,欢迎来到英雄联盟!");hwnd = GetDesktopWindow();hdc = GetWindowDC(hwnd);SetBkMode(hdc,TRANSPARENT);clr = SetTextColor(hdc,RGB(0,255,0));TextOut(hdc,0,0,szBuffer,lstrlen(szBuffer));SetTextColor(hdc,RGB(255,0,0));TextOut(hdc,0,20,szBuffer,lstrlen(szBuffer));SetBkMode(hdc,OPAQUE);SetTextColor(hdc,RGB(0,0,255));TextOut(hdc,0,40,szBuffer,lstrlen(szBuffer));SetTextColor(hdc,clr);ReleaseDC(hwnd,hdc);Sleep(5000);return 0;}
编译的时候一定要加“-mwindows”,否则编译出错:
C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0x5e): undefined reference to `SetBkMode@8'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0x74): undefined reference to `SetTextColor@8'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0xae): undefined reference to `TextOutA@20'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0xc4): undefined reference to `SetTextColor@8'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0xfb): undefined reference to `TextOutA@20'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0x111): undefined reference to `SetBkMode@8'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0x127): undefined reference to `SetTextColor@8'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0x15e): undefined reference to `TextOutA@20'C:\Users\jackz\AppData\Local\Temp\ccGCPuC0.o:windows7.cpp:(.text+0x173): undefined reference to `SetTextColor@8'collect2.exe: error: ld returned 1 exit status
0 0
- TDM-GCC编译win32程序
- CodeBlocks配置TDM-GCC编译环境
- 使用tdm-gcc编译lua5.2 socket模块
- opencv310 windows 7 上编译需要用tdm-gcc
- TDM-GCC and Notepad++ 运行c/c++程序
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- GCC、Cygwin、MinGW、TDM-GCC
- TDM's GCC/mingw32 Builds
- win10下配置VS Code C/C++编译环境(TDM-GCC)
- 嵌入式 GCC 64位程序的makefile条件编译心得——32位版与64位版、debug版与release版(兼容MinGW、TDM-GCC)
- gcc编译C++程序
- 1.2 SAN协议
- 笔试面试搜集资料汇总
- android自学第三天
- 浮点型数据存储方式
- Integer.highestOneBit(int i)的作用
- TDM-GCC编译win32程序
- hdu 5636(最短路)
- Spring整合CXF,发布RSETful 风格WebService
- WebView——重写WebView实现在WebView内部加载网页
- Object-C之NSArray用法
- 【清华集训2014】mex
- 常见的dos命令
- 软件开发中肯定会用到的各种程序下载地址
- 树链剖分学习小记