Amber-MD / cpptraj

Biomolecular simulation trajectory/data analysis.
Other
138 stars 64 forks source link

clang 15.0.7: testp.cpp:2:14: error: use of undeclared identifier 'printf' #1087

Closed hainm closed 5 months ago

hainm commented 5 months ago

Hi, I am getting error below if using clang 15.0.7 in my mac

clang version 15.0.7
Target: x86_64-apple-darwin23.3.0
Thread model: posix
InstalledDir: /Users/nguyen/miniforge3/envs/py3.11/bin
 $ bash configure -shared -macAccelerate -noarpack   -nosanderlib clang
  arpack disabled.
  sanderlib disabled.

  Testing C++ compiler: 
Error: Test compile failed: clang++  -Wall  -O3  -fPIC   -o testp testp.cpp     
Error: Check the output below for error messages:
testp.cpp:2:14: error: use of undeclared identifier 'printf'
int main() { printf("Testing\n"); return 0; }
             ^
1 error generated.

NOTE

I installed clang via conda

conda install clang -c conda-forge
hainm commented 5 months ago

I've just wiped my miniconda install and reinstall. That helps. weird.

drroe commented 5 months ago

Another similar error in another package was also solved by a reinstall, so it seems problems can occasionally happen on the conda side: https://github.com/niosus/EasyClangComplete/issues/349

hainm commented 5 months ago

thanks Dan.