Extended character is not valid in an identifier

Describe the bug

Just posting this for help for potential users encountering this issue in the future.

At some point, we were unable to run a script with the “+” compilation, ie root -l test.cpp worked, but root -l test.cpp+ failed with the following cryptic error message:

root -l test.cpp+(\"e\")
root [0] 
Processing test.cpp+("e")...
Info in <TUnixSystem::ACLiC>: creating shared library /tmp/          /tmp//tmp/./test_cpp.so
/tmp/          /tmp//tmp/test_cpp_ACLiC_dict.cxx:3:32: error: extended character   is not valid in an identifier
    3 | #define R__DICTIONARY_FILENAME dItmpdI sP sP sP dItmpdIdItmpdItest_cpp_ACLiC_dict
      |                                ^
/tmp/          /tmp//tmp/test_cpp_ACLiC_dict.cxx:3:32: error: extended character   is not valid in an identifier

Finally, we figured out that there was some kind of non-standard tab or space symbol within .rootrc’s ACLiC.BuildDir, after copying from an html file to “nano” or something like that. Removing all characters before the path and putting a new space solved the issue.

To Reproduce

Add a character such as to ~/.rootrc after ACLiC.BuildDir:

Setup

ROOT v6.32.04
Built for linuxx8664gcc on Aug 14 2024, 04:13:21
From tags/v6-32-04@v6-32-04
With c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Binary directory: /opt/root/bin

Additional context

https://community.arm.com/support-forums/f/compilers-and-libraries-forum/55354/error-extended-character-2-is-not-valid-in-an-identifier

Dear @ferhue ,

Thanks for the post - this is indeed a useful reference.
On our side, we’ll try to deal with these special characters, e.g. replacing them with simple ones.

Cheers,
D

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