[cfe-dev] [3.5 Release] Release Candidate 3 Now Available

Larry Evans cppljevans at suddenlink.net
Tue Aug 26 06:21:30 PDT 2014


On 08/25/2014 08:51 PM, Richard Smith wrote:
> On Mon, Aug 25, 2014 at 5:30 PM, Larry Evans <cppljevans at suddenlink.net>
> wrote:
> 
>> On 08/21/2014 12:55 PM, Bill Wendling wrote:
>>> The third 3.5 release candidate is now available. Please pick up sources
>> and binaries here:
[snip]
>> Hi Bill,
>>
>> I downloaded:
>>
>> http://llvm.org/pre-releases/3.5/
[snip]
>> Then, followed instructions on:
>>
>> http://llvm.org/docs/GettingStarted.html#requirements
>>
>> for using cmake as follows:
>> -*- mode: compilation; default-directory:
>> "~/dwnlds/llvm/3.5/rc3/build-variants/" -*-
>> Compilation started at Mon Aug 25 17:30:37
>>
>> make cmake.build
>> install -d release/cmake.build
>> cd release/cmake.build ; \
>>           CC="/usr/local/bin/gcc" ; \
>>           CXX="/usr/local/bin/g++" ; \
>>           cmake /home/evansl/dwnlds/llvm/3.5/rc3/llvm-3.5.0rc3.src
>> -DCMAKE_CXX_LINK_FLAGS="-L/usr/local/lib64 -Wl,-rpath -Wl,/usr/local/lib64"
[snip]
>> -- The C compiler identification is GNU 4.8.2
>> -- The CXX compiler identification is GNU 4.8.2
>> Then built it:
>>
>> ~/dwnlds/llvm/3.5/rc3/build-variants/release/cmake.build $ make
>> Scanning dependencies of target LLVMSupport
[snip]
>> [100%] Built target clang-check
>> ~/dwnlds/llvm/3.5/rc3/build-variants/release/cmake.build $
>>
>> However, when compiling a hello_world.cpp:
>>
>> -*- mode: compilation; default-directory:
>> "~/dwnlds/llvm/3.5/rc3/build-variants/" -*-
>> Compilation started at Mon Aug 25 18:55:57
>>
>> make cmake.run
>> ./release/cmake.build/bin/clang++ -std=c++1y hello_world.cpp -o
>> hello_world.exe
[snip]
>> /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/cstdio:120:11:
>> error: no member named 'gets' in the
>>       global namespace
>>   using ::gets;
>>         ~~^
>> 1 error generated.
>> make: *** [cmake.run] Error 1
>>
>> Compilation exited abnormally with code 2 at Mon Aug 25 18:55:59
>>
>> where hello_world.cpp is just:
>>
>> #include <iostream>
>> int main()
>> {
>>     std::cout<<"Hello World!\n";
>>     return 0;
>> }
>>
>>
>> What needs to change to get this hello_world.cpp to compiler?
>>
> 
> This is nothing to do with Clang; the problem is that glibc speculatively
> removed 'gets' in their C++14 mode (long before it was removed from the C++
> standard), and libstdc++4.8 still expects it to exist in *their* C++14 mode.
> 
> Switch to a standard library that supports C++14 and you should be OK. If
> you built and installed libc++, this should be as simple as adding
> '-stdlib=libc++' to your clang command line.
> 
Thanks very much Richard.  Your solution worked!

make -k cmake.run
./release/cmake.build/bin/clang++ -std=c++1y -stdlib=libc++
hello_world.cpp -o hello_world.exe
./hello_world.exe
Hello World!

Compilation finished at Tue Aug 26 08:04:56






More information about the cfe-dev mailing list