Problems with compiling ROOT standalone program on Ubuntu 12

Dear Root-experts and users,

I’ve encountered a problem while compiling stand alone program with ROOT libraries on Ubuntu 12.04(32bit)(ROOT version is 5.34/03). Compiller (g++ version 4.6.3) says:

and a lot of other undefined references related to ROOT objects.

For Scientific Linux 5 and Fedora 16 the same program was compiled successfully.

Command to compile is:

All pathes to headers and libraries are correct.

I’ve searched for same problems on the forum, but recommendations I’ve found does’nt help(everithing is 32-bit here, command line seems to be ok).

Can someone give any hints what I can try?

Thank you in advance.

root-config --cxx --cflags -o macro macro.cc root-config --libs

Thank you very much! This helps.
Please can you tell me in few words what the difference? Is order of parameters significant here?

The order matters, especially when it comes to any object files and libraries.