I don't think the errors you're seeing are coming from this code. If I were
libraries are included and compiled with the same compiler. You may have a
you intended to have listed.
Hi Asm,
Thanks for your replys. i modified the code as follows.
LPSTR lpszKeyWordData;
//Actually it was LPSTR only i posted wrong like LPTSTR (sorry for that)
char *cpFromDataPoint, *cpToDataPoint, *cpDataPoint;
cpToDataPoint = strstr(lpszKeyWordData , ",");
if(cpToDataPoint == NULL)
{...........;
}
else
*(cpToDataPoint++) = '\0';
cpDataPoint = strstr(cpFromDataPoint, "FIELDSEPPOS");
if(cpDataPoint == NULL)
{
cpDataPoint = strstr(cpFromDataPoint, "ENDTRACK");
if(cpDataPoint == NULL)
{
.........................;
}
}
but still my error list same like below. please help me out..
**********************error list*******************************
Creating library .\Release/simidc.lib and object .\Release/simidc.exp
comsupp.lib(comutil.obj) : error LNK2005: "class _variant_t vtMissing"
(?vtMissing@@3V_variant_t@@A) already defined in comsuppw.lib(comutil.obj)
simwfp.lib(SimFlexGrid.obj) : error LNK2001: unresolved external symbol
"public: __thiscall CSimString::CSimString(unsigned short const *)"
(??0CSimString@@QAE@PBG@Z)
simwfp.lib(SimDefaultEventProcessor.obj) : error LNK2019: unresolved
external symbol "public: __thiscall CSimString::CSimString(unsigned short
const *)" (??0CSimString@@QAE@PBG@Z) referenced in function
__ehhandler$??1CSimDefaultEventProcessor@@UAE@XZ
simwfp.lib(SimGlobals.obj) : error LNK2019: unresolved external symbol
"public: static class CSimTrace * __stdcall CSimTrace::Instance(unsigned
short *)" (?Instance@CSimTrace@@SGPAV1@PAG@Z) referenced in function "long
__stdcall WFPOpen(unsigned short,char *,void *,char *,unsigned
long,unsigned
long,struct HWND__ *,unsigned long,void *,unsigned long,struct
CENXFS3_02::_wfsversion *,unsigned long,struct CENXFS3_02::_wfsversion *)"
(?WFPOpen@@YGJGPADPAX0KKPAUHWND__@@K1KPAU_wfsversion@CENXFS3_02@@K3@Z)
simwfp.lib(SimGlobals.obj) : error LNK2019: unresolved external symbol
"unsigned short const * const IDS_API_DB_FILE_ERROR"
(?IDS_API_DB_FILE_ERROR@@3QBGB) referenced in function "void __stdcall
CheckDBFileStatus(unsigned short *)" (?CheckDBFileStatus@@YGXPAG@Z)
simwfp.lib(SimGlobals.obj) : error LNK2019: unresolved external symbol
"public: void __thiscall CSimString::TagField(unsigned short const *)"
(?TagField@CSimString@@QAEXPBG@Z) referenced in function "void __stdcall
CheckDBFileStatus(unsigned short *)" (?CheckDBFileStatus@@YGXPAG@Z)
simwfp.lib(SimGlobals.obj) : error LNK2019: unresolved external symbol
"unsigned short const * const IDS_API_DB_READ_ONLY"
(?IDS_API_DB_READ_ONLY@@3QBGB) referenced in function "void __stdcall
CheckDBFileStatus(unsigned short *)" (?CheckDBFileStatus@@YGXPAG@Z)
simwfp.lib(simcommandeditor.obj) : error LNK2001: unresolved external
symbol
"public: class CSimString & __thiscall CSimTrace::GetErrorDescription(enum
_SIM_ERROR_CATEGORY,unsigned short const *,unsigned long)"
(?GetErrorDescription@CSimTrace@@QAEAAVCSimString@@W4_SIM_ERROR_CATEGORY@@PBGK@Z)
Release_Image/simidc.dll : fatal error LNK1120: 96 unresolved externals
Results Build log was saved at
"file://c:\TestSandBox\simidc\Release\BuildLog.htm"
SimIDC - 228 error(s), 3 warning(s)
************************************************************
Thanks alot for your supporting............
- karimulla
"MrAsm" wrote:
On Mon, 4 Jun 2007 00:18:01 -0700, karim
<karim@discussions.microsoft.com> wrote:
char *cpFromDataPoint, *cpToDataPoint, *cpDataPoint;
......
/* first if condition*/
if( (cpToDataPoint = const_cast<char *>(strstr( (const
char*)lpszKeyWordData, (const char *)","))) == NULL)
{
You wrote over-complicated code...why??
Do you like excess of complexity?
From here:
http://www.cplusplus.com/reference/clibrary/cstring/strstr.html
you can read that in C++ there are two prototypes of strstr:
const char * strstr ( const char * str1, const char * str2 );
char * strstr ( char * str1, const char * str2 );
So, why don't you just write:
if ( (cpToDataPoint = strstr( KeyWordData, "," )) == NULL )
...
Moreover, your code has an error, because you are mixing Unicode-aware
string (LPTSTR) with Ansi strings (char *).
You can't use LPTSTR lpszKeyWordData in a context where an Ansi string
is required (like strstr), and the (const char *)lpszKeyWordData cast
is a time-bomb bug.
You have 2 options:
1. convert lpszKeyWordData from LPTSTR to 'char *' using *proper*
conversion (e.g. CT2A) or
2. program Unicode-aware everywhere, so e.g. use Unicode aware
routines like _tcsstr instead of strstr, and decorate your literal
strings using _T("") (i.e. write _T(","), _T("ENDTRACK"), etc.).
You should review and adjust your code as indicated above.
Then try to rebuild.
error LNK2005: "class _variant_t vtMissing"
(?vtMissing@@3V_variant_t@@A)
already defined in comsuppw.lib(comutil.obj) comsupp.lib
[cut]
We have already answered this question in another thread. You did not
give feed-back to us, and now you are relisting the same problems ?_?
Also considering the portion of source you posted, I think that you
have errors due to Unicode unaware programming, and mixing Ansi and
Unicode in your source code.
MrAsm