[cfe-dev] Another Linker error with clang++

Miles Bader miles at gnu.org
Wed Sep 14 00:32:06 PDT 2011


Devchandra L Meetei <dlmeetei at gmail.com>
writes:
> Is there any settings to be done to use clang++ instead of g++ on RHEL 6.1?
> what I did was
> #export CXX = path/to/clang++/
> then make for the project.

That's basically enough in my experience, but it sort of depends on
your program.  Clang tries hard to be gcc-compatible, but sometimes
random differences do crop up (typically due to bugs or areas of
active development).

The biggest area I've found is c++0x features, as gcc seems farther
along in c++0x support.  E.g., if you use std::thread with gcc, you
might want to use boost::thread instead in clang.  If you only use
C++98 features, you're probably on fairly safe ground.

[You might want to set CC as well, if your code base includes C code.]

> The compilation was fine except the linker complains (gnu ld).

Er, what are the error messages?

-Miles

-- 
Learning, n. The kind of ignorance distinguishing the studious.




More information about the cfe-dev mailing list