初次用VC++6.0,编译通过了,可是link的时候出现了这个问题
------------------Configuration: CppTest - Win32 Debug--------------------
Linking...
CppTest.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall CppDyer::~CppDyer(void)" (??1CppDyer@@UAE@XZ)
CppTest.obj : error LNK2001: unresolved external symbol "public: void __thiscall CppDyer::processFile(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?processFile@CppDyer@@QAEXV?$basic_string@DU?$char_trait
s@D@std@@V?$allocator@D@2@@std@@@Z)
CppTest.obj : error LNK2001: unresolved external symbol "public: __thiscall CppDyer::CppDyer(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (??0CppDyer@@QAE@V?$basic_string@DU?$char_traits@D@std@@V?$allocat
or@D@2@@std@@@Z)
Debug/CppTest.exe : fatal error LNK1120: 3 unresolved externals
执行 link.exe 时出错.CppTest.exe - 1 error(s), 0 warning(s)
请大家指教~~。

解决方案 »

  1.   

    #include "stdafx.h"
    #include "CppLex.h"
    #include "CppDyer.h"
    #include <sstream>
    #include <fstream>
    #include <iostream>using namespace std;
    using namespace CppParser;class HtmlEncoder
    {
    int mPositionInLine;
    bool mIsInFontTag;
    string mLastColor;
    public:
    HtmlEncoder()
    {
    cout<<"<FONT FACE=\"Fixedsys\">";
    mPositionInLine=0;
    mIsInFontTag=false;
    }
    string encode(const string& s,const std::string& color)
    {
    std::string r;
    if(mLastColor!=color)
    {
    mLastColor=color;
    if(mIsInFontTag)
    {
    r+="</FONT><FONT COLOR=\"";
    r+=color;
    r+="\">";
    }
    else
    {
    r+="<FONT COLOR=\"";
    r+=color;
    r+="\">";
    }
    }
    for(std::string::size_type i=0;i<s.size();++i)
    {
    if(s[i]=='\"')
    r+="&quot;";
    else if(s[i]=='&')
    r+="&amp;";
    else if(s[i]=='<')
    r+="&lt;";
    else if(s[i]=='>')
    r+="&gt;";
    else if(s[i]==' ')
    r+="&nbsp;";
    else if(s[i]=='\t')
    {
    for(int i=0;i<4-mPositionInLine%4;++i)
    r+="&nbsp;";
    mPositionInLine+=4-mPositionInLine%4;
    continue;
    }
    else if(s[i]=='\n')
    {
    r+="<br>";
    mPositionInLine=0;
    continue;
    }
    else
    r+=s[i];
    ++mPositionInLine;
    }
    return r;
    }
    string flush()
    {
    if(mIsInFontTag)
    return "</FONT>";
    cout<<"</FONT>";
    }
    };int main(int argc, char* argv[])
    {
    cerr<<"CppDyer 0.99  (c) by PolyRandom, all right reserved"<<endl;
    cerr<<"This version is for debug only, please check"<<endl;
    cerr<<"http://www.polyrandom.com/"<<endl;
    cerr<<"for bug report and latest versions"<<endl;
    cerr<<endl;
    if(argc!=3)
    {
    cerr<<"USAGE: CppDyer <ini file name> <cpp file name>"<<endl;
    return 0;
    }
    cerr<<"Converting..."<<endl;
    try
    {
    CppDyer cd(argv[1]);
    cd.processFile(argv[2]);
    cerr<<"done"<<endl;
    }
    catch(...)
    {
    cerr<<"failed"<<endl;
    }
    return 0;
    }
    主程序是这个请大家指教一下吧
      

  2.   

    agree 你看看CppDyer是不是有问题,没找到有些需要实现的东西。
      

  3.   

    添加静态库:
    project-->setting-->link-->object/model
      

  4.   

    CppDyer,如果这东西有 source cpp file,那么就把这些文件添加到你的工程中