Fix build linking error (When ENABLE_SM2_Z256 is OFF) #1631
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
解决当ENABLE_SM2_Z256开关是关闭时,编译时会报错;
编译命令:
cmake .. -DCMAKE_C_STANDARD=99
make -j8
报错信息:
Linking C executable bin/gmssl
bin/libgmssl.so.3.1:对‘sm2_z256_modn_add’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_rand’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_one’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_inv’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_mul’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_order’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_to_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_print’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_is_zero’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_is_on_curve’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_cmp’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_add’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_to_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_mul_sum’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_mul’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_sub’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_modn_sub’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_from_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_mul_generator’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_from_bytes’未定义的引用
bin/libgmssl.so.3.1:对‘sm2_z256_point_get_xy’未定义的引用
collect2: 错误:ld 返回 1
make[2]: *** [CMakeFiles/gmssl-bin.dir/build.make:786:bin/gmssl] 错误 1
make[1]: *** [CMakeFiles/Makefile2:241:CMakeFiles/gmssl-bin.dir/all] 错误 2
make: *** [Makefile:166:all] 错误 2