-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link errors #672
Comments
Full process of building: http://sprunge.us/gJ8adS |
I've builded and installed ittapi manually and in my case these changes helped to successfully build the sdk: diff --git a/devicedefender/CMakeLists.txt b/devicedefender/CMakeLists.txt
index 4040ca7..62161ac 100644
--- a/devicedefender/CMakeLists.txt
+++ b/devicedefender/CMakeLists.txt
@@ -101,7 +101,7 @@ if (BUILD_DEPS)
endif()
endif()
-target_link_libraries(IotDeviceDefender-cpp IotDeviceCommon-cpp)
+target_link_libraries(IotDeviceDefender-cpp IotDeviceCommon-cpp /usr/local/lib/libittnotify.a)
install(FILES ${AWS_IOTDEVICEDEFENDER_HEADERS} DESTINATION "include/aws/iotdevicedefender/" COMPONENT Development)
diff --git a/eventstream_rpc/CMakeLists.txt b/eventstream_rpc/CMakeLists.txt
index 5e5aa13..1e41fd5 100644
--- a/eventstream_rpc/CMakeLists.txt
+++ b/eventstream_rpc/CMakeLists.txt
@@ -98,7 +98,7 @@ if (NOT IS_SUBDIRECTORY_INCLUDE)
endif()
-target_link_libraries(EventstreamRpc-cpp ${DEP_AWS_LIBS})
+target_link_libraries(EventstreamRpc-cpp ${DEP_AWS_LIBS} /usr/local/lib/libittnotify.a)
install(FILES ${AWS_EVENTSTREAMRPC_HEADERS} DESTINATION "include/aws/eventstreamrpc/" COMPONENT Development) |
I'm glad you were able to get this working for your environment. Are you running into any other build issues? |
Thank you for quick response. That was the only issue. |
This should be investigated further. A user needing to patch the source tree isn't a situation we want to be in. |
Also in mqtt5 pubsub example was that problem. diff --git a/devicedefender/CMakeLists.txt b/devicedefender/CMakeLists.txt
index 4040ca7..62161ac 100644
--- a/devicedefender/CMakeLists.txt
+++ b/devicedefender/CMakeLists.txt
@@ -101,7 +101,7 @@ if (BUILD_DEPS)
endif()
endif()
-target_link_libraries(IotDeviceDefender-cpp IotDeviceCommon-cpp)
+target_link_libraries(IotDeviceDefender-cpp IotDeviceCommon-cpp /usr/local/lib/libittnotify.a)
install(FILES ${AWS_IOTDEVICEDEFENDER_HEADERS} DESTINATION "include/aws/iotdevicedefender/" COMPONENT Development)
diff --git a/eventstream_rpc/CMakeLists.txt b/eventstream_rpc/CMakeLists.txt
index 5e5aa13..1e41fd5 100644
--- a/eventstream_rpc/CMakeLists.txt
+++ b/eventstream_rpc/CMakeLists.txt
@@ -98,7 +98,7 @@ if (NOT IS_SUBDIRECTORY_INCLUDE)
endif()
-target_link_libraries(EventstreamRpc-cpp ${DEP_AWS_LIBS})
+target_link_libraries(EventstreamRpc-cpp ${DEP_AWS_LIBS} /usr/local/lib/libittnotify.a)
install(FILES ${AWS_EVENTSTREAMRPC_HEADERS} DESTINATION "include/aws/eventstreamrpc/" COMPONENT Development)
diff --git a/samples/mqtt5/mqtt5_pubsub/CMakeLists.txt b/samples/mqtt5/mqtt5_pubsub/CMakeLists.txt
index b2d6dda..5fd9912 100644
--- a/samples/mqtt5/mqtt5_pubsub/CMakeLists.txt
+++ b/samples/mqtt5/mqtt5_pubsub/CMakeLists.txt
@@ -22,4 +22,4 @@ endif ()
find_package(aws-crt-cpp REQUIRED)
-target_link_libraries(${PROJECT_NAME} AWS::aws-crt-cpp)
+target_link_libraries(${PROJECT_NAME} AWS::aws-crt-cpp /usr/local/lib/libittnotify.a) |
I build the sdk with -DBUILD_SHARED_LIBS=ON flag and I get libaws-c-iot.so.0unstable, libaws-c-s3.so.0unstable files in the lib folder. Then when I link the sdk to my project, compile and run, I get runtime errors related to that files. In whole Arch+BlackArch package repos only in AWS sdk appear files like that:
|
The itt related error happens in samples as well. Currently this command helps to fix the problem and build the sdk and the samples (when ittapi library is located at /usr/local/lib/libittnotify.a): rg --files | rg CMakeLists | xargs sed 's#\(target_link_libraries(.*\))$#\1 /usr/local/lib/libittnotify.a)#' -i |
I am not able to repro this using a container based on archlinux:latest. If you can attach (as a file/download) the output you get from the initial cmake invocation with |
Output of cmake -DCMAKE_INSTALL_PREFIX=/home/gaspar/.local/tmp/sdk-workspace/aws-iot-device-sdk-cpp-v2 -DCMAKE_BUILD_TYPE=Debug --trace-expand ../aws-iot-device-sdk-cpp-v2: http://sprunge.us/ITCsgN |
You appear to have a much older version of the library's cmake files installed in /lib but are building with newer submodules that expect that option to exist (and be off by default). In the output I see:
but the current version of AwsCFlags.cmake (which is in the submodules and linked above) is
|
I've installed some other aws libraries with package manager before building this sdk. After uninstalling that packages this sdk compiles without any errors. |
|
Describe the bug
Compiling sdk (as specified in README) on ArchLinux I'm getting these errors:
Full log: http://sprunge.us/INMUSM
Expected Behavior
To be able to compile the sdk.
Current Behavior
I can't compile sdk because of link errors.
Reproduction Steps
Get a working ArchLinux environment and follow the steps in readme.
Possible Solution
Link ittapi.
Additional Information/Context
No response
SDK version used
current 'main' branch
Environment details (OS name and version, etc.)
Linux odyssey 6.6.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 21 Dec 2023 19:01:01 +0000 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: