Error map

redefinition of C/C++: error: redefinition of 'int x' / previous definition

C/C++ · layer 4, Application & API

Open the full error page →

Centre: this error. First ring: errors it is linked with (6). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

redefinition of — C/C++: error: redefinition of 'int x' / previous definition (C/C++)redefinitio…incomplete type — C++: error: invalid use of incomplete type 'class X' — forward declaration only (C/C++)incomplete typeimplicit declaration of function — C: warning: implicit declaration of function 'foo' [-Wimplicit-function-declaration] (C/C++)implicit declaratio…redefinition of — C++: error: redefinition of 'class X' / multiple definition — missing include guard (C/C++)redefinition ofmultiple definition of — C/C++: multiple definition of `x'; first defined here — ld returned 1 exit status (C/C++)multiple definition…fatal error: 'stdio.h' file not found — fatal error: 'stdio.h' file not found #include <stdio.h> (macOS)fatal error: 'stdio…conflicting types — C: error: conflicting types for 'foo' (C/C++)conflicting typesuse of deleted function — C++: error: use of deleted function 'X::X(const X&)' — copying a non-copyable type (C/C++)use of deleted func…does not name a type — C++: error: 'string' does not name a type (C/C++)does not name a typecannot declare variable to be of abstract type — C++: error: cannot declare variable 'x' to be of abstract type 'Shape' (pure virtual functions) (C/C++)cannot declare vari…undefined reference to — C/C++: undefined reference to `function' — collect2: error: ld returned 1 exit status (C/C++)undefined reference…was not declared in this scope — C++: error: 'x' was not declared in this scope (undeclared identifier) (C/C++)was not declared in…control reaches end of non-void function — C/C++: warning: control reaches end of non-void function [-Wreturn-type] (C/C++)control reaches end…fatal error: No such file or directory — C/C++: fatal error: foo.h: No such file or directory — #include not found (C/C++)fatal error: No suc…not a member of std — C++: error: 'optional' in namespace 'std' does not name a template type — wrong -std standard (C/C++)not a member of stdNo rule to make target — Make: *** No rule to make target 'foo.c', needed by 'foo.o'. Stop. (C/C++)No rule to make tar…undefined reference to vtable — C++: undefined reference to `vtable for X' — virtual function not defined (C/C++)undefined reference…undefined reference to main — C/C++: undefined reference to `main' — (.text+0x20) in crt1.o (C/C++)undefined reference…undefined reference to pthread_create — C/C++: undefined reference to `pthread_create' — missing -pthread (also `dlopen`, `clock_gettime`) (C/C++)undefined reference…Your Command Line Tools are too outdated — Homebrew: Error: Your Command Line Tools (CLT) are too outdated. Update them from Software Update / Please update to the latest macOS (macOS)Your Command Line T…clang: error: unsupported option '-fopenmp' — macOS: clang: error: unsupported option '-fopenmp' (OpenMP with Apple Clang) (macOS)clang: error: unsup…Can't install the software because it is not currently available from the Software Update server — macOS: xcode-select: error: Can't install the software because it is not currently available from the Software Update server (macOS)Can't install the s…invalid operands to binary expression — C++: error: invalid operands to binary expression ('A' and 'B') (C/C++)invalid operands to…expected class-name — C++: error: expected class-name before '{' token (C/C++)expected class-namehas no member named — C++: error: 'class X' has no member named 'y' (C/C++)has no member named

Directly related (6)

Two steps away (18)

use of deleted functionC/C++

C++: error: use of deleted function 'X::X(const X&)' — copying a non-copyable type

The code needs a function (usually a copy constructor or assignment) that was deleted explicitly or implicitly, as for `std::uniq…

does not name a typeC/C++

C++: error: 'string' does not name a type

Where the compiler expected a type, it found a name it does not know as one — a missing header, namespace, or class declared late…

cannot declare variable to be of abstract typeC/C++

C++: error: cannot declare variable 'x' to be of abstract type 'Shape' (pure virtual functions)

You tried to create an object of a class that still has pure virtual functions; only a derived class that overrides all of them c…

undefined reference toC/C++

C/C++: undefined reference to `function' — collect2: error: ld returned 1 exit status

The linker can’t find the definition of a function or variable that was declared and used.

was not declared in this scopeC/C++

C++: error: 'x' was not declared in this scope (undeclared identifier)

The compiler met a name it has never seen: it is misspelled, declared later, out of scope, or its header or namespace is missing.

control reaches end of non-void functionC/C++

C/C++: warning: control reaches end of non-void function [-Wreturn-type]

A function that promises a return value can finish without returning one on some path — undefined behaviour in C++.

fatal error: No such file or directoryC/C++

C/C++: fatal error: foo.h: No such file or directory — #include not found

The preprocessor cannot find a header named in `#include`: wrong path, missing include directory (-I), or the library is not inst…

not a member of stdC/C++

C++: error: 'optional' in namespace 'std' does not name a template type — wrong -std standard

The standard-library feature you used needs a newer C++ standard than the compiler is currently set to.

No rule to make targetC/C++

Make: *** No rule to make target 'foo.c', needed by 'foo.o'. Stop.

`make` was asked to build a file for which there is no rule and no existing file — a missing source, a typo in the Makefile, or a…

undefined reference to vtableC/C++

C++: undefined reference to `vtable for X' — virtual function not defined

The linker cannot find the class's virtual table, which means at least one virtual member function was declared but never defined…

undefined reference to mainC/C++

C/C++: undefined reference to `main' — (.text+0x20) in crt1.o

The linker has no `main` function: the file with `main` is not compiled or linked, or `main` is spelled or declared incorrectly.

undefined reference to pthread_createC/C++

C/C++: undefined reference to `pthread_create' — missing -pthread (also `dlopen`, `clock_gettime`)

Your program uses threads (or another system library) but the linker was not told to link it.

Your Command Line Tools are too outdatedmacOS

Homebrew: Error: Your Command Line Tools (CLT) are too outdated. Update them from Software Update / Please update to the latest macOS

Homebrew requires a newer Command Line Tools version than the one installed.

clang: error: unsupported option '-fopenmp'macOS

macOS: clang: error: unsupported option '-fopenmp' (OpenMP with Apple Clang)

Apple's clang doesn't ship OpenMP support, so builds using `-fopenmp` fail.

Can't install the software because it is not currently available from the Software Update servermacOS

macOS: xcode-select: error: Can't install the software because it is not currently available from the Software Update server

`xcode-select --install` couldn't fetch the Command Line Tools from Apple's catalog.

invalid operands to binary expressionC/C++

C++: error: invalid operands to binary expression ('A' and 'B')

An operator such as `+`, `==` or `

expected class-nameC/C++

C++: error: expected class-name before '{' token

A base-class list or declaration expects a class name but found something else.

has no member namedC/C++

C++: error: 'class X' has no member named 'y'

The code accessed a member that the type does not declare.