1

I am trying to compile a c++ program using g++. When I do it as root, it's all good. When I do it as another user (who has some fairly restricted access), I get:

fatal error: iostream: No such file or directory compilation terminated.

The code itself is just

#include <iostream>
using namespace std;
int main()
{}

So basically it does nothing, since it won't compile if it's more complicated. Any ideas?

A few things to mention:

When I run a very basic program (just the last two lines, no includes etc), I get g++-5: fatal error: -fuse-linker-plugin, but liblto_plugin.so not found compilation terminated

Ubuntu version is 16.04, 64 bit, server.

which g++ gives /usr/bin/g++

8
  • Can you explain what exactly this "fairly restricted access" is? Jun 28, 2016 at 18:57
  • Honestly, I'm afraid that I can't. I'm not sure how to check the permissions that each user has. However, if I run ls -l in the include directory, everyone has at least read permissions. I should also mention that when I use the -L flag and a link to the include directory where iostream lives, the code will still not compile. Sorry for the vagueness! Jun 28, 2016 at 18:59
  • The include file search path is modified by the -I flag; the -L is for library linkage only. You could also edit your question to include the output of the following command g++ -E -x c++ - -v < /dev/null. Jun 28, 2016 at 19:10
  • oh, thanks for that info. I changed it to -I and it still won't find it. The output of that command for this user is # 1 "" # 1 "" # 1 "" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "" 2 # 1 "" # 1 "", which looks like an error to me? Jun 28, 2016 at 19:15
  • Please edit your question and add the output there - it's hard to read/parse in comments. Also add the outputs of which g++ and g++ --version. Thanks. Also - what Ubuntu version are you using? Jun 28, 2016 at 19:18

0

You must log in to answer this question.

Browse other questions tagged .