I'm kind of new to C++ although I have done some Objective C recently so some of it looks vaguely familiar.
I'm in the process of writing some test programs to gauge whether something is going to be possible or not. In my (very simple 'Hello World') program I'm outputting some text using cout which works fine, however when I modify the LD_LIBRARY_PATH to point to some libraries required by a 3rd party application that I'll be communicating with I get no output but no compiler errors from g++.
I've tried including the standard paths e.g. /usr/local/lib:/usr/lib:/lib but when I include this in the path I still get no output.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World";
return 0;
}
As you can see it a pretty simple program at the moment which works as expected before I set the LD_LIBRARY_PATH.
I'm not getting any errors at all at any stage so I've no way of knowing whether it's running. Is there anything I can check or any way for me to test whether the program is even running?
P.S. I've also tried writing output to a file which works before setting the path.
Many thanks
UPDATE
Thanks for the replies (see comment below for results)
Based on what @Nemo said about the 3rd party app having it's own version of libstdc++.so, which was correct, I've swapped out their version of that library with the standard install version. Although I am now getting the 'Hello World' output I am still receiving numerous No such file or directory errors when strace'ing the program so I'm guessing the issue is only partly fixed. I'm not sure if what I've done is 'allowed' or how to proceed from here.
endl;on the end of your line, to ensure that the problem isn't just thatcoutis not flushing the output. - Mats Peterssonstrace -f _binary_- and check output - you should see what is happening from that - Iwan AucampLD_LIBRARY_PATHsetting is required by a "third-party application". In my experience, those often ship with their own version oflibstdc++.so(the C++ runtime). I highly suspect this is the source of the problem. - Nemoldd yourprogramwith and without LD_LIBRARY_PATH set. Is there a difference in the output? - n. 1.8e9-where's-my-share m.