Thread: Linker problem... no idea

  1. #1
    uh oh
    Join Date
    Jan 2005
    Location
    Ontario, CA
    Posts
    66

    Linker problem... no idea

    I'm using VC2008, and currently my linker options look as follows under Properties:

    Code:
    /OUT:"C:\Documents and Settings\scott\My Documents\Visual Studio 2008\Projects\DynaTem\Debug\DTC.cgi" 
    /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTFILE:"Debug\DTC.cgi.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" 
    /DEBUG /PDB:"C:\Documents and Settings\scott\My Documents\Visual Studio 2008\Projects\DynaTem\Debug\DTC.pdb" 
    /SUBSYSTEM:CONSOLE /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:PROMPT 
    kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib 
    odbccp32.lib "..\debug\dynacgi.lib"
    The dynacgi.lib file is located in $(SolutionDir)\Debug, and the project trying to include it is located in $(SolutionDir)\DTC. Now I have tried adding the full path to the linker options, however, the oddest part about it is I can't seem to find a way to get this option out of my linker... and strangest yet is how the compiler seems to be trying to add the library... the actual error is:

    2>LINK : fatal error LNK1104: cannot open file '../../Debug/DynaCGI.lib'

    Should the above path not be matching what is in the options? I even tried the #pragma comment(lib, "..\Debug\DynaCGI.lib") and I get the exact same error. Perhaps the #pragma is properly linking, but the linker itself is still trying to use the other (however it seemed to have obtained this 'path')?

    Any help would be greatly appreciated as I really don't know why this is happening... and I've just spent the last two hours scouring through the Properties of my solution & projects as well as message boards for similar problems... have yet to find anything that would be any help whatsoever.

    Thanks!
    Last edited by cyreon; 04-03-2009 at 02:31 PM.

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Why are you manipulating the linker flags at all? If you simply add the DynaCGI project as a dependency of DTC, VS should figure this all out for you.

    Select the DTC project, then go Menu->Project->Project Dependencies, find DynaCGI in the list and check the check box.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    uh oh
    Join Date
    Jan 2005
    Location
    Ontario, CA
    Posts
    66
    Its already done but, everytime (whether I try to add it manually or not) it attempts to add "../../debug/dynacgi.lib" and fails. I am simply troubleshooting the issue by attempting various methods to get it to link with the correct path instead of this one.

    I also just tried wiping out everything but the project files and, all references to manual attempts have been removed, and I still am getting this same result. I may have to wipe out the solution and start it over, unless there are any other insights?

    Update: Not sure why but, I did had to erase the entire projects and recreate them under a new solution. Reconfigure the solution and projects, as well as the project dependencies. Nothing was setup any different then the last time, however, now the linker was obsessed with the "false" path.
    Last edited by cyreon; 04-03-2009 at 03:16 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linker problem with template traits/policy on MSVS 2005
    By MarkZWEERS in forum C++ Programming
    Replies: 3
    Last Post: 10-24-2008, 04:01 AM
  2. Linker Error problem
    By 7smurfs in forum C++ Programming
    Replies: 9
    Last Post: 06-07-2005, 10:28 AM
  3. linker problem with mysql
    By august_01 in forum C++ Programming
    Replies: 1
    Last Post: 04-24-2005, 11:04 AM
  4. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  5. IDEA: Problem Solving Contests
    By ygfperson in forum Contests Board
    Replies: 8
    Last Post: 10-19-2002, 08:38 PM