zoukankan      html  css  js  c++  java
  • c++只能编译无法运行或许缺少命令

    -mwindows -lcomctl32 -lwinmm -lws2_32 -lodbc32 -lmysql   -lwinspool
    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

  • 相关阅读:
    apache 错误日志
    搭建服务器
    vim配置
    临时表增加查询速度
    如何清空$_POST or $_GET
    hdu 2084
    快速幂
    zjut 1176
    rwkj 1091
    zjut 1090 --------同余定理的应用
  • 原文地址:https://www.cnblogs.com/jdxn/p/6666377.html
Copyright © 2011-2022 走看看