spritelab / 5GSniffer

33 stars 12 forks source link

Compiler Version Mismatch Due to Incorrect Path in CMake on Ubuntu 22 #8

Open ridwanultanvir opened 4 months ago

ridwanultanvir commented 4 months ago

Environment

Description

I am attempting to specify clang-14 and clang++-14 as my project's C and C++ compilers on Ubuntu 22. However, due to a mistake in the path specification, the expected compiler version is not being used.

Steps to Reproduce

  1. Initially set the environment variables to specify clang-14 and clang++14 (incorrect path) as the compilers:
    export CC=/usr/bin/clang-14
    export CXX=/usr/bin/clang++14
  2. Configure the project with CMake, using the same paths for the compilers:
    cmake -DCMAKE_C_COMPILER=/usr/bin/clang-14 -DCMAKE_CXX_COMPILER=/usr/bin/clang++14 ..
  3. Realize the mistake in the path for clang++-14 (it was mistakenly specified as clang++14), which might lead to an incorrect compiler version being used or a failure in locating the compiler.

Correct Steps (for clarity)

To rectify this, the correct steps should be:

   export CC=/usr/bin/clang-14
   export CXX=/usr/bin/clang++-14  # Corrected path

And then run CMake as:

   cmake -DCMAKE_C_COMPILER=/usr/bin/clang-14 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-14 ..

Expected Behavior

After correcting the path, the project should compile using clang-14 and clang++-14 as expected.

Additional Information

This issue is specifically noted on Ubuntu 22.