Original Post
Hi all! I have a solution in Visual Studio 2005 with 4 projects. I've set up the dependencies in the configuration manager so that any projects relying on other projects get compiled last. I've also set up a working directory for all the projects (which is the same). However, this is the first time that I've tried adding multiple projects like this. Project A has a single file called Main.cpp in it which has the program main entry point. Project B has a number of maths library files in it. Previously Main.cpp lived in Project B but I moved it and changed all the #include headers to correspond with its new location. Project A is set to be the startup project. Previously the code compiled and ran correctly. LNK2019 definition here http://msdn.microsoft.com/en-us/library/799kze2z(VS.80).aspx states that something defined before the main entry point cannot be found despite it being declared (and used). I'm guessing it's compiling the files correctly but can't find them during linkage, which is why I'm getting the errors in Main.obj. Ignore the sampleshader.fx compile error for now. I can fix that. Can anyone provide any insight as to the link error? The message that I receive is as below: ------ Build started: Project: PiMathLib, Configuration: Debug_DirecX9 Win32 ------ Linking... MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup C:\Documents and Settings\Gareth\My Documents\Visual Studio 2005\Projects\Pilot\Debug_DirecX9\PiMathLib.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at "file://c:\Documents and Settings\Gareth\My Documents\Visual Studio 2005\Projects\Pilot\PiMathLib\Debug_DirecX9\BuildLog.htm" PiMathLib - 2 error(s), 0 warning(s) ------ Build started: Project: PiRenderer, Configuration: Debug Win32 ------ Performing Custom Build Step Microsoft (R) D3D10 Shader Compiler 9.19.949.2187 Copyright (C) Microsoft Corporation 2002-2007. All rights reserved. failed to open file: c:\Documents and Settings\Gareth\My Documents\Visual Studio 2005\Projects\Pilot\PiRenderer\SampleShader.fx compilation failed; no code produced Build log was saved at "file://c:\Documents and Settings\Gareth\My Documents\Visual Studio 2005\Projects\Pilot\PiRenderer\Debug\BuildLog.htm" PiRenderer - 0 error(s), 0 warning(s) ------ Build started: Project: PilotDX9, Configuration: Debug Win32 ------ Linking... Main.obj : error LNK2019: unresolved external symbol "public: __thiscall PiMaths::PiVector3::PiVector3(float,float,float)" (??0PiVector3@PiMaths@@QAE@MMM@Z) referenced in function "bool __cdecl TestMatrix22(void)" (?TestMatrix22@@YA_NXZ) Main.obj : error LNK2019: unresolved external symbol "public: class PiMaths::PiVector3 __thiscall PiMaths::PiVector3::operator-(class PiMaths::PiVector3 &)" (??GPiVector3@PiMaths@@QAE?AV01@AAV01@@Z) referenced in function "public: bool __thiscall PiPrims::PiSphere::IsPointInside(class PiMaths::PiVector3 &)" (?IsPointInside@PiSphere@PiPrims@@QAE_NAAVPiVector3@PiMaths@@@Z) Main.obj : error LNK2019: unresolved external symbol "public: bool __thiscall PiPrims::PiCylinder::IsPointInside(class PiMaths::PiVector3 &)" (?IsPointInside@PiCylinder@PiPrims@@QAE_NAAVPiVector3@PiMaths@@@Z) referenced in function "bool __cdecl TestCylinder(void)" (?TestCylinder@@YA_NXZ) C:\Documents and Settings\Gareth\My Documents\Visual Studio 2005\Projects\Pilot\Debug\PilotDX9.exe : fatal error LNK1120: 3 unresolved externals Build log was saved at "file://c:\Documents and Settings\Gareth\My Documents\Visual Studio 2005\Projects\Pilot\PilotDX9\Debug\BuildLog.htm" PilotDX9 - 4 error(s), 0 warning(s) ========== Build: 1 succeeded, 2 failed, 1 up-to-date, 0 skipped ==========