Generate a stand-alone program from a macro muons.c

hi
when i generate a stand-zlone program from the macro muons.c with code:

  g++ -o muons.exe muons.c `root-config --cflags --libs`.

But an error like this:

root [0] g++ -o; muons.exe; muons.c;`root-config --cflags --libs`
ROOT_prompt_0:1:28: error: expected expression
g++ -o; muons.exe; muons.c;`root-config --cflags --libs`

What i should do to correc that error?


ROOT Version (e.g. 6.10/08):


Why do you type the compilation directive at the root prompt ? You should simply execute muon.exe at the shell prompt. Something like:

$ g++ -o muons.exe muons.c `root-config --cflags --libs`.
$ ./muons.exe

thank you very much.I have tried what you said.Can you help me to solve this problem below?

g4root@debian:~$ g++ -o muons.exe muons.c`root-config --cflags --libs`
g++:error:muons.c-pthread:No such file or directory

Where should i put the muons.c file to?

You need a space character inside: ... muons.c `root-config ...

image

Try using the ā€œ/full/path/to/your/muons.cā€ file.

ok it works thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.