I just installed g++ and clang through eopkg on a clean install of Solus, and am failing to compile a program that outputs text to the standard output using the iostream header. It seems to be some issue dependencies, but I don't know C/C++ stuff that well.
This is the output I get with just 'g++ hello.cpp'
In file included from /usr/include/errno.h:35:0,
from /usr/include/c++/6.2.0/cerrno:42,
from /usr/include/c++/6.2.0/ext/string_conversions.h:44,
from /usr/include/c++/6.2.0/bits/basic_string.h:5402,
from /usr/include/c++/6.2.0/string:52,
from /usr/include/c++/6.2.0/bits/locale_classes.h:40,
from /usr/include/c++/6.2.0/bits/ios_base.h:41,
from /usr/include/c++/6.2.0/ios:42,
from /usr/include/c++/6.2.0/ostream:38,
from /usr/include/c++/6.2.0/iostream:39,
from hello.cpp:1:
/usr/include/bits/errno.h:24:26: fatal error: linux/errno.h: No such file or directory
# include <linux/errno.h>
^
compilation terminated.clang is also failing, again a simple 'clang hello.cpp', with the following output.
/tmp/hello-e4f567.o: In function `main': hello.cpp:(.text+0xa): undefined reference to `std::cout' hello.cpp:(.text+0x24): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)' /tmp/hello-e4f567.o: In function `__cxx_global_var_init': hello.cpp:(.text.startup+0x13): undefined reference to `std::ios_base::Init::Init()' hello.cpp:(.text.startup+0x19): undefined reference to `std::ios_base::Init::~Init()' clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
And the hello.cpp file in case I've made some dumb mistake.
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!";
return 0;
}Both clang and g++ are able to compile a similar program that uses cstdio and printf instead.