FreeBSD 0 Posted May 26, 2023 Share Posted May 26, 2023 (edited) in the C/C++ compiler option in Makefile, what's really the difference between specifying clang++, or clang++-devel as the compiler? Aren't they the same thing (both are C++ compilers)? Also, side question, when compiling thelibcore, which is strictly a C program, doesn't it make more sense to use clang or clang-devel as the compiler, not clang++, not clang++-devel? And why is it when i try to do that, it raises syntax errors like missing brackets? Edited May 26, 2023 by FreeBSD Link to comment Share on other sites More sharing options...
Silver Sonitex 1444 Posted May 26, 2023 Silver Share Posted May 26, 2023 The difference between clang++ and clang++-devel lies in the version of the Clang compiler being used. Both are C++ compilers provided by the Clang project, but clang++-devel typically refers to the development version or a specific version of the Clang compiler. The specific differences between the two can vary depending on the context and the versions installed on your system. Regarding your side question, if thelibcore is strictly a C program, it is generally more appropriate to use a C compiler such as clang or gcc rather than a C++ compiler like clang++. Using a C++ compiler for a C program can lead to syntax errors or unexpected behavior, as C++ and C have slight differences in syntax and language features. Make sure that your Makefile is set up to use a C compiler (e.g., CC = clang or CC = gcc) instead of a C++ compiler. If you are encountering syntax errors or missing brackets when switching to a C compiler, it could be due to subtle differences between the C and C++ languages. Make sure that your code follows the C syntax and conventions and does not rely on C++-specific features. Additionally, ensure that your Makefile and build system are correctly configured to use a C compiler and include the necessary header files and libraries for C code. This was totally not generated by GPT. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now