Edit: I think I will implement my own Sobol and/or maybe Halton generator with the help of the book I was told about below. I may not use the implementation I was trying to use. Still it would be good to know the answer to how to tell the linker to look at a(n external) .dll file.
C++ Beginner.
I need Sobol numbers as a minor part in a larger project.
Using an implementation that depends on other libraries that I may have to install/compile makes the number of things I would need to learn and I don't know even larger.
I found this (http://www.broda.co.uk/dl/download.php?f=b0d0839560fd157a3a6fb15cbf2bfc99) implementation of Sobol numbers. The fact that it has a dll (which I am guessing is a compiled library) makes me think that it is probably independent.
I took the contents of their main() in the main.cpp and put it in my main() of a console application. Took also the directives (!?)
#include "sobolseq51.h"
#define n_dimension 1
and put them in my console application outside the main().
Put the other files
SobolSeq51.dll
sobolseq51.H
SobolSeq51.lib
in my console application directory so that they are visible by the rest of the project.
Compiled and got
1>------ Build started: Project: ConsoleApplicationProject4, Configuration: Debug Win32 ------
1> ConsoleApplicationProject4.cpp
1>ConsoleApplicationProject4.obj : error LNK2019: unresolved external symbol "int __cdecl SobolSeq51(long,int,double *)" (?SobolSeq51@@YAHJHPAN@Z) referenced in function _wmain
1>C:\Users\Franklin\Documents\WORK\FinantialMathematics\FinancialC++\Project4\ConsoleApplicationProject4\Debug\ConsoleApplicationProject4.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
The code inside their main() is
long i_SobolSeq51 = 1;
int n_total = 64; // Total number of points
double SobolSeqVector[n_dimension];
cout << "Sobol' sequense for n=" << n_dimension << endl;
for (int i = 1; i <= n_total; i++)
{
SobolSeq51(i_SobolSeq51++, n_dimension, SobolSeqVector); cout << " SobolSeq51[" << i << "]=" << SobolSeqVector[0] << endl;
}
return 0;