SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have Slackware-Current installed with multilib, and I'm trying to compile a personal C project with Meson + gcc that uses the header #include <stdatomic.h>, but my compiler doesnt seem to find it. My code checker throws a warning about not finding the file, so I presume I'm having linking issues, but I'm not sure if Slackware contains this file by default. I have used other linux distributions before, and not have had a problem of this sort, does anyone have any ideas/direction on how to resolve this?
Last edited by brokenshakles; 07-07-2019 at 08:34 PM.
Reason: Error Correction.
Edit 2: #include <isc/stdatomic.h> seems to be found, but attempting to use the functions included returns "implicit declaration invalid in c99". I thought I was using c11? And it should be included at this point, so why is it not finding the symbol?
Last edited by brokenshakles; 07-07-2019 at 08:00 PM.
Reason: More info.
To find out whether the issue is with your gcc install, you may try to compile the following:
test.c:
Code:
#include <stdatomic.h>
atomic_int i = 1;
int main() { return i; }
run
Code:
gcc test.c
If it generates a a.out file and doesn't complain about missing stdatomic.h, you may consider your gcc install is ok. Then the issue may be with the Meson magic...
Edit 2: #include <isc/stdatomic.h> seems to be found, but the functions included are "invalid in c99". I thought I was using c11?
If you are building with gcc as you said in your first post, it shouldn't matter. stdatomic.h is part of C11, but with gcc it is found also with -std=c99, even with -std=c89 (as you can check with the small test.c in my previous post)
To find out whether the issue is with your gcc install, you may try to compile the following:
test.c:
Code:
#include <stdatomic.h>
atomic_int i = 1;
int main() { return i; }
run
Code:
gcc test.c
If it generates a a.out file and doesn't complain about missing stdatomic.h, you may consider your gcc install is ok. Then the issue may be with the Meson magic...
It appears that my install passes this test. The compile completes with no complaints.
It appears that my install passes this test. The compile completes with no complaints.
So at least, the header file is there and a minimal program using it can be built. Now, I don't know how Meson work, and why it cannot find the header.
Maybe the include directory /usr/lib64/gcc/x86_64-slackware-linux/X.Y.Z/include (adjust to your gcc version) should be somehow added to the list of include paths in your project config file?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.