Relocation error

I have this code that I have run many times within the past few months without problems. However, today I get an error while running the program:

/home/gamma/root/bin/root.exe: relocation error: /home/gamma/data/data2/./spectrum_c.so: undefined symbol: gzopen

I know that someone else has been working on the computer between the time that the program worked and now, so it is possible that they changed some of the links. I have not changed the program at all between the last time it worked and now. Also, if I try to reload the program, I get the following error:

dlopen error: /home/gamma/data/./spectrum_c.so: undefined symbol: gzopen
Load Error: Failed to load Dynamic link library /home/gamma/data/./spectrum_c.so

but root still creates the .so file despite the errors. I really have no idea where to even start to fix this problem. I would appreciate it if someone could tell me what these errors mean.

Hi,

Apparently some of the library that you are relying on have been ‘updated’.
I am not sure which library ‘gzopen’ does belong to.
However recompiling from scratch might help. You might also need to get the information about what was changed on your system.

Cheers,
Philippe

Yes, and the problem is not just with root. I found out that I need the ‘-lz’ flag in order for it to compile in g++. How do I add this flag when compiling in root. Btw, my command line is “.L spectrum.c+”.

Hi,

Use gSystem->AddLinkedLibs(" -lz ");

Cheers,
Philippe.