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

: c cpp_installation.md #468

Closed
tege17 opened this issue Jan 7, 2023 · 5 comments
Closed

: c cpp_installation.md #468

tege17 opened this issue Jan 7, 2023 · 5 comments

Comments

@tege17
Copy link

tege17 commented Jan 7, 2023

These instructions are invalid. They do not install a functional compiler environment. Nether trivial C nor C++ programs can be compiled. Considering that this page has 5 authors, perhaps testing the instructions could have been expected?

fed64$ gcc -std=c++14 hello/hello.C
In file included from /usr/include/features.h:514,
from /usr/include/c++/12/x86_64-redhat-linux/bits/os_defines.h:39,
from /usr/include/c++/12/x86_64-redhat-linux/bits/c++config.h:2895,
from /usr/include/c++/12/iostream:38,
from hello/hello.C:1:
/usr/include/gnu/stubs.h:10:11: fatal error: gnu/stubs-64.h: No such file or directory
10 | # include <gnu/stubs-64.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.
fed64$ g++ -std=c++14 hello/hello.C
In file included from /usr/include/features.h:514,
from /usr/include/c++/12/x86_64-redhat-linux/bits/os_defines.h:39,
from /usr/include/c++/12/x86_64-redhat-linux/bits/c++config.h:2895,
from /usr/include/c++/12/iostream:38,
from hello/hello.C:1:
/usr/include/gnu/stubs.h:10:11: fatal error: gnu/stubs-64.h: No such file or directory
10 | # include <gnu/stubs-64.h>
| ^~~~~~~~~~~~~~~~
compilation terminated.

@jackorp
Copy link
Contributor

jackorp commented Jan 7, 2023

This does not seem to be a problem of Fedora but rather something you did judging by the provided information.

On a fresh F38 image I am able to install gcc-c++ as described and then compile and run the following program like so:

$ sudo dnf install -y gcc-c++
$ cat hello.c
#include <iostream>

int main() {
  std::cout << "Hello" << std::endl;
  return 0;
}
$ g++ -std=c++14 ./hello.c
$ echo $?
0
$  ./a.out
Hello

I am noticing that the package that provides the gnu/stubs-64.h header is actually available after I install the gcc-c++ as described in the guide. From my POV the instructions are still right at least for a minimal environment.

I am curious how did your install of the compiler miss out on the glibc-devel package.
What version of Fedora Linux are you using? Perhaps it is not reproducible on rawhide but rather the lower Fedora versions.

I agree with you that probably adding the "magical" sudo dnf group install "C Development Tools and Libraries" could be appropriate for the C and C++ sections.

@tege17
Copy link
Author

tege17 commented Jan 7, 2023 via email

@jackorp
Copy link
Contributor

jackorp commented Jan 7, 2023

This is surely unrelated, but indicates that the compiler/library deps are
not done right.

That is matter of opinion IMHO. The x86_64 and i686 (64bit and 32bit respectively) are 2 "different" sets of architectures in Fedora and I'd say 32bit is rarely needed these days for most use cases, so the default install is x86_64. For 32bit packages you can always append .i686 to receive the correct deps. In our example here you can run: $ sudo dnf install gcc-c++.i686 and you'll receive the 32bit capable compiler. In any case, glibc-devel should've been installed, and is pulled in as a dependency of gcc-c++ in a fresh F37 container.

@tege17
Copy link
Author

tege17 commented Jan 7, 2023 via email

@jackorp
Copy link
Contributor

jackorp commented Jan 7, 2023

Thanks for collaborating. We cannot solve it from the side of Fedora Developer Portal.

Consider asking the community here: https://ask.fedoraproject.org/ , people there might know much better what is going on or maybe see about better way of providing the dependencies for automated testing.

@jackorp jackorp closed this as completed Jan 7, 2023
@jackorp jackorp closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2023
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