[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

6.2

linker error LNK2001: unresolved external symbol "__declspec(dllimport)

Asked by sashi_kanth in Windows MFC Programming

Tags: unresolved, external, symbol, error

I am tring to create a dll.I get the following error while linking with 238 warnings.
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall TraceNo::TraceNo(char const *)" (__imp_??0TraceNo@@QAE@PBD@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall TraceNo::~TraceNo(void)" (__imp_??1TraceNo@@QAE@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "public: virtual class NC_OverridableFunction * __thiscall NC_OverridableFunction::Clone(void)" (?Clone@NC_OverridableFunction@@UAEPAV1@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall NC_Object::FailedRegistration(class NC_RegistrationID &,class ErrorMsg_Reg const *)" (?FailedRegistration@NC_Object@@UAEXAAVNC_RegistrationID@@PBVErrorMsg_Reg@
@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall NC_OverridableFunction::~NC_OverridableFunction(void)" (__imp_??1NC_OverridableFunction@@UAE@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class FuncName const  _STR_CONSTRUCTOR" (__imp_?_STR_CONSTRUCTOR@@3VFuncName@@B)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall NC_OverridableFunction::NC_OverridableFunction(void)" (__imp_??0NC_OverridableFunction@@QAE@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class FuncName const  _STR_DESTRUCTOR" (__imp_?_STR_DESTRUCTOR@@3VFuncName@@B)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class String & __thiscall String::operator<<(double)" (__imp_??6String@@QAEAAV0@N@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class String & __thiscall String::Clean(void)" (__imp_?Clean@String@@QAEAAV1@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall SQL::~SQL(void)" (__imp_??1SQL@@QAE@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Error & __thiscall Error::operator<<(char const *)" (__imp_??6Error@@QAEAAV0@PBD@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall SQL::ReportError(void)" (__imp_?ReportError@SQL@@QAEHXZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall SQL::getSQLrc(void)" (__imp_?getSQLrc@SQL@@QAEHXZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall SQL::SQL(class DataBase &,class String const &)" (__imp_??0SQL@@QAE@AAVDataBase@@ABVString@@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class DataBase * __cdecl DataBaseManager::GetCurrentDataBase(void)" (__imp_?GetCurrentDataBase@DataBaseManager@@SAPAVDataBase@@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class String & __thiscall String::operator<<(class String const &)" (__imp_??6String@@QAEAAV0@ABV0@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class String const & __thiscall NVPHash::Get(class String const &,class String const &)const " (__imp_?Get@NVPHash@@QBEABVString@@ABV2@0@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class NameValuePairMap const & __thiscall HttpRequest::getNVPs(void)const " (__imp_?getNVPs@HttpRequest@@QBEABVNameValuePairMap@@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class StringWithOwnership const  _STR_EMPTY_" (__imp_?_STR_EMPTY_@@3VStringWithOwnership@@B)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall String::String(char const *)" (__imp_??0String@@QAE@PBD@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class StringWithOwnership const  _PARAM_NAME_MERCHANT_REF_NUM" (__imp_?_PARAM_NAME_MERCHANT_REF_NUM@@3VStringWithOwnership@@B)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall String::~String(void)" (__imp_??1String@@UAE@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Error & __cdecl Error::nls(class ErrorMsg const *,...)" (__imp_?nls@Error@@QAAAAV1@PBVErrorMsg@@ZZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class ErrorMsg_API const  _API_CANT_FIND_IN_ENV" (__imp_?_API_CANT_FIND_IN_ENV@@3VErrorMsg_API@@B)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: char const * __thiscall String::c_str(void)const " (__imp_?c_str@String@@QBEPBDXZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class Error & __thiscall Error::operator<<(class Error & (__cdecl*)(class Error &))" (__imp_??6Error@@QAEAAV0@P6AAAV0@AAV0@@Z@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class Error  error" (__imp_?error@@3VError@@A)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class NC_Void * __thiscall NC_Environment::Seek(class String const &)" (__imp_?Seek@NC_Environment@@QAEPAVNC_Void@@ABVString@@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "class StringWithOwnership const  _PARAM_NAME_ORDER_REF_NUM" (?_PARAM_NAME_ORDER_REF_NUM@@3VStringWithOwnership@@B)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class String & __thiscall String::operator<<(char const *)" (__imp_??6String@@QAEAAV0@PBD@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall String::String(class String const &)" (__imp_??0String@@QAE@ABV0@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall NC_OverridableFunction::NC_OverridableFunction(class NC_OverridableFunction const &)" (__imp_??0NC_OverridableFunction@@QAE@ABV0@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: class NC_OverridableFunction & __thiscall NC_OverridableFunction::operator=(class NC_OverridableFunction const &)" (__imp_??4NC_OverridableFunction@@QAEAAV0@ABV0
@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall ClassName::ClassName(char const *)" (__imp_??0ClassName@@QAE@PBD@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall ClassName::~ClassName(void)" (__imp_??1ClassName@@UAE@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: int __thiscall NC_OverridableFunctionManager::RegisterOverridableFunction(class String const &,class String const &,class String const &,double,class NC_Overrida
bleFunction *)" (__imp_?RegisterOverridableFunction@NC_OverridableFunctionManager@@QAEHABVString@@00NPAVNC_OverridableFunction@@@Z)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static class NC_OverridableFunctionManager & __cdecl NC_OverridableFunctionManager::GetUniqueInstance(void)" (__imp_?GetUniqueInstance@NC_OverridableFunctionMana
ger@@SAAAV1@XZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall Error::endl(void)" (__imp_?endl@Error@@QAEXXZ)
ordertot.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall Error::indent(void)" (__imp_?indent@Error@@QAEXXZ)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/ordertot.exe : fatal error LNK1120: 41 unresolved externals
Error executing link.exe.

ordertot.exe - 42 error(s), 238 warning(s)
My code is as given below .I have included all the necessary headers.There seems to be some problem with _declspec.Please help.
#include "objects/objects.pch"
#include<winbase.h>



#if defined (WIN32)
 #define __DLL_NCS_API__ __declspec(dllexport)
#elif defined(AIX)
  #define __DLL_NCS_API__
#endif

#include "tasks_api.h"

//========================================================================================
//========================================================================================
//#define __TRACE_NCAPIS__

#ifdef __TRACE_NCAPIS__
  typedef TraceYes Trace;
#else
  typedef TraceNo  Trace;
#endif
static Trace trace("NC_APIS ("__FILE__")");
//========================================================================================


static const double SIGMA = 0.000001;



//////////////////////////////////////////////////////////////////////////////////////////
//
//  GetOrdProdTot
//
//
//class __declspec(dllexport) GetOrdProdTot : public NC_OverridableFunction
class __DLL_NCS_API__ GetOrdProdTot : public NC_OverridableFunction
{
   static const ClassName _STR_ThisClass;

public:
   GetOrdProdTot()
   {
      Trace::Tracer T(_STR_CONSTRUCTOR, _STR_ThisClass);
   }
   virtual ~GetOrdProdTot()
   {
      Trace::Tracer T(_STR_DESTRUCTOR, _STR_ThisClass);
   }

   void operator delete(void* p) { ::delete p; }

public:
   virtual bool Process(const HttpRequest& Req, HttpResponse& Res, NC_Environment& Env)
   {
      // Set the error handler.    
      String ErrTaskName(_TaskName);
      ErrTaskName << "_ERR";

      // Input Parameters:
      const String* OrderRefNum = (const String *) Env.Seek(_PARAM_NAME_ORDER_REF_NUM);
      if (OrderRefNum == NULL)
      {
         error << indent; error.nls(&_API_CANT_FIND_IN_ENV, _PARAM_NAME_ORDER_REF_NUM.c_str()) << endl;
         return false;
      }

      const String* MerchantRefNum = (const String *) Env.Seek(_PARAM_NAME_MERCHANT_REF_NUM);
      if (MerchantRefNum == NULL)
      {
         error << indent; error.nls(&_API_CANT_FIND_IN_ENV, _PARAM_NAME_MERCHANT_REF_NUM.c_str()) << endl;
         return false;
      }

      // Output Parameters:
 //     String *ProductPrice = (String *) Env.Seek(_PARAM_NAME_PRODUCT_PRICE);
 //     if (ProductPrice == NULL)
 //     {
 //        error << indent; error.nls(&_API_CANT_FIND_IN_ENV, _PARAM_NAME_PRODUCT_PRICE.c_str()) << endl;
 //        return false;
 //     }
      double disc=atof(Req.getNVPs().Get("myamt").c_str());
      String stmt;  
      stmt << "UPDATE orders SET orprtot=orprtot+discamt"
             << "WHERE orrfnbr=" << *OrderRefNum
             << "and ormenbr=" << *MerchantRefNum;
        SQL Sql(*(DataBaseManager::GetCurrentDataBase()), stmt);
        if (Sql.getSQLrc() != ERR_DB_NO_ERROR)
         {
            Sql.ReportError();
            error << "Update after lump" << endl;
            return false;
         }
        stmt.Clean();
        stmt << "UPDATE orders SET discamt=0"
             << "WHERE orrfnbr=" << *OrderRefNum
             << "and ormenbr=" << *MerchantRefNum;
        SQL Sql1(*(DataBaseManager::GetCurrentDataBase()), stmt);
        if (Sql1.getSQLrc() != ERR_DB_NO_ERROR)
         {
            Sql1.ReportError();
            error << "Update after lump" << endl;
            return false;
         }
       stmt.Clean();
       stmt << "UPDATE orders SET discamt="<<disc<<","
            << "SET orprtot=orprtot+" << disc;
   
      SQL Sql2(*(DataBaseManager::GetCurrentDataBase()), stmt);
      if (Sql2.getSQLrc() != ERR_DB_NO_ERROR)
         {
            Sql2.ReportError();
            error << "Update after lump" << endl;
            return false;
         }
     
        return true;      
   }
};

const ClassName GetOrdProdTot::_STR_ThisClass("GetOrdProdTot");

static bool X2 = NC_OverridableFunctionManager::GetUniqueInstance().RegisterApi
                 ( "IBM", "NC", "GetOrdProdTot", 1.0, new GetOrdProdTot );
[+][-]08/17/99 05:23 AM, ID: 1314032Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Windows MFC Programming
Tags: unresolved, external, symbol, error
Sign Up Now!
Solution Provided By: sets
Participating Experts: 3
Solution Grade: C
 
[+][-]08/17/99 04:23 AM, ID: 1314031Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/17/99 11:12 AM, ID: 1314033Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/17/99 11:30 AM, ID: 1314034Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091118-EE-VQP-93