I have created a static library for the following class, libtgbotengine.a
and extern
ed 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 extern
ing myTgBotEngine
help me achieve this?
project2.cpp
int main(){
myTgBotEngine.start();
return 0;
}