Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Finding stdc++ library path automatically


Could someone provide any clues how to find stdc++ library path (not dependent on OS) programmatically using Eclipse CDT API. I try to add it to projects's includes.

I am developing LLVM plug-in for CDT and many people have asked the feature to automatically find stdc++ library path. Currently the clang++ toolchain is able to find same includes than e.g. Linux GCC toolchain from org.eclipse.cdt.managedbuilder.gnu.ui plug-in. I have defined default value -lstdc++ to C++ linker. In Windows I can probably get stdc++ path from Cygwin/MinGW environment variable suppliers after getting their installation path and appending applicable subdir. However in Linux getting stdc++ lib path seems to be trickier. In Ubuntu (depending on gcc version) /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/<version> but there's quite many distributions with different filesystem hierarchies. It came to my mind that using a script 'locate stdc++' could be (unpractical) option but how to call such a script from Eclipse? Any suggestions for practical solutions?


Back to the top