Fix: GCC12 compiler errors
Fix GCC12 compiler errors. It should fix #37 (closed)
Merge request reports
Activity
mentioned in merge request !389 (merged)
Thanks for the fix. The fix works for the dynamic link. However, I got link error for static link when using with cmake command. Note that static link is a must in our testing environment.
cmake -DCMAKE_FIND_LIBRARY_SUFFIXES=".a" -DBUILD_SHARED_LIBS=OFF -DCMAKE_EXE_LINKER_FLAGS="-static" path
The link errors are as follows
/usr/bin/ld: attempted static link of dynamic object `/usr/lib/gcc/x86_64-linux-gnu/12/libgomp.so' collect2: error: ld returned 1 exit status make[2]: *** [source/App/SEIRemovalApp/CMakeFiles/SEIRemovalApp.dir/build.make:136: /usr/local/google/home/xlxiangli/program/g-ecm/bin/umake/gcc-12.2/x86_64/release/SEIRemovalApp] Error 1 make[1]: *** [CMakeFiles/Makefile2:576: source/App/SEIRemovalApp/CMakeFiles/SEIRemovalApp.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 90%] Built target DecoderAnalyserLib [ 91%] Linking CXX executable /usr/local/google/home/xlxiangli/program/g-ecm/bin/umake/gcc-12.2/x86_64/release/parcat /usr/bin/ld: attempted static link of dynamic object `/usr/lib/gcc/x86_64-linux-gnu/12/libgomp.so' collect2: error: ld returned 1 exit status make[2]: *** [source/App/Parcat/CMakeFiles/parcat.dir/build.make:104: /usr/local/google/home/xlxiangli/program/g-ecm/bin/umake/gcc-12.2/x86_64/release/parcat] Error 1 make[1]: *** [CMakeFiles/Makefile2:604: source/App/Parcat/CMakeFiles/parcat.dir/all] Error 2 [ 92%] Linking CXX static library /usr/local/google/home/xlxiangli/program/g-ecm/lib/umake/gcc-12.2/x86_64/release/libEncoderLib.a [ 92%] Linking CXX executable /usr/local/google/home/xlxiangli/program/g-ecm/bin/umake/gcc-12.2/x86_64/release/DecoderApp /usr/bin/ld: attempted static link of dynamic object `/usr/lib/gcc/x86_64-linux-gnu/12/libgomp.so' collect2: error: ld returned 1 exit status make[2]: *** [source/App/DecoderApp/CMakeFiles/DecoderApp.dir/build.make:136: /usr/local/google/home/xlxiangli/program/g-ecm/bin/umake/gcc-12.2/x86_64/release/DecoderApp] Error 1 make[1]: *** [CMakeFiles/Makefile2:519: source/App/DecoderApp/CMakeFiles/DecoderApp.dir/all] Error 2 [ 92%] Built target EncoderLib make: *** [Makefile:91: all] Error 2
It is interesting that I had the above link errors for VTM11ECM8 only, not for ECM, not for VTM. I have not figured what was wrong.
Edited by Xiang Limentioned in commit 38ee02f1
Please register or sign in to reply