When there’s no project, Code::Blocks only compiles and links the current file. That file, from your picture, is secrypt.cpp
, which does not have a main function. In order to compile and link both source files, you’ll need to do it manually or add them to the same project.
Contrary to what others are saying, using a Windows subsystem with main
will still work, but there will be no console window.
Your other attempt, compiling and linking just trial.cpp
, never links secrypt.cpp
. This would normally result in an undefined reference to jRegister()
, but you’ve declared the function inside main
instead of calling it. Change main
to:
int main() { jRegister(); return 0; }
Related Posts:
- outputting ascii table in C++
- finding dll for “The specified module could not be found”
- How can I clear console
- How to go from fopen to fopen_s
- “X does not name a type” error in C++
- Windows 7 exception code: 0xc0000409
- Difference between ‘strcpy’ and ‘strcpy_s’?
- make: g++: Command not found
- Why am I getting “undefined reference to main”
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- MinGW: “gcc is not recognized as an internal or external command”
- LNK1168: cannot open debug\file.exe for writing
- VC++ fatal error LNK1168: cannot open filename.exe for writing
- How do I add the MinGW bin directory to my system path?
- Run C++ in command prompt – Windows
- How to get Current Directory?
- Cannot open Windows.h in Microsoft Visual Studio
- Cannot open output file, permission denied
- The program can’t start because libgcc_s_dw2-1.dll is missing
- Is there a replacement for unistd.h for Windows (Visual C)?
- Error : aggregate ‘first one’ has incomplete type and cannot be defined
- CMake : C and CXX compiler identification is unknown Win10 CMakeGUI
- What is the source of the data for the ProgramFiles, ProgramW6432Dir, ProgramFilesDir (x86), CommonProgramFiles environment variables?
- LPCSTR, LPCTSTR and LPTSTR
- REGSVR32: the module “xxxxx.dll” failed to load … dependent assembly could not be found
- template argument 1 is invalid (Code::Blocks Win Vista) – i don’t use templates
- Linker Error C++ “undefined reference ” [duplicate]
- convert a char* to std::string
- system(“pause”); – Why is it wrong?
- C++ struct constructor
- When to use virtual destructors?
- std::string to float or double
- What is difference between Application Buffer and System Buffer
- C++ undefined reference to defined function
- How do I include the string header?
- How to navigate through a vector using iterators? (C++)
- Differences between C++ string == and compare()?
- What does the explicit keyword mean?
- program ended prematurely and may have crashed. exit code 0xc0000005
- How to use _CRT_SECURE_NO_WARNINGS
- Stack Memory vs Heap Memory
- Is it more efficient to copy a vector by reserving and copying, or by creating and swapping? [duplicate]
- C++ Singleton design pattern
- Convert float to std::string in C++
- “items list” or “item list”
- When and why do I need to use cin.ignore() in C++?
- What does int & mean
- Evaluate a string with a switch in C++ [duplicate]
- “&” meaning after variable type
- How can I create objects while adding them into a vector?
- What is the printf format specifier for bool?
- libpng warning: iCCP: known incorrect sRGB profile
- In CLion, header only library: file “does not belong to any project target, code insight features might not work properly”
- Error at constructor : Expected an identifier?
- identifier “string” undefined?
- What does LPCWSTR stand for and how should it be handled with?
- A warning – comparison between signed and unsigned integer expressions
- How can I convert const char* to string and then back to char*?
- How do I call the class’s destructor?
- Can’t resolve Error: indirection requires pointer operand (‘int’ invalid)
- Defining a struct in flex error C++
- C++ Postfix calculator using stacks
- error: request for member ‘..’ in ‘..’ which is of non-class type
- Socket API or library for C++?
- Initialize empty vector in structure – c++
- C++ catching all exceptions
- error: new types may not be defined in a return type
- error: passing ‘const …’ as ‘this’ argument of ‘…’ discards qualifiers
- Printing an array in C++?
- Resolve build errors due to circular dependency amongst classes
- error: “initializer expression list treated as compound expression”
- RPN Calculator for C++
- How can I get the list of files in a directory using C or C++?
- How do you make a HTTP request with C++?
- Error: C2228: left of ” must have class/struct/union
- error C2679: binary ‘<<' : no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion)
- Multi-character constant warnings
- Error: vector does not name a type
- error C2601: ‘main’ : local function definitions are illegall – MS VS 2013 Compiler
- std::string length() and size() member functions
- How to convert QString to int?
- Update GCC on OSX
- Which is faster C++ String length() or size()?
- creating an array of structs in c++
- How to read lines of text from file and put them into an array
- Undefined reference to class constructor, including .cpp file fixes
- Why can’t we pass arrays to function by value?
- Iterator Loop vs index loop
- How to draw line in OpenGL?
- c++ sizeof( string )
- How can I add reflection to a C++ application?
- operator << must take exactly one argument
- C++ floating point to integer type conversions
- How to get an average in C++?
- C++: variable ‘std::ifstream ifs’ has initializer but incomplete type
- invalid use of template name without an argument list
- What is “error C2061: syntax error : identifier “?
- What is the size of sizeof(vector)? C++
- C++ – Print Out Objects From Set
- Why virtual & static keywords aren’t allowed outside class declaration?