CString and console app.
-
I get linker errors when I try to do this, do I have to use a
#pragma
or something?#include <iostream.h>
#include <afx.h>int main()
{
CString c;return 0;
}
Error: --------------------Configuration: test - Win32 Debug-------------------- Linking... nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex Debug/test.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. test.exe - 3 error(s), 0 warning(s) Nick Parker
May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
-
I get linker errors when I try to do this, do I have to use a
#pragma
or something?#include <iostream.h>
#include <afx.h>int main()
{
CString c;return 0;
}
Error: --------------------Configuration: test - Win32 Debug-------------------- Linking... nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex Debug/test.exe : fatal error LNK1120: 2 unresolved externals Error executing link.exe. test.exe - 3 error(s), 0 warning(s) Nick Parker
May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
-
If you are using MS Visual Studio, go change your project setting to "Use MFC in a Shared DLL."
Boogie wrote: If you are using MS Visual Studio, go change your project setting to "Use MFC in a Shared DLL." Ah, that works fine, but is there a way to do this directly in code alone so the setting is still listed as "Not Using MFC"? Thanks for the response by the way. :) Nick Parker
May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
-
Boogie wrote: If you are using MS Visual Studio, go change your project setting to "Use MFC in a Shared DLL." Ah, that works fine, but is there a way to do this directly in code alone so the setting is still listed as "Not Using MFC"? Thanks for the response by the way. :) Nick Parker
May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
-
I am not sure about that. CString is a MFC class. That's the reason I ask you to change the project setting. Your other option is to use char type. Maybe someone else can help you. ;)
Boogie wrote: Your other option is to use char type. I know I can use other data types to do this, however I wanted to do this specifically with a
CString
. Thanks for the input. :) Nick Parker
May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
-
Boogie wrote: Your other option is to use char type. I know I can use other data types to do this, however I wanted to do this specifically with a
CString
. Thanks for the input. :) Nick Parker
May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
If you want to use CString but not MFC, I use the excellent CStdString[^] class which is an exact clone of CString but using stl. Cheers James
-
If you want to use CString but not MFC, I use the excellent CStdString[^] class which is an exact clone of CString but using stl. Cheers James
James Spibey wrote: which is an exact clone of CString but using stl. Thanks James, I will take a look at it today. :) Nick Parker
May your glass be ever full. May the roof over your head be always strong. And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing