473,405 Members | 2,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Help in c++, Using itpp library

Hi,

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
  1. #include <itpp/base/vec.h>
  2. #include <itpp/itbase.h>
  3. #include <itpp/itcomm.h>
  4.  
  5.  
  6.  
  7. using namespace itpp;
  8. using namespace std;
  9.  
  10. using std::cout;
  11. using std::endl;
  12.  
  13.  
  14. template<class d>
  15. class itpp::Vec< d >;
  16.  
  17.  
  18. int main()
  19. {
  20.   //Scalars
  21.   int N;
  22.   double N0;
  23.  
  24.   //Vectors
  25.   itpp::bvec bits, dec_bits;
  26.   itpp::vec symbols, rec;
  27.  
  28.   //Classes
  29.   itpp::BPSK bpsk;  //The BPSK modulator/demodulator class
  30.   itpp::BERC berc;  //The Bit Error Rate Counter class
  31.  
  32.   //Init
  33.   N = 500000; //The number of bits to simulate
  34.   N0 = 1;     //0 dB SNR
  35.  
  36.   //Randomize the random number generator
  37.   RNG_randomize();
  38.  
  39.   //Generate the bits:
  40.   bits = randb(N);
  41.  
  42.   //Do the BPSK modulation
  43.   bpsk.modulate_bits(bits, symbols);
  44.  
  45.   //Add the AWGN
  46.   rec = symbols + sqrt(N0 / 2) * randn(N);
  47.  
  48.   //Decode the received bits
  49.   bpsk.demodulate_bits(rec, dec_bits);
  50.  
  51.   //Count the number of errors
  52.   berc.count(bits, dec_bits);
  53.  
  54.   //Print the results
  55.   cout << "There were " << berc.get_errors() << " received bits in error." << endl;
  56.   cout << "There were " << berc.get_corrects() << " correctly received bits." << endl;
  57.   cout << "The error probability was " << berc.get_errorrate() << endl;
  58.   cout << "The theoretical error probability is " << 0.5*erfc(1.0) << endl;
  59.  
  60.   //Exit program:
  61.   return 0;
  62.  
  63. }
I am getting the following error
../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
Jan 25 '12 #1
1 3981
Banfa
9,065 Expert Mod 8TB
Lines 14 and 15 server no purpose and should be removed. Then post the errors you are getting so we can see what might be causing that
Jan 27 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Surendra | last post by:
Hi to all, Can any one of u solve my problem. How can i show a message box on client side using class library of .net it may be vb.net or c#.net. If any1 has any idea about it. Please let me...
0
by: Eniac | last post by:
Hello, I've started using Enterprise Library 2.0 recently and I've encountered a problem that seems to be ... well... undocumented :) Basically, when I set a Trace Listener (formatted event...
2
by: martoncho | last post by:
Hi all, I am facing what is for me a really complicated situation. I program C but not this advanced (I mean direct hardware access etc). Here is the background: I am using DJGPP. I am...
2
by: aarrojado | last post by:
I´m trying to implement Rijndael algorithm AES in C language using the library GMP. And it is dificult to start programming because it as been years i do not program in C. Well if there is anybody...
6
by: =?Utf-8?B?WW9naSBXYXRjaGVy?= | last post by:
Hello, I am using Visual Studio-2003. I created a project to build my library. Since I am using third party libraries as well, I have specified those additional library dependencies in project...
0
by: zeenets | last post by:
I am using Enterprise library v3.1 for developing a windows application. its working well. but there is a security issue, when i deploy this application on client machine the...
0
by: =?Utf-8?B?U2hyaWthbnQgTW9yZQ==?= | last post by:
Using enterprise library's 3.1 Logging Application Block , how can i get the custom source name in the windows event log.When ever i am logging an error in windows event log , it gives the source...
0
by: srizzler | last post by:
Hi All: I am trying to implement Exception Handling using Enterprise Library 3.1's Exception Handling Application Block as well as Logging Blocks. I have a windows application developed in...
38
by: neovantage | last post by:
Hey all, I want to get the DPI value of uploaded image. Is there any way to get the dpi value of an uploaded image using GD Library. Kindly help me out to sort out my problem as i will be very...
4
by: tvnaidu | last post by:
I created an executable using static library instead shared lib, I am running multipe instances of this executable, does it takes more memory with static library compare to shared library?. Does...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.