title: error LNK2019: unresolved external symbol ITK_user_main
body: <p>I'm trying to build a Teamcenter ITK project generated from an SOA I created in BMIDE. The method I'm calling in my SOA service should retrieve all the saved queries from Teamcenter. I added all the needed libraries and dependencies I think might be needed. But I still get errors I can't understand and don't know how to solve.</p>
  <p>My generated <code>.hxx</code> file is as following:</p>
  <pre class="lang-cpp prettyprint-override"><code>#ifndef TEAMCENTER_SERVICES_QUERYBUILDERLIB_2014_06_QUERYBUILDERSVC_IMPL_HXX 
  #define TEAMCENTER_SERVICES_QUERYBUILDERLIB_2014_06_QUERYBUILDERSVC_IMPL_HXX
  #include &lt;querybuildersvc1406.hxx&gt;
  #include &lt;QueryBuilderLib_exports.h&gt;
  
  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 &lt;QueryBuilderLib_undef.h&gt;
  #endif
  </code></pre>
  <p>This is my generated <code>.cxx</code> file with the implementation I added to the method:</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;unidefs.h&gt;
  #if defined(SUN)
  #include &lt;unistd.h&gt;
  #endif
  
  #include &quot;querybuildersvc1406impl.hxx&quot;
  
  
  using namespace Q2::Soa::QueryBuilderLib::_2014_06;
  using namespace Teamcenter::Soa::Server;
  
  #include &lt;qry/qry.h&gt;
  
  QueryBuilderSvcImpl::SavedQueriesResponse QueryBuilderSvcImpl::getSavedQueries() {
      ServiceData svcData;
      SavedQueriesResponse response;
      std::vector&lt;QueryObject&gt; savedQueries;
  
      int query_count;
      tag_t* query_tags;
      char* queryName;
      char* queryDescription;
      int i;
  
      QRY_extent(&amp;query_count, &amp;query_tags);
      for (i = 0; i &lt; query_count; i++) {
          QRY_ask_name2(query_tags[i], &amp;queryName);
          QRY_ask_description2(query_tags[i], &amp;queryDescription);
  
          // create a smart pointer of Item Type from object tag
          BusinessObjectRef&lt;Teamcenter::ImanQuery&gt; 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;
  }
  </code></pre>
  <p>When building the solution, I get the following errors in VS10:</p>
  <pre><code>1&gt;------ Build started: Project: QueryBuilderProject, Configuration: Debug x64 ------
  1&gt;Build started 3/30/2015 9:27:21 AM.
  1&gt;InitializeBuildStatus:
  1&gt;  Touching &quot;x64\Debug\QueryBuilderProject.unsuccessfulbuild&quot;.
  1&gt;ClCompile:
  1&gt;  All outputs are up-to-date.
  1&gt;ManifestResourceCompile:
  1&gt;  All outputs are up-to-date.
  1&gt;querybuildersvc1406impl.obj : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '2' doesn't match value '0' in itk_main.obj
  1&gt;     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&gt;LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
  1&gt;itk_main.obj : error LNK2019: unresolved external symbol ITK_user_main referenced in function &quot;int __cdecl ms_exception_handling_wrapper(int,char * *)&quot; (?ms_exception_handling_wrapper@@YAHHPEAPEAD@Z)
  1&gt;querybuildersvc1406impl.obj : error LNK2001: unresolved external symbol &quot;public: virtual void __cdecl Teamcenter::Soa::Server::PartialErrors::addErrorStack(class BusinessObjectRef&lt;class Teamcenter::BusinessObject&gt;)&quot; (?addErrorStack@PartialErrors@Server@Soa@Teamcenter@@UEAAXV?$BusinessObjectRef@VBusinessObject@Teamcenter@@@@@Z)
  1&gt;querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol &quot;__declspec(dllimport) public: __cdecl Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException::ServiceException(class Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException const &amp;)&quot; (__imp_??0ServiceException@Exceptions@_2006_03@Soa@Schemas@Teamcenter@@QEAA@AEBV012345@@Z) referenced in function &quot;public: __cdecl Teamcenter::Soa::Server::ServiceException::ServiceException(class Teamcenter::Soa::Server::ServiceException const &amp;)&quot; (??0ServiceException@Server@Soa@Teamcenter@@QEAA@AEBV0123@@Z)
  1&gt;querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol &quot;__declspec(dllimport) public: class Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException &amp; __cdecl Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException::operator=(class Teamcenter::Schemas::Soa::_2006_03::Exceptions::ServiceException const &amp;)&quot; (__imp_??4ServiceException@Exceptions@_2006_03@Soa@Schemas@Teamcenter@@QEAAAEAV012345@AEBV012345@@Z) referenced in function &quot;public: class Teamcenter::Soa::Server::ServiceException &amp; __cdecl Teamcenter::Soa::Server::ServiceException::operator=(class Teamcenter::Soa::Server::ServiceException const &amp;)&quot; (??4ServiceException@Server@Soa@Teamcenter@@QEAAAEAV0123@AEBV0123@@Z)
  1&gt;querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol &quot;public: virtual __cdecl Teamcenter::Soa::Server::ServiceData::~ServiceData(void)&quot; (??1ServiceData@Server@Soa@Teamcenter@@UEAA@XZ) referenced in function &quot;public: virtual struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvcImpl::getSavedQueries(void)&quot; (?getSavedQueries@QueryBuilderSvcImpl@_2014_06@QueryBuilderLib@Soa@Q2@@UEAA?AUSavedQueriesResponse@QueryBuilderSvc@2345@XZ)
  1&gt;querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol &quot;public: class Teamcenter::Soa::Server::ServiceData &amp; __cdecl Teamcenter::Soa::Server::ServiceData::operator=(class Teamcenter::Soa::Server::ServiceData const &amp;)&quot; (??4ServiceData@Server@Soa@Teamcenter@@QEAAAEAV0123@AEBV0123@@Z) referenced in function &quot;public: virtual struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvcImpl::getSavedQueries(void)&quot; (?getSavedQueries@QueryBuilderSvcImpl@_2014_06@QueryBuilderLib@Soa@Q2@@UEAA?AUSavedQueriesResponse@QueryBuilderSvc@2345@XZ)
  1&gt;querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol &quot;public: __cdecl Teamcenter::Soa::Server::ServiceData::ServiceData(void)&quot; (??0ServiceData@Server@Soa@Teamcenter@@QEAA@XZ) referenced in function &quot;public: virtual struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvcImpl::getSavedQueries(void)&quot; (?getSavedQueries@QueryBuilderSvcImpl@_2014_06@QueryBuilderLib@Soa@Q2@@UEAA?AUSavedQueriesResponse@QueryBuilderSvc@2345@XZ)
  1&gt;querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol &quot;public: __cdecl Teamcenter::Soa::Server::ServiceData::ServiceData(class Teamcenter::Soa::Server::ServiceData const &amp;)&quot; (??0ServiceData@Server@Soa@Teamcenter@@QEAA@AEBV0123@@Z) referenced in function &quot;public: __cdecl Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse::SavedQueriesResponse(struct Q2::Soa::QueryBuilderLib::_2014_06::QueryBuilderSvc::SavedQueriesResponse const &amp;)&quot; (??0SavedQueriesResponse@QueryBuilderSvc@_2014_06@QueryBuilderLib@Soa@Q2@@QEAA@AEBU012345@@Z)
  1&gt;querybuildersvc1406impl.obj : error LNK2019: unresolved external symbol &quot;__declspec(dllimport) public: void __cdecl Teamcenter::Soa::Common::Xml::BaseObject::unref(void)&quot; (__imp_?unref@BaseObject@Xml@Common@Soa@Teamcenter@@QEAAXXZ) referenced in function &quot;public: __cdecl Teamcenter::Soa::Common::AutoPtr&lt;class Teamcenter::Schemas::Soa::_2006_03::Base::PartialErrors&gt;::~AutoPtr&lt;class Teamcenter::Schemas::Soa::_2006_03::Base::PartialErrors&gt;(void)&quot; (??1?$AutoPtr@VPartialErrors@Base@_2006_03@Soa@Schemas@Teamcenter@@@Common@Soa@Teamcenter@@QEAA@XZ)
  1&gt;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&gt;
  1&gt;Build FAILED.
  1&gt;
  1&gt;Time Elapsed 00:00:03.23
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  </code></pre>