I've been at this for days now - the BGI (Borland Graphics Interface) is crashing the linker in Visual Studio 2005.
I've written a moderately complex program (it's a game) which calls a function called showGraphic(int id)
from the title screen to draw a picture on screen.
The plotting is done, the program works before hand, everything works...
Then I implemented the graphics, and now I get 5 linking errors LNK2019 - Unresolved External Symbols
and a sixth error telling me about these 5 errors LNK1120
Problem is, I don't know what's wrong with it, I've check syntax time and time again, checked StackOverflow, checked Visual C++ documentation, just about everything - I even injected the part of the program that draws the graphics into another program and it worked fine!
I've tried compiling, recompiling, building, and deleted the debug files to force recompilation, but nothing of the sort has worked. The computer has been restarted multiple times by now, and nothing seems to fix it.
Everything points to problems with objects in the program not sharing variables - but I'm doing most of the program procedurally, and this is an impossible conclusion.
All variables being passed into the function are static, as well as the variables being passed to the BGI.
Here's a list of the functions causing the linking errors, if applicable:
initwindow(int width,int height,char title);
line(int x1,int y1,int x2,int y2);
If I comment the offending lines out, it works fine (even when playing the background music, which is done with an external program). If I so much as let one line in, it immediately throws the error back again. This happens both in showGrapic(); and in the title screen function title();.
Don't ask why we're using such an old system - it's because some developers of this game are still stuck on Windows 2000 with no reliable upgrade path. I'm not here to argue about the use of old software, please.