class EventArgs {
public:
static const EventArgs Empty;
virtual ~EventArgs();
};
const EventArgs EventArgs::Empty = EventArgs();
#include "Terminal.h"
#include "Types/EventArgs.h"
#include "string"
using namespace std;
void BasicTerminal::AddNewCommand(string command, TFunction exe_function, string description)
{
functions.push_back(exe_function);
commands.push_back(command);
descriptions.push_back(description);
}
EventArgs BasicTerminal::Execute(string input_command, CmdEventArgs args)
{
int index;
for(int i = 0; i < commands.size(); i++)
{
if (input_command == commands[i]) index = i;
}
return functions[index](args);
}
BasicTerminal term;
EventArgs Hello(CmdEventArgs args)
{
cout << "hello" << endl;
return EventArgs::Empty;
}
int main()
{
term.AddNewCommand("hello", Hello, "prints hello");
term.Execute("hello", CmdEventArgs::Empty);
}
"profiles": {
"DemoApplication.Server.Server": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7005;http://localhost:5005",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
g++.exe D:\Projects\TerminalHelper\Terminal.cpp -o Terminal
D:\Games\CLion 2023.3\bin\mingw\bin/ld.exe: C:\Users\SAVVAN~1\AppData\Local\Temp\ccbgWMrS.o:Terminal.cpp:(.text+0x2d4): undefined reference to `EventArgs::~EventArgs()'
D:\Games\CLion 2023.3\bin\mingw\bin/ld.exe: C:\Users\SAVVAN~1\AppData\Local\Temp\ccbgWMrS.o:Terminal.cpp:(.text$_ZN12CmdEventArgsC1ERKS_[_ZN12CmdEventArgsC1ERKS_]+0x64): undefined reference to `EventArgs::~EventArgs()'
D:\Games\CLion 2023.3\bin\mingw\bin/ld.exe: C:\Users\SAVVAN~1\AppData\Local\Temp\ccbgWMrS.o:Terminal.cpp:(.text$_ZN12CmdEventArgsD1Ev[_ZN12CmdEventArgsD1Ev]+0x32): undefined reference to `EventArgs::~EventArgs()'
D:\Games\CLion 2023.3\bin\mingw\bin/ld.exe: C:\Users\SAVVAN~1\AppData\Local\Temp\ccbgWMrS.o:Terminal.cpp:(.rdata$.refptr._ZN12CmdEventArgs5EmptyE[.refptr._ZN12CmdEventArgs5EmptyE]+0x0): undefined reference to `CmdEventArgs::Empty'
D:\Games\CLion 2023.3\bin\mingw\bin/ld.exe: C:\Users\SAVVAN~1\AppData\Local\Temp\ccbgWMrS.o:Terminal.cpp:(.rdata$.refptr._ZN9EventArgs5EmptyE[.refptr._ZN9EventArgs5EmptyE]+0x0): undefined reference to `EventArgs::Empty'
D:\Games\CLion 2023.3\bin\mingw\bin/ld.exe: C:\Users\SAVVAN~1\AppData\Local\Temp\ccbgWMrS.o:Terminal.cpp:(.rdata$.refptr._ZTV9EventArgs[.refptr._ZTV9EventArgs]+0x0): undefined reference to `vtable for EventArgs'
collect2.exe: error: ld returned 1 exit status
но я не понял почему она изменилась(я убрал строку и ошибка поменялась, но когда добавил обратно ничего не изменилось