Я пытаюсь создать проект C ++ ITK, сгенерированный из SOA, который я создал в BMIDE. Метод, который я вызываю в моей службе SOA, должен извлечь все сохраненные запросы из Teamcenter. Я добавил «все» необходимые библиотеки и зависимости, я имею в виду «все», которые, я думаю, могут понадобиться. Но я все еще получаю ошибки, которые не могу понять и не знаю, как их решить.
Мой сгенерированный файл .hxx выглядит следующим образом:
/*
@<COPYRIGHT>@
==================================================
Copyright 2012
Siemens Product Lifecycle Management Software Inc.
All Rights Reserved.
==================================================
@<COPYRIGHT>@
*/
#ifndef TEAMCENTER_SERVICES_QUERYBUILDERLIB_2014_06_QUERYBUILDERSVC_IMPL_HXX
#define TEAMCENTER_SERVICES_QUERYBUILDERLIB_2014_06_QUERYBUILDERSVC_IMPL_HXX#include <querybuildersvc1406.hxx>
#include <QueryBuilderLib_exports.h>
namespace Q2
{
namespace Soa
{
namespace QueryBuilderLib
{
namespace _2014_06
{
class QueryBuilderSvcImpl;
}
}
}
}class SOAQUERYBUILDERLIB_API Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvcImpl : public Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc
{
public:
virtual QueryBuilderSvcImpl::SavedQueriesResponse getSavedQueries ( );};
#include <QueryBuilderLib_undef.h>
#endif
Это мой сгенерированный файл .cxx с реализацией, которую я добавил к методу:
/*
@<COPYRIGHT>@
==================================================
Copyright 2012
Siemens Product Lifecycle Management Software Inc.
All Rights Reserved.
==================================================
@<COPYRIGHT>@
*/
#include <unidefs.h>
#if defined(SUN)
#include <unistd.h>
#endif
#include "querybuildersvc1406impl.hxx"
using namespace Q2::Soa::QueryBuilderLib::_2014_06;
using namespace Teamcenter::Soa::Server;
#include <qry/qry.h>
QueryBuilderSvcImpl::SavedQueriesResponse QueryBuilderSvcImpl::getSavedQueries() {
ServiceData svcData;
SavedQueriesResponse response;
std::vector<QueryObject> savedQueries;
//QueryObject qobj;
int query_count;
tag_t* query_tags;
char* queryName;
char* queryDescription;
int i;
QRY_extent(&query_count, &query_tags);
for (i = 0; i < query_count; i++) {
QRY_ask_name2(query_tags[i], &queryName);
QRY_ask_description2(query_tags[i], &queryDescription);
// create a smart pointer of Item Type from object tag
BusinessObjectRef < Teamcenter::ImanQuery > query(query_tags[i]);
QueryObject tmpQueryObject;
// query
tmpQueryObject.query = query;
// Name
std::string strName(queryName);
tmpQueryObject.queryName = strName;
// Description
std::string strDescription(queryDescription);
tmpQueryObject.queryDescription = strDescription;
savedQueries.push_back(tmpQueryObject);
}
response.services = svcData;
response.queries = savedQueries;
return response;
}
При построении решения я получаю следующую трассировку стека в VS10:
1>------ Build started: Project: QueryBuilderProject, Configuration: Debug x64 ------
1>Build started 3/30/2015 9:27:21 AM.
1>InitializeBuildStatus:
1> Touching "x64\Debug\QueryBuilderProject.unsuccessfulbuild".
1>ClCompile:
1> All outputs are up-to-date.
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>querybuildersvc1406impl.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in itk_main.obj
1> Creating library E:\TC_INSTALL\Siemens\Teamcenter10\bmide\workspace\10000.1.0\QueryBuilderProj\src\server\Q2SoaQueryBuilderLib\x64\Debug\QueryBuilderProject.lib and object E:\TC_INSTALL\Siemens\Teamcenter10\bmide\workspace\10000.1.0\QueryBuilderProj\src\server\Q2SoaQueryBuilderLib\x64\Debug\QueryBuilderProject.exp
1>LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>itk_main.obj : error LNK2019: unresolved external symbol ITK_user_main referenced in function "int __cdecl ms_exception_handling_wrapper(int,char * *)" (?ms_exception_handling_wrapper@@YAHHPEAPEAD@Z)
1>querybuildersvc1406impl.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl Teamcenter::Soa::Server::PartialErrors::addErrorStack(class BusinessObjectRef<class Teamcenter::BusinessObject>)" (?addErrorStack@PartialErrors@Server@Soa@Teamcenter@@UEAAXV?$BusinessObjectRef@VBusinessObject@Teamcenter@@@@@Z)
1>querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException::ServiceException(class Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException const &)" (__imp_??0ServiceException@Exceptions@_2006_03@Soa@Schemas@Teamcenter@@QEAA@AEBV012345@@Z) referenced in function "public: __cdecl Teamcenter::Soa::Server::ServiceException::ServiceException(class Teamcenter::Soa::Server::ServiceException const &)" (??0ServiceException@Server@Soa@Teamcenter@@QEAA@AEBV0123@@Z)
1>querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: class Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException & __cdecl Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException::operator=(class Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException const &)" (__imp_??4ServiceException@Exceptions@_2006_03@Soa@Schemas@Teamcenter@@QEAAAEAV012345@AEBV012345@@Z) referenced in function "public: class Teamcenter::Soa::Server::ServiceException & __cdecl Teamcenter::Soa::Server::ServiceException::operator=(class Teamcenter::Soa::Server::ServiceException const &)" (??4ServiceException@Server@Soa@Teamcenter@@QEAAAEAV0123@AEBV0123@@Z)
1>querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol "public: virtual __cdecl Teamcenter::Soa::Server::ServiceData::~ServiceData(void)" (??1ServiceData@Server@Soa@Teamcenter@@UEAA@XZ) referenced in function "public: virtual struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvcImpl::getSavedQueries(void)" (?getSavedQueries@QueryBuilderSvcImpl@_2014_06@QueryBuilderLib@Soa@Q2@@UEAA?AUSavedQueriesResponse@QueryBuilderSvc@2345@XZ)
1>querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol "public: class Teamcenter::Soa::Server::ServiceData & __cdecl Teamcenter::Soa::Server::ServiceData::operator=(class Teamcenter::Soa::Server::ServiceData const &)" (??4ServiceData@Server@Soa@Teamcenter@@QEAAAEAV0123@AEBV0123@@Z) referenced in function "public: virtual struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvcImpl::getSavedQueries(void)" (?getSavedQueries@QueryBuilderSvcImpl@_2014_06@QueryBuilderLib@Soa@Q2@@UEAA?AUSavedQueriesResponse@QueryBuilderSvc@2345@XZ)
1>querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol "public: __cdecl Teamcenter::Soa::Server::ServiceData::ServiceData(void)" (??0ServiceData@Server@Soa@Teamcenter@@QEAA@XZ) referenced in function "public: virtual struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvcImpl::getSavedQueries(void)" (?getSavedQueries@QueryBuilderSvcImpl@_2014_06@QueryBuilderLib@Soa@Q2@@UEAA?AUSavedQueriesResponse@QueryBuilderSvc@2345@XZ)
1>querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol "public: __cdecl Teamcenter::Soa::Server::ServiceData::ServiceData(class Teamcenter::Soa::Server::ServiceData const &)" (??0ServiceData@Server@Soa@Teamcenter@@QEAA@AEBV0123@@Z) referenced in function "public: __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse::SavedQueriesResponse(struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse const &)" (??0SavedQueriesResponse@QueryBuilderSvc@_2014_06@QueryBuilderLib@Soa@Q2@@QEAA@AEBU012345@@Z)
1>querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __cdecl Teamcenter::Soa::Common::Xml::BaseObject::unref(void)" (__imp_?unref@BaseObject@Xml@Common@Soa@Teamcenter@@QEAAXXZ) referenced in function "public: __cdecl Teamcenter::Soa::Common::AutoPtr<class Teamcenter::Schemas::Soa::_2006_03::Base::PartialErrors>::~AutoPtr<class Teamcenter::Schemas::Soa::_2006_03::Base::PartialErrors>(void)" (??1?$AutoPtr@VPartialErrors@Base@_2006_03@Soa@Schemas@Teamcenter@@@Common@Soa@Teamcenter@@QEAA@XZ)
1>E:\TC_INSTALL\Siemens\Teamcenter10\bmide\workspace\10000.1.0\QueryBuilderProj\src\server\Q2SoaQueryBuilderLib\x64\Debug\QueryBuilderProject.exe : fatal error LNK1120: 9 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:03.23
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Пожалуйста, скажите мне, если вам нужна дополнительная информация, чтобы помочь мне с этой проблемой. Спасибо.
Эта проблема была окончательно решена, когда я снова сделал всю работу от BMIDE. Я думаю, но я не уверен, что это потому, что я забыл упомянуть -dll libqry.lib
в LINK_FLAGS
запись под # Platform specific options and commands
в make-файле проекта bmide.
Задача ещё не решена.