Author Topic: LLVM Clang 3.8.0 on CodeBlocks - Strange errors  (Read 19282 times)

Offline devhobby

  • Multiple posting newcomer
  • *
  • Posts: 11
LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« on: July 02, 2016, 04:34:24 pm »
Hello.

I've installed Clang from this link http://llvm.org/releases/download.html (PreBuilt Binaries -> Win64)

Then I've moved the LLVM folder inside the CodeBlocks directory.

Now, this is how CodeBlocks is set up:



When I go back and compile a simple Hello World program, this is what happens:



And these are the compiler options enabled



Any tip?
« Last Edit: July 02, 2016, 04:44:06 pm by gedamial »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #1 on: July 02, 2016, 06:22:09 pm »
nice screenshots, but sadly they don't help much. What would help is written here:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

greetings

Offline devhobby

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #2 on: July 02, 2016, 06:39:38 pm »
Thanks for the reply.

I've compiled without CodeBlocks and this is the result:

Code
clang++ -std=c++14 -Wall -pedantic-errors -O2 -Wall  C:\Users\Michael\Desktop\testClang\main.cpp  && ./a.out

In file included from C:\Users\Michael\Desktop\testClang\main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\cmath:647:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtgmath.h:8:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtr1common:213:22: error:
      use of undeclared identifier 'char16_t'
        struct _Is_integral<char16_t>
                            ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtr1common:219:22: error:
      use of undeclared identifier 'char32_t'
        struct _Is_integral<char32_t>
                            ^
In file included from C:\Users\Micky\Desktop\testClang\main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:6:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstddef:404:14: error:
      use of undeclared identifier 'char16_t'
        struct hash<char16_t>
                    ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstddef:410:14: error:
      use of undeclared identifier 'char32_t'
        struct hash<char32_t>
                    ^
In file included from C:\Users\Micky\Desktop\testClang\main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\exception:7:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:524:45: error:
      '_To' does not refer to a value
                : integral_constant<bool, __is_assignable(_To, _From)>
                                                          ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:521:16: note:
      declared here
template<class _To,
               ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:524:50: error:
      '_From' does not refer to a value
                : integral_constant<bool, __is_assignable(_To, _From)>
                                                               ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:522:8: note:
      declared here
        class _From>
              ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits:525:2: error:
      expected class name
        {       // determine whether _From can be assigned to _To
        ^
In file included from C:\Users\Micky\Desktop\testClang\main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0:8:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\limits:611:33: error:
      use of undeclared identifier 'char16_t'
template<> class numeric_limits<char16_t>
                                ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\limits:901:33: error:
      use of undeclared identifier 'char32_t'
template<> class numeric_limits<char32_t>
                                ^
In file included from C:\Users\Micky\Desktop\testClang\main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:7:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xmemory0:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xutility:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility:7:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iosfwd:267:21: error:
      use of undeclared identifier 'char16_t'
        struct char_traits<char16_t>
                           ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iosfwd:276:21: error:
      use of undeclared identifier 'char32_t'
        struct char_traits<char32_t>
                           ^
In file included from C:\Users\Micky\Desktop\testClang\main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:8:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\stdexcept:7:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:2654:22: error:
      use of undeclared identifier 'char16_t'
typedef basic_string<char16_t, char_traits<char16_t>, allocator<char16_t> >
                     ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:2654:53: error:
      expected unqualified-id
typedef basic_string<char16_t, char_traits<char16_t>, allocator<char16_t> >
                                                    ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:2656:22: error:
      use of undeclared identifier 'char32_t'
typedef basic_string<char32_t, char_traits<char32_t>, allocator<char32_t> >
                     ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstring:2656:53: error:
      expected unqualified-id
typedef basic_string<char32_t, char_traits<char32_t>, allocator<char32_t> >
                                                    ^
In file included from C:\Users\Micky\Desktop\testClang\main.cpp:1:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\iostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:10:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\streambuf:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xiosbase:6:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:1004:30: error:
      use of undeclared identifier 'char16_t'
        class _CRTIMP2_PURE codecvt<char16_t, char, _Mbstatet>
                                    ^
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocale:1328:30: error:
      use of undeclared identifier 'char32_t'
        class _CRTIMP2_PURE codecvt<char32_t, char, _Mbstatet>
                                    ^
17 errors generated.

Well, it's not a CodeBlocks issue, so this thread shouldn't go on... but have you any tip for me?

I really don't know where to catch the problem!
« Last Edit: July 02, 2016, 06:42:39 pm by gedamial »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #3 on: July 02, 2016, 06:45:24 pm »
(double-)Check the compiler (and linker) searchpaths for your target, project and (!) the global compilker section.

Offline devhobby

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #4 on: July 02, 2016, 06:53:28 pm »
(double-)Check the compiler (and linker) searchpaths for your target, project and (!) the global compilker section.

I don't get what you mean. From CodeBlocks, i checked everything and all "seems" to be ok.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #5 on: July 02, 2016, 08:18:49 pm »
First verify that the compiler works. This is done by compiling something in a cmd window.
Then we can tell you how to make it work inside codeblocks.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline devhobby

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #6 on: July 02, 2016, 08:29:53 pm »
First verify that the compiler works. This is done by compiling something in a cmd window.
Then we can tell you how to make it work inside codeblocks.

That's the point!

I moved to clang's folder and launched this command

clang++ -std=c++14 -Wall -pedantic-errors -O2 -Wall  C:\Users\Michael\Desktop\testClang\main.cpp  && ./a.out

and it gave me the same errors I got in codeblocks (see the post above). So I think it's a compiler problem.


But it's strange since I downloaded it from the official LLVM site.
« Last Edit: July 02, 2016, 08:31:29 pm by gedamial »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #7 on: July 02, 2016, 08:44:19 pm »
First verify that the compiler works. This is done by compiling something in a cmd window.
Then we can tell you how to make it work inside codeblocks.

He already posted that it errors out on the command line. It looks like a corrupted compiler installation.

Me, I would uninstall the compiler and then re-install it.
And, I would NOT cut and paste the compiler folder!!!!!!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline devhobby

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #8 on: July 02, 2016, 09:02:20 pm »
First verify that the compiler works. This is done by compiling something in a cmd window.
Then we can tell you how to make it work inside codeblocks.

He already posted that it errors out on the command line. It looks like a corrupted compiler installation.

Me, I would uninstall the compiler and then re-install it.
And, I would NOT cut and paste the compiler folder!!!!!!


I've uninstalled and re-installed but this time the 3.7 version.

Now the only error I get is fatal error: 'iostream' file not found

Both in CodeBlocks and via command line

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #9 on: July 02, 2016, 10:48:12 pm »
Post the full re-build log.

I suggest reading it before posting because you likely forgot to name the source file with the extension ".cpp".

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline devhobby

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #10 on: July 02, 2016, 10:58:09 pm »
Post the full re-build log.

Nothing special, just


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #11 on: July 02, 2016, 11:23:20 pm »
Please read and follow the directions on the link.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

And, then post the full rebuild log as requested.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline devhobby

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #12 on: July 02, 2016, 11:30:42 pm »
Please read and follow the directions on the link.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

And, then post the full rebuild log as requested.

Code
-------------- Clean: Debug in testclang (compiler: LLVM Clang Compiler)---------------

Cleaned "testclang - Debug"

-------------- Build: Debug in testclang (compiler: LLVM Clang Compiler)---------------

clang++.exe -Weverything -fexceptions  -g  -Wall -std=c++11    -c C:\Users\Micky\Desktop\testclang\main.cpp -o obj\Debug\main.o
C:\Users\Micky\Desktop\testclang\main.cpp:1:10: fatal error: 'iostream' file not found
#include <iostream>
         ^
1 error generated.
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
 


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: LLVM Clang 3.8.0 on CodeBlocks - Strange errors
« Reply #14 on: July 02, 2016, 11:46:56 pm »
Please give more information on your Windows OS and Compiler.

I am trying to download LLVM 3.7.1 to test on Windows 7 SP1 (32 bit); but, I expect to NOT see the issue.
From here http://llvm.org/releases/download.html
Since, LLVM 3.8.0 64 bit; worked on Windows 7 SP1 (64 bit) to do a hello world program earlier in the day.

NOTE: I have never gotten LLVM to do a complex C++ program on Windows; but, I have only tried "hello world", the Code::Blocks IDE as things to build.

Do you know how to install and uninstall software on a Windows computer?
Because, I am starting to believe you have no idea on the correct way to install software.
What options are you picking during the installation of the software?
Did you uninstall the old software using the Windows Control panel?

Tim S.
 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org