Seg fault with static TF1


I have static TF1 object in my code,
and looks it causes the program to segmentate.

I just wrote simple example demonstrating that problem.
Note that these codes work well in my local computer, but the problem appears
on University computers (gcc version 4.1.2, and root version 5.34/21)
I compile using the following 3 commands:

It compiles without errors.

codes are below

The header file test_class.h

#include <TF1.h>

class test_class
  static TF1 f_lin1;  


the cc file

#include <TF1.h>
#include "test_class.h"

#include <iostream>

using namespace std;

TF1 test_class::f_lin1 = TF1("f_lin1", "[0] + [1]*x", -45., 45.);


The main file

#include "test_class.h"

int main()
  test_class t;

  return 0;



all seems fine also on OSx 10.10, root5 and root6.
There is the possibility that the error is related to a misconfiguration of the system.

Try to modify your “” file:
TF1 test_class::f_lin1(“f_lin1”, “[0] + [1]*x”, -45., 45.);

The commands you show create a “” file, but the linker needs a “” file. Can it be that you have some old “” file around which is not a symbolic link to your “”?

Thank you for your answers,

I tried TF1 test_class::f_lin1(“f_lin1”, “[0] + [1]*x”, -45., 45.);
it segmentated again.

About the linking of, yes
I have a link pointing to,
so I think this is also ok.

I ran it with valgrind,
and it gives
“Invalid read of size 8”
TFormula::Analyze(char const*, int&, int)

I have no experience with valgrind, I put the output of it, just thought that
it might give you some hint

Well, maybe you could try the newest ROOT v5-34-25 (or the head of v5-34-00-patches branch).

Tried the newst v5-34-25, but again the same thing.