So Ive been dealing with some errors, and I finally got rid of one but the moment I did I got two errors. Managed to fix one, but I'm stuck with a link 1109 error, and this actually happened earlier before and I don't know what exactly it is that I did that prevented it from coming back. Any ideas and anyone know why this is happening? Also, I was reading through the error and it's not saying it's in a certain file, rather it's the entire project, even so I'm only inserting the source.cpp file.
int PlayerLevel = 2;
int healthpotcount = 0;
int money = 0;
std::string name;
std::string choice1;
char choice2;
std::string choice3;
std::string choice4;
//will be completed once all variables and classes are completed.
void shopkeep(int money, int invspace, std::string name, std::string classname);
//shop function
void shopkeep(int health, int money, int invspace, std::string name, std::string classname)
{
std::cout << "Hello " << name << ", do you wish to purchase items or sell your belongings off? You have " << money << " money to spend." << std::endl;
std::cin >> choice1;
if (choice1 == "purchase")
{
if (classname == "knight")
{
std::cout << "We have the following items available for you to purchase: (1.) Armor plates(costs 60 gold), (4.) Steel armor(costs 150 gold), (3.) Health potions(costs 40 gold)." << std::endl;
std::cin >> choice2;
switch (choice2)
{
case 1:
if (money >= 60)
{
std::cout << "Thank you for purchasing our armor. You have " << money << " money to spend." << std::endl;
money = money - 60;
}
}
}
if (classname == "archer")
{
std::cout << "We have the following items available for your purchase: (1.) Leather padding(costs 50 gold), (2.) Arrows for you to use(20 gold), (3.) Health potions(40 gold)." << std::endl;
}
}
else if (choice1 == "sell")
{
}
else
{
std::cout << "Okay, I don't understand what you just said. Let's try this again." << std::endl;
shopkeep(money, invspace, name, classname);
}
}
Since you did not provide your header files, I can't compile your program to try and duplicate your problem.
However, as Handy Andy suggested, this may be related to anti-virus software.
I occasionally have similar problems with anti-virus software keeping open the output file from the link when I am trying to recompile. I get around it by renaming the output file of the link. Eventually the anti-virus software closes the original output file and I can delete it.
Try turning off your anti-virus software to see if the problem goes away.