User forums > Using Code::Blocks

howto use clang-tidy in code::blocks

<< < (2/3) > >>

jalcazo:
I come from this topic: https://forums.codeblocks.org/index.php/topic,24672.0.html

BlueHazzard:
Again, a full rebuild log from the build log tab would help a lot.

If it is too large for the forum, please attach a txt file

In what directory are the headers?

jalcazo:
Thanks again BlueHazzard  for your answer, time and help ;D

I'll use the .txt attach good idea! I didn't thought that.

Here it is, do you see anything interesting here on why JUST SOME headers are not found while it founds the others (apparently there's no difference).

For instance, Book.cpp uses #include <Book.h> and it DOESN'T find it, but Mouse.cpp uses as well #include <Mouse.h> and it doesn't complain about it.

BlueHazzard:
hmm... i see no obvious problem...
i probably would try to use

--- Code: ---#include "Book.h"
--- End code ---
instead, because <> is generally used for system includes

jalcazo:
Sadly that yields the same result.

Interestingly, when using:


--- Code: ---#include 'Book.h'
--- End code ---

(notice the single ' ) the results are different:


--- Code: ---
-------------- Build: Compilar amb CLANG-tidy STATIC ANALYSIS in Morgana (compiler: Clang-TIDY Static Analysis)---------------

clang-tidy.exe W:\Morgana\main.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
clang-tidy.exe W:\Morgana\src\animations\AttributesAnimation.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
clang-tidy.exe W:\Morgana\src\Audio.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
clang-tidy.exe W:\Morgana\src\Companion.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
clang-tidy.exe W:\Morgana\src\Engine.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
clang-tidy.exe W:\Morgana\src\Error.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
clang-tidy.exe W:\Morgana\src\Inventory.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
clang-tidy.exe W:\Morgana\src\items\Book.cpp -header-filter='^[^/].*' -- -IW:\Morgana\include -Wall -fexceptions -m64 -pedantic -w
5 errors generated.
Error while processing W:\Morgana\src\items\Book.cpp.
Found compiler error(s).
W:\Morgana\src\items\Book.cpp:1:10: error: expected "FILENAME" or <FILENAME> [clang-diagnostic-error]
#include 'Book.h'
         ^
W:\Morgana\src\items\Book.cpp:4:1: error: use of undeclared identifier 'Book' [clang-diagnostic-error]
Book::Book(const string& name, const string& name_to_show){
^
W:\Morgana\src\items\Book.cpp:4:18: error: unknown type name 'string' [clang-diagnostic-error]
Book::Book(const string& name, const string& name_to_show){
                 ^
W:\Morgana\src\items\Book.cpp:4:38: error: unknown type name 'string' [clang-diagnostic-error]
Book::Book(const string& name, const string& name_to_show){
                                     ^
W:\Morgana\src\items\Book.cpp:13:1: error: use of undeclared identifier 'Book' [clang-diagnostic-error]
Book::~Book(){} // don't delete or "undefined reference to vtable..."
^
Process terminated with status 1 (0 minute(s), 0 second(s))
 
1 error generated.
Error while processing W:\Morgana\src\Engine.cpp.
Found compiler error(s).
W:\Morgana\src\Engine.cpp:3:10: error: 'Screen.h' file not found [clang-diagnostic-error]
#include <Screen.h>
         ^
Process terminated with status 1 (0 minute(s), 0 second(s))
 
1 error generated.
Error while processing W:\Morgana\main.cpp.
Found compiler error(s).
W:\Morgana\main.cpp:2:10: error: 'Level1.h' file not found [clang-diagnostic-error]
#include <Level1.h>
         ^
1 error generated.
Error while processing W:\Morgana\src\animations\AttributesAnimation.cpp.
Found compiler error(s).
W:\Morgana\src\animations\AttributesAnimation.cpp:1:10: error: 'AttributesAnimation.h' file not found [clang-diagnostic-error]
#include <AttributesAnimation.h>
         ^
1 error generated.
Error while processing W:\Morgana\src\Inventory.cpp.
Found compiler error(s).
W:\Morgana\include\Inventory.h:6:10: error: 'Item.h' file not found [clang-diagnostic-error]
#include <Item.h>
         ^
Process terminated with status 1 (0 minute(s), 0 second(s))
 
Process terminated with status 1 (0 minute(s), 0 second(s))
 
1 error generated.
Error while processing W:\Morgana\src\Audio.cpp.
Found compiler error(s).
W:\Morgana\include\SDL2/SDL_stdinc.h:683:12: error: use of undeclared identifier 'memcpy' [clang-diagnostic-error]
    return SDL_memcpy(dst, src, dwords * 4);
           ^
W:\Morgana\include\SDL2/SDL_stdinc.h:653:20: note: expanded from macro 'SDL_memcpy'
#define SDL_memcpy memcpy
                   ^
Process terminated with status 1 (0 minute(s), 0 second(s))
 
Process terminated with status 1 (0 minute(s), 0 second(s))
 
Process terminated with status 0 (0 minute(s), 3 second(s))
10 error(s), 0 warning(s) (0 minute(s), 3 second(s))

--- End code ---

This has something to do with the regular expression:


--- Code: ----header-filter='^[^/].*'
--- End code ---

I must dig into this and how it is formed. I don't understand it at all. Any resource explaining this particular type of regular expression?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version