You are not logged in.

#1 2012-02-13 07:57:34

6msj
Member
Registered: 2011-10-03
Posts: 42

[SOLVED]Clang and Library Files

I just installed Clang and it doesn't have the c++ libraries founded yet.

These are the directions I have to fix it but I have no idea where it's located.

If you intend to work on Clang C++ support, you may need to tell it how to find your C++ standard library headers. If Clang cannot find your system libstdc++ headers, please follow these instructions:
'gcc -v -x c++ /dev/null -fsyntax-only' to get the path.
Look for the comment "FIXME: temporary hack: hard-coded paths" in clang/lib/Frontend/InitHeaderSearch.cpp and change the lines below to include that path.

Any help would be appreciated.

Last edited by 6msj (2012-02-14 02:58:09)

Offline

#2 2012-02-13 12:03:20

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED]Clang and Library Files

There are likely candidates such as /usr/lib/ but really why not just ask pacman

pacman -Ql clang | grep InitHeaderSearch.cpp

Last edited by Trilby (2012-02-13 12:03:32)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2012-02-13 15:29:07

6msj
Member
Registered: 2011-10-03
Posts: 42

Re: [SOLVED]Clang and Library Files

Thanks for replying Trilby; I don't get a return back when I enter that command.

Offline

#4 2012-02-13 15:43:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED]Clang and Library Files

Oops, sorry, I typed to quickly.

As it is referring to a cpp source file you won't likely have that file.  You may have to patch and recompile clang or llvm yourself, unless someone has already put such a patch in the AUR.

As I don't use clang I should probably leave this to those who do.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2012-02-13 23:51:07

6msj
Member
Registered: 2011-10-03
Posts: 42

Re: [SOLVED]Clang and Library Files

Hmnn, looks like I'll have to wait for a Clang expert to comment on this. Meanwhile I'll just do a little more reading to see if I can solve it. Thanks.

Offline

#6 2012-02-14 02:17:59

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED]Clang and Library Files

You say you're trying to use clang for c++... perhaps you meant to use clang++? We have none of the story here -- what's the actual error you're getting and what did you run to get it?

Offline

#7 2012-02-14 02:20:42

6msj
Member
Registered: 2011-10-03
Posts: 42

Re: [SOLVED]Clang and Library Files

I ran clang name.cpp.

/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function __cxx_global_var_init: error: undefined reference to 'std::ios_base::Init::Init()'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function __cxx_global_var_init: error: undefined reference to 'std::ios_base::Init::~Init()'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::cout'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: 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/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::cout'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: 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/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::cin'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::istream::operator>>(int&)'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::cout'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function main: error: undefined reference to 'std::ostream::operator<<(std::ostream& (*)(std::ostream&))'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function pushingToArray(int*, int&): error: undefined reference to 'std::cout'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function pushingToArray(int*, int&): error: 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/BubbleSort-x5Dawr.o:BubbleSort.cpp:function pushingToArray(int*, int&): error: undefined reference to 'std::cin'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function pushingToArray(int*, int&): error: undefined reference to 'std::istream::operator>>(int&)'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function checkingTheArray(int*, int&): error: undefined reference to 'std::ostream::operator<<(int)'
/tmp/BubbleSort-x5Dawr.o:BubbleSort.cpp:function checkingTheArray(int*, int&): error: 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*)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Offline

#8 2012-02-14 02:48:13

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED]Clang and Library Files

So as I said, you're using clang which is a C compiler. You want clang++, which is the C++ compiler.

Offline

#9 2012-02-14 02:58:25

6msj
Member
Registered: 2011-10-03
Posts: 42

Re: [SOLVED]Clang and Library Files

Thanks! Dumb mistake.

Offline

Board footer

Powered by FluxBB