#376 C++ project linker error, builds fine in the IDE

cvs
closed-fixed
Tasks (408)
5
2015-01-28
2005-04-20
No

I have two C++ projects that compile and link correctly
under Visual Studio. One project uses a class defined
in the other. Under Nant 0.85 nightly build from 4/14,
the build ends with a linker error. I get the
following output:

[solution] Starting solution build.
[solution] Loading projects...
[solution] Loading project
'C:\Centrics\Repro\SlipperyScanner\SlipperyScanner.vcproj'.
[solution] Loading referenced project
'C:\Centrics\Repro\SlipperyBaseSupport\SlipperyBaseSupport.vcproj'.
[solution] Loading project
'C:\Centrics\Repro\SlipperyBaseSupport\SlipperyBaseSupport.vcproj'.
[solution] Gathering additional dependencies...
[solution] Fixing up references...
[solution] Building 'SlipperyBaseSupport' [Debug] ...
[attrib] No matching files or
directories found.
[cl]
'C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\SlipperyBaseSupport.pch'
does not exist, recompiling.
[cl] Compiling 1 files to
'C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug'.
[cl] Contents of C:\TEMP\tmp3A55.tmp.
[cl] /c
[cl] /D "_WINDOWS"
[cl] /D "WIN32"
[cl] /D "_DEBUG"
[cl] /D "_CONSOLE"
[cl] /D " SlipperyBASE_EXPORTS"
[cl]
/Fd"C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\vc70.pdb"
[cl]
/Fo"C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\\"
[cl]
/Fp"C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\SlipperyBaseSupport.pch"
[cl] /Yc"StdAfx.h"
[cl]
"C:\Centrics\Repro\SlipperyBaseSupport\.\stdafx.cpp"
[cl] /D "_MBCS"
[cl]
[cl] Starting 'cl
(@"C:\TEMP\tmp3A55.tmp" /EHsc /D _WINDLL /Gm /W3 /MLd
/Wp64 /RTC1 /ZI /Od /nologo)' in
'C:\Centrics\Repro\SlipperyBaseSupport'
[cl] stdafx.cpp
[link] PDB file
'C:\Centrics\Repro\SlipperyBaseSupport\Debug\SlipperyBaseSupport.pdb'
does not exist, relinking.
[link] Linking 16 files.
[link] Contents of C:\TEMP\tmp3A56.tmp.
[link]
/OUT:"C:\Centrics\Repro\SlipperyBaseSupport\Debug\SlipperyBaseSupport.dll"
[link] /LIBPATH:"..\Lib"
[link] /DEBUG
[link]
/PDB:"C:\Centrics\Repro\SlipperyBaseSupport\Debug\SlipperyBaseSupport.pdb"
[link] /nologo
[link] "kernel32.lib"
[link] "user32.lib"
[link] "gdi32.lib"
[link] "winspool.lib"
[link] "comdlg32.lib"
[link] "advapi32.lib"
[link] "shell32.lib"
[link] "ole32.lib"
[link] "oleaut32.lib"
[link] "uuid.lib"
[link] "odbc32.lib"
[link] "odbccp32.lib"
[link] "winmm.lib"
[link]
"C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\SlipperyController.obj"
[link]
"C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\ReproBase.obj"
[link]
"C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\stdafx.obj"
[link]
[link] Starting 'link
(@"C:\TEMP\tmp3A56.tmp"
/IMPLIB:"C:\Centrics\Repro\lib\SlipperyBaseSupportD.lib"
/DLL /INCREMENTAL /SUBSYSTEM:CONSOLE /MACHINE:X86)' in
'C:\Centrics\Repro\SlipperyBaseSupport'
[link] LINK : LNK6004:
C:\Centrics\Repro\SlipperyBaseSupport\Debug\SlipperyBaseSupport.dll
not found or not built by the last incremental link;
performing full link
[link] Creating library
C:\Centrics\Repro\lib\SlipperyBaseSupportD.lib and
object C:\Centrics\Repro\lib\SlipperyBaseSupportD.exp
[link] ReproBase.obj : warning
LNK4099: PDB 'vc70.pdb' was not found with
'C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\ReproBase.obj'
or at
'C:\Centrics\Repro\SlipperyBaseSupport\Debug\vc70.pdb';
linking object as if no debug info
[link] SlipperyController.obj :
warning LNK4099: PDB 'vc70.pdb' was not found with
'C:\Centrics\Repro\SlipperyBaseSupport\intermediate\Debug\SlipperyController.obj'
or at
'C:\Centrics\Repro\SlipperyBaseSupport\Debug\vc70.pdb';
linking object as if no debug info
[solution] Copying references:
[solution] Fixing up references...
[solution] Building 'SlipperyScanner' [Debug] ...
[attrib] No matching files or
directories found.
[cl]
'C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\SlipperyScanner.pch'
does not exist, recompiling.
[cl] Compiling 1 files to
'C:\Centrics\Repro\SlipperyScanner\intermediate\Debug'.
[cl] Contents of C:\TEMP\tmp3A5A.tmp.
[cl] /c
[cl] /clr
[cl] /D "WIN32"
[cl] /D "_DEBUG"
[cl] /D " _WINDOWS"
[cl] /I
"C:\Centrics\Repro\SlipperyBaseSupport"
[cl] /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll"
[cl] /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Data.dll"
[cl] /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.dll"
[cl] /FU
"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\System.Drawing.dll"
[cl]
/Fd"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\vc70.pdb"
[cl]
/Fo"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\\"
[cl]
/Fp"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\SlipperyScanner.pch"
[cl] /Yc"StdAfx.h"
[cl]
"C:\Centrics\Repro\SlipperyScanner\.\Stdafx.cpp"
[cl] /D "_MBCS"
[cl]
[cl] Starting 'cl
(@"C:\TEMP\tmp3A5A.tmp" /Zl /EHsc /D _WINDLL /W3 /MTd
/Zi /Od /nologo)' in 'C:\Centrics\Repro\SlipperyScanner'
[cl] Stdafx.cpp
[link] PDB file
'C:\Centrics\Repro\SlipperyScanner\Debug\SlipperyScanner.pdb'
does not exist, relinking.
[link] Linking 20 files.
[link] Contents of C:\TEMP\tmp3A5B.tmp.
[link]
/OUT:"C:\Centrics\Repro\SlipperyScanner\Debug\SlipperyScanner.dll"
[link] /LIBPATH:"C:\Centrics\Repro\lib"
[link] /DEBUG
[link]
/PDB:"C:\Centrics\Repro\SlipperyScanner\Debug\SlipperyScanner.pdb"
[link] /nologo
[link] "kernel32.lib"
[link] "user32.lib"
[link] "gdi32.lib"
[link] "winspool.lib"
[link] "comdlg32.lib"
[link] "advapi32.lib"
[link] "shell32.lib"
[link] "ole32.lib"
[link] "oleaut32.lib"
[link] "uuid.lib"
[link] "odbc32.lib"
[link] "odbccp32.lib"
[link] "mscoree.lib"
[link] "msvcrt.lib"
[link] "nochkclr.obj"
[link]
"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\AssemblyInfo.obj"
[link]
"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\SlipperyScanner.obj"
[link]
"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\ReproClass.obj"
[link]
"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\Stdafx.obj"
[link]
"C:\Centrics\Repro\SlipperyScanner\intermediate\Debug\app.res"
[link]
[link] Starting 'link
(@"C:\TEMP\tmp3A5B.tmp" /DLL /INCREMENTAL
/ASSEMBLYDEBUG /noentry)' in
'C:\Centrics\Repro\SlipperyScanner'
[link] Creating library
C:\Centrics\Repro\SlipperyScanner\Debug\SlipperyScanner.lib
and object
C:\Centrics\Repro\SlipperyScanner\Debug\SlipperyScanner.exp
[link] SlipperyScanner.obj : error
LNK2001: unresolved external symbol "public: __thiscall
SlipperyController::SlipperyController(void)"
(??0SlipperyController@@$$FQAE@XZ)
[link] SlipperyScanner.obj : error
LNK2001: unresolved external symbol "public: void
__thiscall SlipperyController::OpenScanner(int)"
(?OpenScanner@SlipperyController@@$$FQAEXH@Z)
[link]
C:\Centrics\Repro\SlipperyScanner\Debug\SlipperyScanner.dll
: fatal error LNK1120: 2 unresolved externals

BUILD FAILED

External Program Failed: link (return code was 1120)

Discussion

  • Gert Driesen

    Gert Driesen - 2005-04-20

    Logged In: YES
    user_id=707851

    Look like a duplicate of bug #1124296.

     
  • Steve Brennan

    Steve Brennan - 2005-05-06

    Simple repro soultion with two C++ projects

     
  • Gert Driesen

    Gert Driesen - 2005-05-29

    Logged In: YES
    user_id=707851

    This is now fixed in cvs.

    Thanks for the report and the repro !

     
  • Gert Driesen

    Gert Driesen - 2005-05-29
    • labels: 699000 --> Tasks
    • milestone: --> cvs
    • assigned_to: nobody --> drieseng
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks