|
pl_kode wrote: Initializelog.obj : error LNK2001: unresolved external symbol "class std::basic_string,class std::allocator > message" (?message@@3V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@A)
You somehow managed to get the symbol name wrong. I manually de-mangled the symbol and came up with the following:
class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > message
pl_kode wrote: Logger.obj : error LNK2001: unresolved external symbol "class std::basic_string,class std::allocator > __cdecl log(class std::basic_string,class std::allocator >" (?l
og@@YA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V12@@Z)
Again, the symbol name is wrong here, it should read as follows:
class std::basic_string<char,struct std::char_traits<char>,
class std::allocator<char> > __cdecl log(class std::basic_string<char,
struct std::char_traits<char>,class std::allocator<char> > )
Steve
|
|
|
|
|
I have left with these errors when compiling my code:
"MyBrowser.obj : error LNK2019: unresolved external symbol __imp___stricoll referenced in function "int __cdecl b_compare(struct b_sort_s *,struct b_sort_s *)" (?b_compare@@YAHPAUb_sort_s@@0@Z)
MyBrowser.obj : error LNK2019: unresolved external symbol __imp__div referenced in function "public: virtual void __thiscall CMyBrowser:SurprisenPrint(class CDC *,struct CPrintInfo *)" (?OnPrint@CMyBrowser@@UAEXPAVCDC@@PAUCPrintInfo@@@Z)
MyBrowser.obj : error LNK2019: unresolved external symbol __imp__atof referenced in function "public: class ATL::CStringT<char,class strtraitmfc_dll<char,class="" atl::chtraitscrt<char=""> > > __thiscall CMyBrowser::GetColumnCount(int,int)" (?GetColumnCount@CMyBrowser@@QAE?AV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@HH@Z)"
So the problems are with '_stricoll', 'div' and 'atof' in my code, to be more specific:
- suma += atof(GetItemText(i,nCol));
- res=_stricoll( (char*)arg1->string[j], (char*)arg2->string[j] );
- div_t div_result = div( pInfo->m_nCurPage-1, m_PageHorz+1 );
I searched for this functions, but could not find solution.
My project is in VC++2008 MFC and is 'Multi-threaded Debug DLL (/MDd)'
Any idea on this?
Thanks!
|
|
|
|
|
Do you have the linker switch Ignore All Default Libraries (i.e. /NODEFAULTLIB ) ON?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
my 'Ignore all default libraries' is set to NO
|
|
|
|
|
josip cagalj wrote: Any idea on this?
See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can anyone please tell me how to resolve these linker errors?
1 . "Error 1 error LNK2001: unresolved external symbol _CLSID_MMCVersionInfo"
2 . "Error 2 error LNK2001: unresolved external symbol _IID_IMMCVersionInfo"
Thanks,
Mushq
|
|
|
|
|
#pragma comment (lib, "Mmc.lib")
|
|
|
|
|
Thanks a millions.
but can you please explain that, actually when I was including "Mmc.lib" in "Project Settings"->Linker->"Additional Dependencies", this resolved the error related IID _MMCVersionInfo but it was creating another linker error i.e. "error LNK2005: "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) already defined in Mmc.lib(apimfc.obj) nafxcwd.lib"
Regards,
Mushq
|
|
|
|
|
what is your project type, do you include any ather lib explicitly, you include stdafx.h in the beginning of every file, can you post the full length link error.
|
|
|
|
|
Error 114 error LNK2005: "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) already defined in Mmc.lib(apimfc.obj) nafxcwd.lib
Rajkumar R wrote: what is your project type
Dialog based application: Using MFC in a Static Library
Rajkumar R wrote: do you include any other lib explicitly
yes there are many, such as
Secur32.lib
Resutils.lib
Netapi32.lib
Shlwapi.lib
Shell32.lib
Version.lib
Kernel32.lib
FCI.LIB
FDI.LIB
adsiid.lib
Advapi32.lib
Psapi.lib
ActiveDS.lib
Rajkumar R wrote: you include stdafx.h in the beginning of every file
yes in many files stdafx.h is included.
I think that might be error due to explicitly including many libs, since including #pragma comment (lib, "Mmc.lib") will set the lib linking to the specific obj file but not to the complete project am I right?
Regards,
Mushq
|
|
|
|
|
Mushq wrote: since including #pragma comment (lib, "Mmc.lib") will set the lib linking to the specific obj file but not to the complete project am I right?
no, that is just a linker option specified in code rather than in project settings, so that you can specify the lib in code of some include files so that the corresponding lib is linked when the header is include.
Mushq wrote: Using MFC in a Static Library
Do you really nead this, try in shared lib, I can able to reproduce the problem if i use MFC in static lib and link MMC.lib and use AFX_MANAGE_STATE() macro. I don't have time to dig into it now, just curious do you have used such macros in the dialog application. MFC in shared lib build successfully for me, try it.
|
|
|
|
|
Rajkumar R wrote: MFC in shared lib build successfully for me, try it.
For me too.
Rajkumar R wrote: Do you really nead this
Yes, actually it's a setup of my company's product so that it must use MFC as a static library.
Dear Raj, so nice of your time and effort.
Regards,
Mushq
|
|
|
|
|
I am facing a problem in using bitblt(...) function, its returning value as 0 if I say ctrl+alt+del and unlock it back.
I guess we are not getting handle correctly what could be the reason??? In normal scenario it working fine.
Expecting favourable reply.
|
|
|
|
|
Do you know about GetLastError function?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Ofcourse I know about GetLastError. Its giving error as Invalid Handle, but why is it giving when the desktop is in Inactive mode??? I have seen in google groups this happens only with Win-XP. Please let me know if you have any idea of it.
|
|
|
|
|
Did you see this [^]?
Have a look at Eric Perlin's second reply (I don't know it helps in your case, since you post no details about).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thank You Pallini. Seems the link is quite useful, will look into it.
|
|
|
|
|
Hi,
When i am executing _spawn API [Asynchronous call] to run child process(sample.exe) through SHELL (MKS) and if sample.exe is problematic (having some problem). Return status should be -1 and then appropriate errno as per MSDN. But my case it returns 3864 and even GetLastError is 0 . I thought it would be PID of the created process but both Parent and Child process PID does not match with it.
Can you help me out whats going on.
My Code :-
int l_Sts = _spawnl(_P_NOWAIT,"Parent.exe","Parent.exe","Sample.exe","cmd data",NULL);
Parent.exe = "sh.exe" [MKS shell]
Sample.exe = normal console EXE
And in case of proper running child EXE, _spawnl returns 3836 again both EXE PID does not match with it.
Can any one suggest what should be solution for this....
Any Other API to run any Process through Parent EXE or shell.
- PAWAN
|
|
|
|
|
Member 4534982 wrote: But my case it returns 3864 and even GetLastError is 0 . I thought it would be PID of the created process
It should be a handle to the process.
Member 4534982 wrote: Any Other API to run any Process through Parent EXE or shell
How do I run another program from my program?[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
When i am executing _spawn API [Asynchronous call] to run child process(sample.exe) through SHELL (MKS) and if sample.exe is problematic (having some problem). Return status should be -1 and then appropriate errno as per MSDN. But my case it returns 3864 and even GetLastError is 0 . I thought it would be PID of the created process but both Parent and Child process PID does not match with it.
Can you help me out whats going on.
My Code :-
int l_Sts = _spawnl(_P_NOWAIT,"Parent.exe","Parent.exe","Sample.exe","cmd data",NULL);
Parent.exe = "sh.exe" [MKS shell]
Sample.exe = normal console EXE
And in case of proper running child EXE, _spawnl returns 3836 again both EXE PID does not match with it.
Can any one suggest what should be solution for this....
Any Other API to run any Process through Parent EXE or shell.
- PAWAN
|
|
|
|
|
Hi in my project there is a window where I have to embed a word application using OLE. It is fine for Internet explorer, but for Word rather embedding it is opening as a separate application. One thing if I use IWebBrowser2 to achieve it is fine, but there is a problem relating to history so I am trying to do it in this way.
The flow is as follows: The syntax is based on plain C.
CLSID idMsWord;
HRESULT hr;
IStorage *pStorage;
IOleObject *browserObject;
_IOleClientSiteEx *_iOleClientSiteEx;
hr = CLSIDFromProgID(L"word.document", &idMsWord);
hr = StgCreateStorageEx(NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_DIRECT | STGM_CREATE, STGFMT_DOCFILE, 0, NULL, 0, &IID_IStorage, (LPVOID*) &pStorage);
if (!OleCreate(&idMsWord, &IID_IOleObject, OLERENDER_DRAW, 0, (IOleClientSite *)_iOleClientSiteEx, (void**)pStorage, (void**)&browserObject))
{
GetClientRect(hwnd, &rect);
rect = *R;
// Let word object know that it is embedded in an OLE container.
if (!OleSetContainedObject((struct IUnknown *)browserObject, TRUE))
{
browserObject->lpVtbl->DoVerb(browserObject, OLEIVERB_INPLACEACTIVATE, NULL, (IOleClientSite *)_iOleClientSiteEx, -1, hwnd, &rect);
browserObject->lpVtbl->Release(browserObject);
}
}
_IOleClientSiteEx is the structure which holds IOleClientsite.
Now when DoVerb is beieng executed a new word application is being opened as a separate application rather as an embedded one.
Please help to resolve this issue as it is related to my project.
|
|
|
|
|
Here is an example, if that might help:
Using MS Office in an MFC application[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Thanks
As you look at my code there is no use of MFC class. So I have to achieve this without MFC class.
|
|
|
|
|
Yajnesh Naraya Behera wrote: So I have to achieve this without MFC class.
That must be a real pain. Good luck.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Yap it is really. Now I got some concept, I have to implement an OLECONTAINER to host MS Word, again from where I will get the interfaces for Word. In other way I can use all the proeprties & methods of MS Word using IDispatch, but what about other interfaces
IOleClientSite, IOleInPlaceFrame. All your sugestions valuable in this regard.
|
|
|
|