fix build error on Linux

This commit is contained in:
2025-07-17 21:39:55 +08:00
parent bb4071ea04
commit 882ac55f7f
6 changed files with 6 additions and 4 deletions

View File

@@ -26,6 +26,7 @@ if (UNIX)
add_link_options( add_link_options(
-fsanitize=address -fsanitize=address
-fsanitize=undefined -fsanitize=undefined
-lm
) )
endif () endif ()

View File

@@ -1,7 +1,7 @@
// //
// Created by xfj12 on 2025/4/14. // Created by xfj12 on 2025/4/14.
// //
#include <math.h> #include <stdlib.h>
#include <solution/1534.h> #include <solution/1534.h>
int countGoodTriplets(int *arr, int arrSize, int a, int b, int c) int countGoodTriplets(int *arr, int arrSize, int a, int b, int c)
{ {

View File

@@ -2,7 +2,7 @@
// Created by xfj12 on 2025/3/24. // Created by xfj12 on 2025/3/24.
// //
#include <assert.h> #include <assert.h>
#include <math.h> #include <stdlib.h>
#include <stdbool.h> #include <stdbool.h>
bool containsNearbyDuplicate(int *nums, int numsSize, int k) bool containsNearbyDuplicate(int *nums, int numsSize, int k)

View File

@@ -1,5 +1,5 @@
#include <assert.h> #include <assert.h>
#include <math.h> #include <stdlib.h>
#include <string.h> #include <string.h>
// //
// Created by xfj12 on 2025/3/24. // Created by xfj12 on 2025/3/24.

View File

@@ -1,3 +1,4 @@
#include <climits>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <solution/326.h> #include <solution/326.h>

View File

@@ -1,8 +1,8 @@
// //
// Created by xfj12 on 2025/3/25. // Created by xfj12 on 2025/3/25.
// //
#include <climits>
#include <gtest/gtest.h> #include <gtest/gtest.h>
#include <queue>
#include <solution/lcp_67.h> #include <solution/lcp_67.h>
bool areTreesEqual(TreeNode *t1, TreeNode *t2) bool areTreesEqual(TreeNode *t1, TreeNode *t2)