C++ How to resolve linker error 2005

How to create strategies and indicators
Message
Author
idesmaster
Posts: 6
Joined: Tue May 14, 2013 9:25 am

C++ How to resolve linker error 2005

#1 Postby idesmaster » Wed Oct 16, 2013 7:46 pm

Dear All,

For you who need to separate definition and declaration from StrategyInterface.h and TechnicalFunctions.h files, attached are those files.

Background:
if you have a large project, you will notice that your own 2 or more .cpp cannot have #include to above headers, similar to problem below:

http://stackoverflow.com/questions/7560 ... mbol-error

Reason:
StrategyInterface.h and TechnicalFunctions.h files contains both declaration and definition. during compile it's fine, during linking you will busted.

Solution:
You need to keep declaration in .h files, and definition goes to new .cpp files. You have to separate declarations and definitions
I have attached the complete solutions.

Cheers,
Attachments
Multiple Symbol Solution.zip
Contain both StrategyInterface and TechnicalFunctions
(13.29 KiB) Downloaded 470 times
ehem..ehem...

FX Helper
Posts: 1479
Joined: Mon Apr 01, 2013 3:55 am

#2 Postby FX Helper » Thu Oct 17, 2013 9:53 am

Hello,

Thank you for your help.


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 10 guests