Hi, @Thomas Timana
If you want to run main_2 instead of main as the entry point, you need to set the entry point:
//turn off /RTC*
#pragma runtime_checks("", off)
//add entry point
#pragma comment(linker, "/ENTRY:main_2")
//add runtime lib
#pragma comment(lib,"ucrtd.lib")
#pragma comment(lib,"vcruntimed.lib")
Console sample:
#include<iostream>
// turn off /RTC*
#pragma runtime_checks("", off)
#pragma comment(linker, "/ENTRY:main_2")
#pragma comment(lib,"ucrtd.lib")
#pragma comment(lib,"vcruntimed.lib")
int main_2()
{
std::cout << "hello main 2";
return 0;;
}
int main()
{
std::cout << "hello main 1 ";
return 0;
}
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.