Help: error LNK2019: unresolved external symbol

I had the program in a single cpp file and have moved at the functions to seperate cpp's. Since doing that I received the following error when compiling the code. Any ideas on how to resolve that?

Generating Code...
Linking...
mkMainC.obj : error LNK2019: unresolved external symbol "void __cdecl mainEvent(enum PSH_Event,union PSH_EventIncoming *,void *)" (?mainEvent@@YAXW4PSH_Event@@PATPSH_EventIncoming@@PAX@Z) referenced in function _main
mkMainC.obj : error LNK2019: unresolved external symbol "long __cdecl listHandle(struct PSH_Connection *,enum PSH_Action,union PSH_MessageIncoming,void *)" (?listHandle@@YAJPAUPSH_Connection@@W4PSH_Action@@TPSH_MessageIncoming@@PAX@Z) referenced in function _main
QuoteHandlers.obj : error LNK2019: unresolved external symbol "void __cdecl UpdateTSFinvisionInfo(char *,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,double,double)" (?UpdateTSFinvisionInfo@@YAXPADV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@NN@Z) referenced in function "void __cdecl FinvisionRecordHandle(struct PSH_SupplyObject *,void *)" (?FinvisionRecordHandle@@YAXPAUPSH_SupplyObject@@PAX@Z)
C:\SourceSafe Projects\Market View\BBTV2\Debug\BBTV2.exe : fatal error LNK1120: 3 unresolved externals

Many Thanks,

Josh
supersuny2kAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Infinity08Commented:
Did you add al lfiles to one project, and then rebuild the project ?

Did you include the correct header files ?

Can you show the code ? (All files preferrably)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
evilrixSenior Software Engineer (Avast)Commented:
When you moved the functions to new files did you ensure you added these files to the project so they get compiled and the resultant translation units get linked into the final binary?
0
Infinity08Commented:
al lfiles -> all files of course ;)
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

supersuny2kAuthor Commented:
Hi, Yes all files are under one project in VS 2005 and I have included all the header files.

Interestingly, if I remove the calls in the main() and one of the function which are listed in the error, the project complies

.
0
Infinity08Commented:
>> Interestingly, if I remove the calls in the main() and one of the function which are listed in the error, the project complies

That's normal ;) If you removed the unresolved symbol, the linker doesn't have to look for it ... So, it doesn't throw the error either.

Can you show all your files ?
0
supersuny2kAuthor Commented:
Unfortunately, I can't but I have noticed something, if I change the functions or handlers to static if resolves the issue but cause other functions to have the same error.

Regards,

Josh
0
Infinity08Commented:
>> Unfortunately, I can't

Why is that ?

Can you at least post the relevant parts of the code. The part of the main where the function is called, the part of the header file where the function is declared, the part of the .cpp file where the function is defined, as well as the header include at the top of the main.cpp file.
0
supersuny2kAuthor Commented:
Hi Infinity, I have fixed it I removed static from all the function names and it has worked....
0
Infinity08Commented:
We could have told you that if we would have known what code you used ;) We're not clairvoyant heh.
0
Infinity08Commented:
Can you still post the code I asked for to verify that the solution is good ?
0
evilrixSenior Software Engineer (Avast)Commented:
>> I removed static from all the function names and it has worked
Note: The use of static in this context is considered deprecated, prefer to use unnamed namespace.
http://msdn2.microsoft.com/en-us/library/yct4x9k5.aspx
0
evilrixSenior Software Engineer (Avast)Commented:
The selected answer doesn't answer the question!
0
supersuny2kAuthor Commented:
Ooops... sorry select the wrong answer... my apologies - suppose to choose

"Did you add al lfiles to one project, and then rebuild the project ?

Did you include the correct header files ?"

as I was missing my header files in the end

Regards,
Josh
0
evilrixSenior Software Engineer (Avast)Commented:
Cheers KB.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.