Alright why I get errors here?
I did exactly as it said.
Code:
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
char x;
cout << "A) Add this program to startup";
cout << "B) Exit \n\n";
cin >> x;
if(x == 'a')
{
extern "C" BOOL xAddSelfAsStartupShortcut(LPCTSTR szLinkTitle, LPCTSTR szDescription, LPCTSTR szArguments, int IconResourceID);
xAddSelfAsStartupShortcut(TEXT("My Program"), TEXT("My description"), NULL, -1);
return 0;
}
if(x == 'b')
{
return 0;
}
else
{
cout << "Wrong input! \n\n";
main();
}
return 0;
}
Pictures:
I got the startup code added to my project as a .c file
I got the linker options added to the project
The errors
Whats wrong?
I used anonytmouse's code from his link.