LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-07-2019, 05:37 PM   #1
brokenshakles
LQ Newbie
 
Registered: Dec 2009
Posts: 12

Rep: Reputation: 0
Difficulty finding c header in Slackware.


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.
 
Old 07-07-2019, 06:11 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Code:
$ whereis include
include: /usr/local/include /usr/src/linux-4.19.57/include
I am not sure about 32 or what file you're speaking of but that is where your header files are at and how to locate the dir for them.

i do not know why
Code:
/usr/include
did not show up in that.
Code:
$ locate stdatomic.h
/usr/include/isc/stdatomic.h
/usr/lib64/clang/8.0.0/include/stdatomic.h
/usr/lib64/gcc/x86_64-slackware-linux/9.1.0/include/stdatomic.h
should find it if it is on your system.
Code:
sudo updatedb
to update locate.

mod:
is it written
Code:
#include /isc/stdatomic.h
or
#include stdatomic.h
I think that is how it should be written if it is in a sub dir /SubDir/file.h

Last edited by BW-userx; 07-07-2019 at 06:46 PM.
 
Old 07-07-2019, 06:21 PM   #3
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
This file is shipped in llvm and gcc packages in Slackware. Maybe something missing in your multilib installation?

Last edited by Didier Spaier; 07-07-2019 at 06:23 PM.
 
Old 07-07-2019, 07:21 PM   #4
brokenshakles
LQ Newbie
 
Registered: Dec 2009
Posts: 12

Original Poster
Rep: Reputation: 0
That's what I thought, I contacted Alienbob here on his website about it, he told me to come to you:

https://alien.slackbook.org/blog/you...#comment-36006

Edit: Results of locate stdatomic.h :

/usr/include/isc/stdatomic.h
/usr/lib/clang/8.0.0/include/stdatomic.h
/usr/lib64/clang/8.0.0/include/stdatomic.h
/usr/lib64/gcc/x86_64-slackware-linux/9.1.0/include/stdatomic.h

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.
 
Old 07-07-2019, 07:59 PM   #5
philanc
Member
 
Registered: Jan 2011
Posts: 308

Rep: Reputation: 273Reputation: 273Reputation: 273
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...
 
Old 07-07-2019, 08:04 PM   #6
philanc
Member
 
Registered: Jan 2011
Posts: 308

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by brokenshakles View Post

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)
 
Old 07-07-2019, 08:41 PM   #7
brokenshakles
LQ Newbie
 
Registered: Dec 2009
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by philanc View 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.
 
Old 07-07-2019, 11:54 PM   #8
philanc
Member
 
Registered: Jan 2011
Posts: 308

Rep: Reputation: 273Reputation: 273Reputation: 273
Quote:
Originally Posted by brokenshakles View Post
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?

I'm afraid I can't help you further here.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
difficulty finding/loading native .html files within ParrotLinux cad-guy Linux - Software 5 03-09-2019 10:03 AM
Finding difficulty in compiling C code on Linux Software_Virag Programming 5 07-04-2012 05:37 PM
Difficulty finding driver while kernel compilation? linuxunix Linux - Newbie 8 07-26-2010 02:30 AM
I am finding difficulty in installing SAM Linux to my Hard Disk shiv_meg Linux - Newbie 2 12-17-2008 07:14 AM
c header files in linux in place of header files in windows? harun_acs Programming 1 03-17-2004 02:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration