I realize this post is now quite old but I just ran into this issue today. I typically don’t use TApplication but rather compile in the portions of ROOT that I need one by one and try to use them in a self-contained way. Anyway the mentioned error was coming up and I was able to get rid of it without (apparently) loosing any functionality by switching:
“root-config --cflags --glibs”
to:
“root-config --cflags --libs”
in my makefile. I don’t know if this is the proper way to proceed but it seems to be working so far. The only difference is the -lGui flag. In my program I don’t ever need a graphical interface so this seemed to work here. On the other hand I suppose for the case above if you need to switch from graphical output to batch mode without re-compile, this won’t work.
I guess I posted this for the benefit of someone having my (simpler) problem who comes about this post via a search.