Code:
#include <cstring>
using namespace std;
int main ()
{
char str1[]="Sample string";
char str2[40];
char str3[40];
strcpy (str2,str1);
strcpy (str3,"copy successful");
return 0;
}
if I open win32 project-> windows app.-> empty project and open a .cpp file and compile, it gives me this error:
error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRTD.lib
But if i did same settings for console app.It gives me only warning and working:
warning C4996: 'strcpy' was declared deprecated c9
What is happening here What is the differences between empty windows app. and emptry console app.How can i fix these warnings and errors .
I am using VS2005.
Thanks

Error in windows app. but not in console(same code)
Hadas
you said:"project settings->C/C++->Preprocessor->Preprocessor definitions->_CRT_SECURE_NO_DEPRECATE"
How do you know this I want to learn these details informations abut my compiler, my projects settings.Where must i look Can you advice me please some links or books.
Thanks again.
Good works...
Tejas_Kishanwala
I've never read a book about VS but I read a few tutorials about specific topics, so I can't recommend you a good book about VS.
About links, there's not one link that has all the info but when you need something reference, MSDN is a good start and google has it all ;)
SaurabhMehta
the linking error happens because the main function in a windows application is different than the one in a console application.
Console app:
int main(int argc, const char* argv[])
Windows app:
int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
The function strcpy has been marked as deprecated in Visual Studio 2005. Use the strcpy_s to avoid the warning or add this to project settings->C/C++->Preprocessor->Preprocessor definitions->_CRT_SECURE_NO_DEPRECATE