I have created a static library for the following class, libtgbotengine.a and externed the class to be used in a different project.
tgbotengine.h
#include <tgbot/tgbot.h>
// Other headers
// ...
class TgBotEngine{
public:
// Class constructors and functions
// ...
void start();
private:
TgBot::Bot m_bot;
std::vector<TgBot::BotCommand::Ptr> m_commands;
// Other members
// ...
}
extern TgBotEngine myTgBotEngine;
In a different project, I want to link libtgbotengine.a with the following cpp file. My goal is to not to include tgbotengine.h. Is externing myTgBotEngine help me achieve this?
project2.cpp
int main(){
myTgBotEngine.start();
return 0;
}