unresolved external symbol

hello,

I opened a second thread because this problem has nothing to do with the name of the topic of the other. I posted this also in Visual Studio C++ Express Edition because this problem might relate to the IDE.
I want to implement a simple c++ programm which has a header file and a implementation file.

the header file:

[code]
#include <iostream>

namespace main_savitch_2C
{
class statistician
{
public:
void next(double r);

private:
int count;
};
}
[/code]

and the implementation file which contains now only the definitions:
[code]
#include "stats.h"

using namespace main_savitch_2C;


void statistician::next(double r)
{

}
[/code]

But when I try to compile this very simple program, the following error occurs:

------ Build started: Project: Test, Configuration: Debug Win32 ------
Compiling...
statsimpl.cpp
Linking...
msvcrtd.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
C:\Dokumente und Einstellungen\Patrick\Eigene Dateien\Visual Studio 2005\Projects\Assignment4\Debug\Assignment4.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\Dokumente und Einstellungen\matti\Eigene Dateien\Visual Studio 2005\Projects\Assignment4\Assignment4\Debug\BuildLog.htm"
Assignment4 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I look for the error for many hours but I simply do not find how I can fix it :( Does anybody know here how I can fix this error :((

Regards



Answer this question

unresolved external symbol

  • BradO



    I have resolved this problem by adding a corresponding main.


  • unresolved external symbol