Skip to content
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

Now able to build cmake --build . --target aws-iot-device-client #486

Closed
sausinx opened this issue Dec 18, 2024 · 2 comments
Closed

Now able to build cmake --build . --target aws-iot-device-client #486

sausinx opened this issue Dec 18, 2024 · 2 comments
Assignees

Comments

@sausinx
Copy link

sausinx commented Dec 18, 2024

While executing cmake --build . --target aws-iot-device-client

[ 97%] Building CXX object CMakeFiles/aws-iot-device-client.dir/source/jobs/JobEngine.cpp.o
/home/ubuntu/aws-iot-device-client/source/jobs/JobEngine.cpp: In member function ‘virtual void Aws::Iot::DeviceClient::Jobs::JobEngine::processCmdOutput(int, bool, int)’:
/home/ubuntu/aws-iot-device-client/source/jobs/JobEngine.cpp:29:39: error: ignoring attributes on template argument ‘int ()(FILE)’ [-Werror=ignored-attribute]
29 | unique_ptr<FILE, decltype(&fclose)> pipe(fdopen(fd, "r"), &fclose);
| ^
cc1plus: all warnings being treated as errors
gmake[3]: *** [CMakeFiles/aws-iot-device-client.dir/build.make:384: CMakeFiles/aws-iot-device-client.dir/source/jobs/JobEngine.cpp.o] Error 1
gmake[2]: *** [CMakeFiles/Makefile2:696: CMakeFiles/aws-iot-device-client.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:703: CMakeFiles/aws-iot-device-client.dir/rule] Error 2
gmake: *** [Makefile:169: aws-iot-device-client] Error 2

Distributor ID: Ubuntu
Description: Ubuntu 24.04.1 LTS
Release: 24.04
Codename: noble

@ig15
Copy link
Contributor

ig15 commented Dec 24, 2024

Hi @sausinx . The issue seems to be that the compiler is ignoring the attributes on the template argument int ()(FILE), which is the type of the fclose function. This is likely due to a bug or limitation in the compiler.
To resolve this issue, you can disable the specific warning that is causing the error. Do the following:

  • 
In your CMakeLists.txt file, add the following line to disable the warning:

    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ignored-attributes")

@ig15 ig15 self-assigned this Dec 26, 2024
@ig15
Copy link
Contributor

ig15 commented Dec 30, 2024

Closing the issue for now. Feel free to reopen it in case you face further difficulties.

@ig15 ig15 closed this as completed Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants