|
Hi, I am working with network simulator - 3, where the programming language is C++, I have created two nodes and sending data from server to client, its showing number of packets sent, but its not receiving, showing 0! bytes in client side.
Please help me if any one knows NS-3.
Thanking you...
|
|
|
|
|
It would appear you have a firewall blocking it.
Find out which port(s) you need to allow through.
|
|
|
|
|
Hi, I have written the code for Elliptic curve cryptography, its working fine in compilers like MS visual C++, Codelite. But its not building and compiling in G++ (Ubuntu 12.04). What might be the problem.
If any any one have the C++ code for ECC, please share it to my mail manoj.7390@gmail.com
Thanking you...
|
|
|
|
|
Manoj7390 wrote: What might be the problem. It could be anything, but you need to provide some more useful details, such as compiler error messages etc.
Use the best guess
|
|
|
|
|
I am getting lots of errors like this..
main.cpp:(.text+0x1a6): undefined reference to `std::cout
main.cpp:(.text+0x1ab): undefined reference to `std::basic_ostream<char, std::char_traits<char>
>& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
main.cpp:(.text+0x1ba): undefined reference to `std::cout
main.cpp:(.text+0x1bf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
main.cpp:(.text+0x1e1): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
main.cpp:(.text+0x1fe): undefined reference to `std::cout
main.cpp:(.text+0x203): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)
main.cpp:(.text+0x213): undefined reference to `std::cout
main.cpp:(.text+0x230): undefined reference to `std::cout
If it is not sufficient, i will send the whole code, i dont know how to attach the file here. Please give me your mail id, i will send you the code.
|
|
|
|
|
How do you invoke the C++ compiler (command line, please)?
You have to g++ (instead of gcc ), see, for instance here[^].
Veni, vidi, vici.
|
|
|
|
|
I am using CC - command for compiling, What is the command for g++
|
|
|
|
|
You are using the C compiler.
g++ is the command for invoking the C++ compiler, e.g.
g++ myapp.cpp -o myapp
If you are using a makefile, set CC=g++ .
Veni, vidi, vici.
|
|
|
|
|
Manoj7390 wrote: i will send you the code. No you won't. Just show us the first few lines of your source (where your #include statements are), and the lines that are producing the errors.
Use the best guess
|
|
|
|
|
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
#include <math.h>
Plenty of errors are coming, i couldn't figure it out.
But my question is same program is running in other compilers but why it is not running in g++.
Might be there is a small bug.
|
|
|
|
|
Manoj7390 wrote: Plenty of errors are coming, i couldn't figure it out. Like I said, show us the line of code and the error message; the first two or three should be enough.
Manoj7390 wrote: Might be there is a small bug. Most unlikely, it is much more likely that the compiler cannot find one of the include files, or there is some other setting specific to g++ that you need to add. I do not have a Linux system so cannot test this.
Use the best guess
|
|
|
|
|
Thanks.. I have got the output.. I was using CC instead of g++.
It works with g++
Thank you...
|
|
|
|
|
Hi. I have written the program for turbo encoder, for every single bit, it gives three bits as output and I am storing it as a integer. Now the problem is how to concatenate these bits in the integer form.
for example...
int u = 1; int p = 0; int q = 1;
Answer = 101;
|
|
|
|
|
int Answer = (u << 2) | (p << 1) | q
Use the best guess
|
|
|
|
|
I cannot use shifting here, because i am considering bits in the integer form. if i shift, data will change know.
Suggest any other way to store bits in C/C++
|
|
|
|
|
As stated, your sentence makes no sense. Please elaborate.
Veni, vidi, vici.
|
|
|
|
|
I am implementing turbo encoder, I will give some data as a input and i am converting it into the binary, since i don't know how to store and which data type for binary values, i have stored those binary values as integers only. Now i need to concatenate three bits at a time, I need only 1's and 0's not the integer values. If i shift these values i will get more than 1.
|
|
|
|
|
Manoj7390 wrote: If i shift these values i will get more than 1 Of course.
Now look at decimal case:
if you 'concatenate' the digits 1 ,5 ,7 then you get the number 157 that is no more in the 0-9 range.
An alternative would be using strings, that is, you concatenate the character representations of the digits into a string ('1' ', '5' , '7' => "157" ).
You may apply exactly the same argument to binary (that is base 2 ) digits: if you concatenate 1 ,0 ,0 you get the number 101 , that is decimal 5 , no more in the 0-1 range. The string concatenation method would give you "101" .
You may find interesting the std::bitset[^] class.
However it does not prevent you from gaining a proper understanding of numerical bases (see, for instance, Numeral System at Wikipedia[^]) and how numbers are stored in computers.
Veni, vidi, vici.
modified 30-May-13 5:30am.
|
|
|
|
|
Manoj7390 wrote: Suggest any other way to store bits in C/C++ This has nothing to do with C/C++, it's how computers work. If you will not use the shift operators to store the three bits together then you cannot store them.
Use the best guess
|
|
|
|
|
Richard MacCutchan wrote: If you will not use the shift operators to store the three bits together then you cannot store them.
int Answer = u * 4 + p * 2 + q
|
|
|
|
|
Which the compiler will almost certainly optimise into shift operations.
Use the best guess
|
|
|
|
|
possibly. but that extends the definition of "you" quite a bit.
int Answer = u + u + u + u + p + p + q;
|
|
|
|
|
Chris Losinger wrote: that extends the definition of "you" quite a bit.
Use the best guess
|
|
|
|
|
you originally wrote "If you will not use the shift operators to store the three bits together then you cannot store them."
that's the "you".
i think it's reasonable to differentiate between what the programmer writes and what the compiler does.
|
|
|
|
|
Sorry, but I don't understand what point you are trying to make.
Use the best guess
|
|
|
|