1.工具-编译选项-编译器-在连接器命令行加入以下命令:

-mwindows

 2.出现错误:undefined reference to `PlaySoundA@12'

    解决办法:工具-编译选项-编译器-在连接器命令行加入以下命令:-lwinmm 

3.undefined reference to `CreateStatusWindowA@16':

  在工程设置中添加 comctl32.lib  

  在link选项中添加-lcomctl32

 

-mwindows -lcomctl32 -lmysql -lwinmm

4.DEV C++无法调试问题:

 编译器里,勾上 编译时加入以下命令

  输入: -g

5.undefined reference to `EnumPrintersA@28'

 -lwinspool

6.

对于mingw,使用WIN32API函数需要包含相应的头文件,比如gethostname需要 #include <winsock.h>,连接时加-lwsock32。 

7. undefined reference to `WSAStartup@8'

-lws2_32   

8.提示WM_CTLCOLOR未定义

  引入 : #include <windowsx.h>  

9.连接ms sqlserver数据库错误:

Objects/MingW/main.o:main.c:(.text+0x398e): undefined reference to `SQLAllocHandle@12'

Objects/MingW/main.o:main.c:(.text+0x39b6): undefined reference to `SQLSetEnvAttr@16'

Objects/MingW/main.o:main.c:(.text+0x39d6): undefined reference to `SQLAllocHandle@12'

....

-lodbc32