Collect2.exe: error: ld returned 116 exit status

I’m trying to test my code on native.

I worked when using g++ 8 but I upgraded to g++14 to be able to use C++17.

I get this error when running the test:

collect2.exe: error: ld returned 116 exit status
*** [.pio\build\native\program.exe] Error 1

Why does this happen?

Can you upload a minimal project with which this happens?