zoukankan      html  css  js  c++  java
  • error LNK2019: 无法解析的外部符号 "public: void __thiscall

    错误信息:

    error LNK2019: 无法解析的外部符号 "public: void __thiscall CArcBall::setBounds(int,int)" (?setBounds@CArcBall@@QAEXHH@Z),该符号在函数 "public: void __thiscall CChild3DView::OnSize(unsigned int,int,int)" (?OnSize@CChild3DView@@QAEXIHH@Z) 中被引用
    1>D:Visual Studio 2008modmodDebugmod.exe : fatal error LNK1120: 1 个无法解析的外部命令

    错误代码:

    XXX.h
    
    inline
    void setBounds(int NewWidth, int NewHeight);
    
     
    
    XXX.cpp
    
    void CArcBall::setBounds(int NewWidth, int NewHeight)
    {
    //设置长宽的调整因子
    this->AdjustWidth = 1.0f / (((GLfloat)NewWidth - 1.0f) * 0.5f);
    this->AdjustHeight = 1.0f / (((GLfloat)NewHeight - 1.0f) * 0.5f);
    }

    呵呵,因为之前这个函数的定义是直接放在.h文件里的,就用了inline,结果放到源文件里的时候就没有注意。。。。。

    解决办法:

    去掉 inline 就好了~~

    转载自:http://blog.csdn.net/zsdt345a780rfajwet/article/details/8266790  谢谢分享!

  • 相关阅读:
    poj 1466 Girls and Boys
    poj 1486 Sorting Slides
    poj 2112 Optimal Milking
    poj 1274 The Perfect Stall
    SHoj 420 购买装备
    poj 2987 Firing
    SHoj A序列
    FOJ Problem 2271 X
    XidianOJ 1028 数字工程
    XidianOJ 1030 三数和
  • 原文地址:https://www.cnblogs.com/lwflourish/p/4239114.html
Copyright © 2011-2022 走看看