You haven’t defined main()
function in your program.
As said in error:
(.text+0x20): undefined reference to `main'
PS:
This is not crash of g++
, it just shows error message when can’t find definition of main()
.
More Related Contents:
- Why vector::reference doesn’t return reference to bool?
- “not declared in this scope” error with templates and inheritance [duplicate]
- extra qualification error in C++
- cc1plus: error: unrecognized command line option “-std=c++11” with g++
- Linking files in g++
- constexpr not working if the function is declared inside class scope
- "imspossible" error on a simplest code [closed]
- Undefined reference to vtable
- g++ undefined reference to typeinfo
- GCC C++ Linker errors: Undefined reference to ‘vtable for XXX’, Undefined reference to ‘ClassName::ClassName()’
- Omitting return statement in C++
- static_assert fails compilation even though template function is called nowhere
- invalid conversion from `void*’ to `char*’ when using malloc?
- Which C++ standard is the default when compiling with g++?
- Detecting the parameter types in a Spirit semantic action
- Why can’t g++ find iostream.h?
- constexpr initializing static member using static function
- C++ compile time error: expected identifier before numeric constant
- Code runs perfect in g++ but not in Xcode – Cannot find File
- Why can’t “transform(s.begin(),s.end(),s.begin(),tolower)” be complied successfully?
- Why does gcc allow char array initialization with string literal larger than array?
- request for member `…’ is ambiguous in g++
- “undefined reference to” using ‘g++’ to compile a C++ program
- Vscode g++ it isn’t finding .cpp definition files
- Public operator new, private operator delete: getting C2248 “can not access private member” when using new
- Fatal error: “No Target Architecture” in Visual Studio
- Can I use #include “pch.h” instead of #include “stdafx.h” as my precompile header in Visual Studio C++?
- How do I call a pointer-to-member-function?
- std::this_thread::sleep_for() and GCC
- Is substitution performed on a variadic parameter pack type if the pack is empty?