I get the following linker error when I try to print GaliosField elements in my code !.
Undefined symbols:
"galois::GaloisField::~GaloisField()", referenced from:
_main in TEST_7.o
_main in TEST_7.o
"galois::GaloisField::GaloisField(int, unsigned int const*)", referenced from:
_main in TEST_7.o
"galois::operator<<(std::basic_ostream<char, std::char_traits<char> >&, galois::GaloisField const&)", referenced from:
_main in TEST_7.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I have been searching through the internet for hours and have red lots of solutions but none of them works in this case. Indeed, I don’t know how to thank you if you solve this problem. The part of my code which is the cause of error is as follows :
Thanks Syuf, for your reply.
Well truly I am simulating a network on ns3. Thus, the other parts of this code is not relevant to this error. But Galois Field library is available in the link below :
Agree...As I downloaded the galios field project files, I put them in a directory and then entered that directory and wrote "make all" command in the terminal. Then there was no problem and I was able to see the output of all files by just opening the relevant makefile. But now in the simulation under ns3, we have a "scratch" folder and we ought to compile our .cc files with "./waf". Therefore, if you write "make all" in the terminal, gcc would tell you something like"there is nothing to make".
Do you have any idea for making/building galios field files in this case ?.
Dear hanst99,
Thank you very much for the link :-)
As I have explained to Syuf, I am simulating under ns3 and I haven't the same problem if I use the Galios Field library in a common c++ script.
Let me also tell you that I've got the same error on both mac os x and ubuntu.
I will be grateful if you help me in solving this problem,
A
Although I have understood what the linker is, I cannot understand what do you mean of linking to the galios library...would you mind explaining it more to me ?
You can think of a library as a big chunk of precompiled object code. Headers just provide the declarations for functions and datatypes and the like, the actual implementations are put in libraries. Check in your galios folder, somewhere there you should have a lib folder, there you should find one or multiple files with names like
libSOMETHING.a - to link this you have to provide the library path to your linker (on the command line you do this with -L*thepath*, if you use an IDE you can do this in your build options), and then link with -l*SOMETHING* -without the asterisks, and with actual names/paths of course.
Thank you again hanst99 and sorry for my delay :-).
As you mentioned there exist some declarations in the header files but, The implementations have been put in ".cpp" files. I haven't any file with .a extention. The library folder consists of the files below :
Thank you very much for taking the time and checking the galois library :-).
Truly I am not using Windows MinGW. I am using Mac OS X but as I mentioned before, I have the same problem on ubuntu. Perhaps the following report which I have written in respond to Syuf would be helpful. If it is not helpful, pardon me...
As I downloaded the galios field project files, I put them in a directory and then entered that directory and wrote "make all" command in the terminal. Then there was no problem and I was able to see the output of all files by just opening the relevant makefile. But now in the simulation under ns3, we have a "scratch" folder and we ought to compile our .cc files with "./waf". Therefore, if you enter scratch and write "make all" in the terminal, gcc would tell you something like "there is nothing to make".
My thanks :-).
I was able to create the libgalois.a in the way you taught me. But when I write -L*libgalois path* in the terminal with asterisks, it says "No such file or directory". If I write it without asterisks, it says "command not found". I have tested on both Mac OS X and ubuntu.
Maybe it is my fault or I am not careful about something.
I appreciate your helps up to now and look forward your new guidance :-).