I am trying to model a communication channel in c++. I am using Eclipse Galileo IDE. The code is given below
Expand|Select|Wrap|Line Numbers
- #include <itpp/base/vec.h>
- #include <itpp/itbase.h>
- #include <itpp/itcomm.h>
- using namespace itpp;
- using namespace std;
- using std::cout;
- using std::endl;
- template<class d>
- class itpp::Vec< d >;
- int main()
- {
- //Scalars
- int N;
- double N0;
- //Vectors
- itpp::bvec bits, dec_bits;
- itpp::vec symbols, rec;
- //Classes
- itpp::BPSK bpsk; //The BPSK modulator/demodulator class
- itpp::BERC berc; //The Bit Error Rate Counter class
- //Init
- N = 500000; //The number of bits to simulate
- N0 = 1; //0 dB SNR
- //Randomize the random number generator
- RNG_randomize();
- //Generate the bits:
- bits = randb(N);
- //Do the BPSK modulation
- bpsk.modulate_bits(bits, symbols);
- //Add the AWGN
- rec = symbols + sqrt(N0 / 2) * randn(N);
- //Decode the received bits
- bpsk.demodulate_bits(rec, dec_bits);
- //Count the number of errors
- berc.count(bits, dec_bits);
- //Print the results
- cout << "There were " << berc.get_errors() << " received bits in error." << endl;
- cout << "There were " << berc.get_corrects() << " correctly received bits." << endl;
- cout << "The error probability was " << berc.get_errorrate() << endl;
- cout << "The theoretical error probability is " << 0.5*erfc(1.0) << endl;
- //Exit program:
- return 0;
- }
../main.cpp:22:13: error: specialization of ‘template<class Num_T> class itpp::Vec’ in different namespace
/software/itpp-4.2.0_suse11_1/64/include/itpp/base/factory.h:41:29: error: from definition of ‘template<class Num_T> class itpp::Vec’
../main.cpp:22:13: error: partial specialization ‘itpp::Vec<T>’ does not specialize any template arguments
line 22 &23 : template<class d>
class itpp::Vec< d >;
you can find vec.h in the following link
http://itpp.sourceforge.net/current/...pp_1_1Vec.html
if I remove those lines it is giving many errors. undefined reference to itpp::vec<>...
Please suggest me what to do. How to compile in console (in linux, using gcc compiler) by specifying lib path