364,036 Members | 5273 Browsing Online
Community for Developers & IT Professionals
Bytes IT Community

1>c:\documents and settings\wigundlach\my documents\visual studio 2010\Projects\count

Phillis2013
P: 14
how do i fix this
here is all my code from my header file and cpp file
#include "Counter.h"
#include<iostream>
using namespace std;

Counter::Counter(int c)
{
Add = 1;
Total += Add+Add;
cout << "your number is "<< Total << " enjoy." <<endl;


}


Counter::~Counter(void)
{

}
__________________________________________________ _______
#pragma once
class Counter
{
int Total;
int Add;
public:
Counter(int c);
~Counter(void);
};

__________________________________________________ _______
and this is the errors i keep getting
1>------ Build started: Project: counter, Configuration: Debug Win32 ------
1> Counter.cpp
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>c:\documents and settings\wigundlach\my documents\visual studio 2010\Projects\counter\Debug\counter.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

please help
Jan 31 '12 #1

✓ answered by weaknessforcats

Where is your main()?

I suggest you add a separate .cpp file to your project that has your main().
Share this Question
Share on Google+
3 Replies


weaknessforcats
Expert Mod 5K+
P: 6,770
Where is your main()?

I suggest you add a separate .cpp file to your project that has your main().
Jan 31 '12 #2

Phillis2013
P: 14
Ok thanks I am new to c++ and this is my first project not using a tutorial
Feb 1 '12 #3

weaknessforcats
Expert Mod 5K+
P: 6,770
Glad to help out. We have all been where you are.
Feb 1 '12 #4

Post your reply

Help answer this question



Didn't find the answer to your C / C++ question?

You can also browse similar questions: C / C++ c++