This issue was closed, but I have exactly the same problem.
I’m using a conda env with Geant4 v10.7.3.
I’m trying to compile with make the example B1 of the 10.7 release (here).
In my CMakeCache.txt in the build directory, I have
//The directory containing a CMake configuration file for Geant4.
Geant4_DIR:PATH=/uni-mainz.de/homes/cgirardc/.conda/envs/GEANTROOT/lib/Geant4-10.7.3
as expected.
Indication: when trying to compile the example B1 of the v11.1 release (here) in a conda env containing Geant4 v11.0.3, it worked perfectly, and an executable is linked.
(for those who ask, I have a reason for trying to compile with v10, even though v11 is working perfectly).
localscratch/girardcarillo/Workdir/Geant4/StartingKit/G4Examples_v10/examples/basic/B1/exampleB1.cc:59:22: error: 'UseBestUnit' is not a member of 'G4SteppingVerbose'
59 | G4SteppingVerbose::UseBestUnit(precision);
| ^~~~~~~~~~~
It therefore looks like you’re trying compile the example code written for Geant4 11 rather than the version for 10.7. How/where did you get the example code from?