未解决的外部符号" public:__这个新运算符的错误

时间:2014-06-08 07:20:37

标签: c++ visual-c++

我有以下课程并在我的C / C ++中添加了班级文件夹 - >一般 - >其他包含目录

.h文件

#include "PropertyCollectionPersistent.h"

namespace Pulsepay { namespace int_layers { namespace common
{
    using Pulsepay::server::common::CPropertyCollectionPersistent;
    using Pulsepay::server::common::CPropertySinkDefImpl;

    class CCommonSettings :
        public CPropertyCollectionPersistent,
        public CPropertySinkDefImpl
    {
    public:
        CCommonSettings(void);
        ~CCommonSettings(void);
    };
}}}

.cpp文件

#include "StdAfx.h"
#include "Pulsepay_Int_Layers_Common_Settings.h"
#include "PropertyCollection.h"

using namespace Pulsepay;
using namespace Pulsepay::int_layers;
using namespace Pulsepay::int_layers::common;
using namespace Pulsepay::server;
using namespace Pulsepay::server::common;

namespace Pulsepay { namespace int_layers { namespace common { namespace details
{
    using Pulsepay::server::common::CProperty;

    static LPCTSTR  SettingAttribute__SettingStartUpSave     = _T("StartupSave");
    static LPCTSTR  SettingAttribute__DataProviderConnectStr = _T("DataProviderConnectStr");
    static LPCTSTR  SettingAttribute__LanguagePack_Key__Name = _T("LanguagePack__Key__Name");
    static LPCTSTR  SettingAttribute__LanguagePack_Key__Path = _T("LanguagePack__Key__Path");
    static LPCTSTR  SettingAttribute__DataProviderConnectDef = _T(".\\storage\\term2__local__main.mdb");
    static LPCTSTR  SettingAttribute__UseExternalDataSource  = _T("UseExternalDataSource");

    Pulsepay::server::common::Raw__PropertyItem  SettingAttribute__Enum[] = {
        {0xa1, SettingAttribute__SettingStartUpSave    , CProperty::EPT__Integer, _T("0") },
        {0xa2, SettingAttribute__LanguagePack_Key__Path, CProperty::EPT__Text   , _T(".\\PVSCLIENTAPP_USEGUIDE.LANG") },
        {0xa3, SettingAttribute__DataProviderConnectStr, CProperty::EPT__Text   , _T("") },
        {0xa4, _T("DataProviderDefaultURL")            , CProperty::EPT__Text   , SettingAttribute__DataProviderConnectDef},
        {0xa5, _T("NativeControlDataFile")             , CProperty::EPT__Text   , _T(".\\storage\\PVSUSERDATACTRL.TBL")},
        {0xa6, _T("NativeVeinImageDataFile")           , CProperty::EPT__Text   , _T(".\\storage\\PVSVEINDATA.DAT")},
        {0xa7, SettingAttribute__UseExternalDataSource , CProperty::EPT__Integer, _T("1")}
    };
}}}}

////////////////////////////////////////////////////////////////////////////

CCommonSettings::CCommonSettings(void) : CPropertyCollectionPersistent(_T("CommonSettings"), *this)
{
    CPropertyCollectionPersistent::Create(details::SettingAttribute__Enum, _countof(details::SettingAttribute__Enum), false);
}

CCommonSettings::~CCommonSettings(void)
{
}

现在我想从我的项目主函数

中使用上面的类

当我不使用新操作符时,我没有收到任何错误

int_layers::common::CCommonSettings ccSetings();

使用新运算符

时出现问题
int_layers::common::CCommonSettings *ccSetings;
ccSetings = new int_layers::common::CCommonSettings;

我收到以下错误

错误LNK2019:未解析的外部符号" public:__ thiscall Pulsepay :: int_layers :: common :: CCommonSettings :: CCommonSettings(void)" (?? 0CCommonSettings @ common @ int_layers @ Pulsepay @@ QAE @ XZ)在函数_main

中引用

请帮忙!

1 个答案:

答案 0 :(得分:0)

这不是答案,但我希望能够正确引用代码:

namespace Pulsepay { namespace int_layers { namespace common { namespace details
{
using Pulsepay::server::common::CProperty;

static LPCTSTR  SettingAttribute__SettingStartUpSave     = _T("StartupSave");
// ...
}}}}    // All namespaces closed here.

以下定义的命名空间是什么:

CCommonSettings::CCommonSettings(void)
 : CPropertyCollectionPersistent(_T("CommonSettings"), *this)
{
   CPropertyCollectionPersistent::Create(details::SettingAttribute__Enum, 
   _countof(details::SettingAttribute__Enum), false);
}