View previous topic :: View next topic |
Author |
Chapter 2 |
Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Sat Apr 06, 2013 5:30 pm Post subject: |
|
|
Dear Professor Duffy,
I'm a beginner student of programming and also now of financial modelling.
I bought your book Introduction to C++ for Financial Engineers-2006.
Congratulations it a very special.
But i found an difficulty in page 18, line 38, the VC++ not compiled.
where is ..."if (c == "a")... I changed to : if (c == 'a')
Best regards,
//
DD
Thanks, you are correct, but the copy editor at the publisher changed 'c' to "c".
BTW have you run the code? There it is correct. |
|
Back to top |
|
|
Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Thu Jan 31, 2013 6:19 pm Post subject: |
|
|
Ah! add Datasim.cpp in project!!! and rebuild
See this Example
http://www.datasim.nl/Education/Videos/MyFirstProject/ |
|
Back to top |
|
|
yuyu282
Joined: 24 Jan 2013
Posts: 2
|
Posted: Fri Jan 25, 2013 12:03 pm Post subject: |
|
|
Cuchulainn wrote: |
Did you do a full search of the CD?
BTW the .cpp files should be added to the project. |
Thanks for reply. I have all chapters and VS2005Projects folder, but Utilities.
I still can't figure out the problem. I have attached a screenshot of my project, please have a look.
Thanks.
Description: |
screenshot for the project in VC2012 |
|
Filesize: |
291.76 KB |
Viewed: |
3936 Time(s) |
|
|
|
Back to top |
|
|
Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Thu Jan 24, 2013 2:20 pm Post subject: |
|
|
Did you do a full search of the CD?
BTW the .cpp files should be added to the project. |
|
Back to top |
|
|
yuyu282
Joined: 24 Jan 2013
Posts: 2
|
Posted: Thu Jan 24, 2013 11:27 am Post subject: 2.4 code problem |
|
|
Hello, when implementing the codes in VC 2012, I encoutered the following error:
1>------ Build started: Project: HK, Configuration: Debug Win32 ------
1>Person.obj : error LNK2019: unresolved external symbol "public: __thiscall DatasimDate::DatasimDate(void)" (??0DatasimDate@@QAE@XZ) referenced in function "public: __thiscall Person::Person(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class DatasimDate const &)" (??0Person@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVDatasimDate@@@Z)
1>Person.obj : error LNK2019: unresolved external symbol "public: class DatasimDate & __thiscall DatasimDate::operator=(class DatasimDate const &)" (??4DatasimDate@@QAEAAV0@ABV0@@Z) referenced in function "public: __thiscall Person::Person(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class DatasimDate const &)" (??0Person@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABVDatasimDate@@@Z)
1>Person.obj : error LNK2019: unresolved external symbol "public: long __thiscall DatasimDate::operator-(class DatasimDate const &)const " (??GDatasimDate@@QBEJABV0@@Z) referenced in function "public: int __thiscall Person::age(void)const " (?age@Person@@QBEHXZ)
1>Person.obj : error LNK2019: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class DatasimDate const &)" (??6@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV01@ABVDatasimDate@@@Z) referenced in function "public: void __thiscall Person::print(void)const " (?print@Person@@QBEXXZ)
1>TestPerson.obj : error LNK2019: unresolved external symbol "public: __thiscall DatasimDate::DatasimDate(int,int,int)" (??0DatasimDate@@QAE@HHH@Z) referenced in function _main
1>C:\Users\asus\documents\visual studio 2012\Projects\HK\Debug\HK.exe : fatal error LNK1120: 5 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
There is no Utilities folder in my CD, so I have downloaded your DatasimDate.hpp and TemporalType.hpp from Google search. Other codes I used were all from CD chapter 2 folder.
Thanks. |
|
Back to top |
|
|
Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Tue May 03, 2011 11:07 am Post subject: |
|
|
Hello, a code (datasimdate.hpp ) in 2.4 and 9.8.1 is missing from CD-ROM. Could you tell us where we could find it?
It's on the CD, directory Utilities. |
|
Back to top |
|
|
Ricky
Joined: 26 Apr 2011
Posts: 1
|
Posted: Thu Apr 28, 2011 8:23 am Post subject: |
|
|
Hello, a code (datasimdate.hpp ) in 2.4 and 9.8.1 is missing from CD-ROM. Could you tell us where we could find it? |
|
Back to top |
|
|
Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Wed Aug 20, 2008 3:49 pm Post subject: |
|
|
This is a screen shot video (no audio in this case) CLICK in URL below
This SCV (screen capture video) is to define and run a project in Visual Studio based on the theory of Chapter 2 and exercise 1.
Directories:
C:\daniel\DistanceLearning\Code (where I defined the project)
C:\CPP2006\Chapter2 (necessary source code)
Things to note:
1. Defining additional include directories
2. Placing source code files in the project
3. Compiler and linker errors and how we resolved them
The example code is fairly trivial but the point is getting a project up and running.
My First C++ project (Screen Capture Video)
http://www.datasim.nl/Education/Videos/MyFirstProject/ |
|
Back to top |
|
|
Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Thu Jan 10, 2008 10:11 pm Post subject: |
|
|
Build a project 101
You have not answered my question to help you ! Here again
// can you help me concerning my current problem of
Which testprogram on chapter 15 are you trying to run And i need the __precise__ error messages in your project (e.g file not found, Unresolved etc. etc.)
Anyway, do EXACTLY the following:
1. make c:\cpp2006
2. xcopy the CD files to the dir in 1.
3. Now there are ready-to-run projects on C:\cpp2006\VSProjects
and
4. Do you understand chapter 2 (what do the compiler and linker do)
regards |
|
Back to top |
|
|
Cuchulainn
Joined: 18 Dec 2006
Posts: 607
Location: Amsterdam, the Netherlands
|
Posted: Mon Mar 12, 2007 8:59 am Post subject: Chapter 2 |
|
|
Exercises and Answers |
|
Back to top |
|
|
|