Linker Can't Find Library

  • Follow


Hi Folks:

   Developing on Win 7 Ultimate, VS 2010 Pro.

   I'm doing something dumb, and I'm not seeing it.

   This is a C++ application with three executables.

   Each executable relies on static libraries of code common to all of
the modules.

   After moving development from XP Pro, VS 2008 Pro, one of these
modules keeps throwing "error LNK2019: unresolved external symbol" for
symbols defined in these common libraries.

   The other two executables compile and link with these static
libraries, no problem.

   The static libraries show up on the Solution Explorer, and I can
click on a C++ file in the solution explorer to display the function
or global constant the the linker can't find.

   I have the libraries checked in the Project Dependencies window.

   I've attempted to un-check dependencies when working with the two
working modules, and am greeted with a popup that says "This
dependency was added by the project system and cannot be removed".

   I can check or un-check the dependencies for the executable that
fails to build, with no popup.

   I've spend a frustrating day on this.  Any idea of what I'm doing
wrong?

             Thanks
             Larry
0
Reply Larry 2/7/2011 1:25:03 PM

On Mon, 7 Feb 2011 05:25:03 -0800 (PST), Larry Lindstrom
<larryl_turbo@hotmail.com> wrote:

>Hi Folks:
>
>   Developing on Win 7 Ultimate, VS 2010 Pro.
>
>   I'm doing something dumb, and I'm not seeing it.
>
>   This is a C++ application with three executables.
>
>   Each executable relies on static libraries of code common to all of
>the modules.
>
>   After moving development from XP Pro, VS 2008 Pro, one of these
>modules keeps throwing "error LNK2019: unresolved external symbol" for
>symbols defined in these common libraries.
>
>   The other two executables compile and link with these static
>libraries, no problem.
>
>   The static libraries show up on the Solution Explorer, and I can
>click on a C++ file in the solution explorer to display the function
>or global constant the the linker can't find.
>
>   I have the libraries checked in the Project Dependencies window.
>
>   I've attempted to un-check dependencies when working with the two
>working modules, and am greeted with a popup that says "This
>dependency was added by the project system and cannot be removed".
>
>   I can check or un-check the dependencies for the executable that
>fails to build, with no popup.
>
>   I've spend a frustrating day on this.  Any idea of what I'm doing
>wrong?
>


It sounds like your 3rd module isn't explicitly linked to the common
libraries. In VS2010 they're set independently in Project | Properties
| Linker | Input | Additional Dependencies for each project in the
solution.
0
Reply Geoff 2/7/2011 4:42:38 PM


On Feb 7, 8:42=A0am, Geoff <ge...@invalid.invalid> wrote:
> On Mon, 7 Feb 2011 05:25:03 -0800 (PST), Larry Lindstrom
>
>
>
> <larryl_tu...@hotmail.com> wrote:
> >Hi Folks:
>
> > =A0 Developing on Win 7 Ultimate, VS 2010 Pro.
>
> > =A0 I'm doing something dumb, and I'm not seeing it.
>
> > =A0 This is a C++ application with three executables.
>
> > =A0 Each executable relies on static libraries of code common to all of
> >the modules.
>
> > =A0 After moving development from XP Pro, VS 2008 Pro, one of these
> >modules keeps throwing "error LNK2019: unresolved external symbol" for
> >symbols defined in these common libraries.

   < Snip >

> It sounds like your 3rd module isn't explicitly linked to the common
> libraries. In VS2010 they're set independently in Project | Properties
> | Linker | Input | Additional Dependencies for each project in the
> solution.

Thanks Geoff:

   That seems to work, as I explicitly identify libraries in the
project's linker property, the unresolved external errors for symbols
in these libraries go away.  New unresolved external symbol errors are
generated for references made by these libraries.

   Complicating this is that these libraries haven't had .lib files
generated in their <lib_name>\debug and
<lib_name>\release directories, even though I've run "Rebuild
Solution" for both debug and release versions of the application.

   So I have to open each library and run debug and release builds.
This does build the .lib files.

   I have a lot of libraries, and this is very time consuming.  Like
everybody else, time is tight for me and I'd rather put effort into
cutting code.

   The three executables are, an install module, the application, and
an uninstall module.

   The install module is the one that fails with these linker
errors.

   The other two modules apparently can be built from the .obj files
in the <lib_name>\<lib_name>\debug and <lib_name>\<lib_name>\release
directories, by File - Add - Existing Project and specifying
<lib_name>.

   Is there some method to make the install module use the same
resources the other modules use when they build?

   Geoff, I appreciate your assistance.

                      Thanks
                      Larry
0
Reply Larry 2/7/2011 10:56:10 PM

On Mon, 7 Feb 2011 14:56:10 -0800 (PST), Larry Lindstrom
<larryl_turbo@hotmail.com> wrote:

>On Feb 7, 8:42�am, Geoff <ge...@invalid.invalid> wrote:
>> On Mon, 7 Feb 2011 05:25:03 -0800 (PST), Larry Lindstrom
>>
>>
>>
>> <larryl_tu...@hotmail.com> wrote:
>> >Hi Folks:
>>
>> > � Developing on Win 7 Ultimate, VS 2010 Pro.
>>
>> > � I'm doing something dumb, and I'm not seeing it.
>>
>> > � This is a C++ application with three executables.
>>
>> > � Each executable relies on static libraries of code common to all of
>> >the modules.
>>
>> > � After moving development from XP Pro, VS 2008 Pro, one of these
>> >modules keeps throwing "error LNK2019: unresolved external symbol" for
>> >symbols defined in these common libraries.
>
>   < Snip >
>
>> It sounds like your 3rd module isn't explicitly linked to the common
>> libraries. In VS2010 they're set independently in Project | Properties
>> | Linker | Input | Additional Dependencies for each project in the
>> solution.
>
>Thanks Geoff:
>
>   That seems to work, as I explicitly identify libraries in the
>project's linker property, the unresolved external errors for symbols
>in these libraries go away.  New unresolved external symbol errors are
>generated for references made by these libraries.
>
>   Complicating this is that these libraries haven't had .lib files
>generated in their <lib_name>\debug and
><lib_name>\release directories, even though I've run "Rebuild
>Solution" for both debug and release versions of the application.
>
>   So I have to open each library and run debug and release builds.
>This does build the .lib files.
>
>   I have a lot of libraries, and this is very time consuming.  Like
>everybody else, time is tight for me and I'd rather put effort into
>cutting code.

Batch build might be the solution here.

>
>   The three executables are, an install module, the application, and
>an uninstall module.
>
>   The install module is the one that fails with these linker
>errors.
>
>   The other two modules apparently can be built from the .obj files
>in the <lib_name>\<lib_name>\debug and <lib_name>\<lib_name>\release
>directories, by File - Add - Existing Project and specifying
><lib_name>.
>
Tweak project dependencies perhaps?

>   Is there some method to make the install module use the same
>resources the other modules use when they build?
>

The modules I've done are all independent but transferred from VS6 to
VS2010. I spent hours getting it back into shape so I could build and
debug all three DLLs at once in the new toolset. The migration path is
painful and I am far from expert at it.
0
Reply Geoff 2/8/2011 12:41:39 AM

On Feb 7, 4:41=A0pm, Geoff <ge...@invalid.invalid> wrote:
> On Mon, 7 Feb 2011 14:56:10 -0800 (PST), Larry Lindstrom
>
>
>
> <larryl_tu...@hotmail.com> wrote:
> >On Feb 7, 8:42=A0am, Geoff <ge...@invalid.invalid> wrote:
> >> On Mon, 7 Feb 2011 05:25:03 -0800 (PST), Larry Lindstrom
>
> >> <larryl_tu...@hotmail.com> wrote:
> >> >Hi Folks:
>
> >> > =A0 Developing on Win 7 Ultimate, VS 2010 Pro.
>
> >> > =A0 I'm doing something dumb, and I'm not seeing it.
>
> >> > =A0 This is a C++ application with three executables.
>
> >> > =A0 Each executable relies on static libraries of code common to all=
 of
> >> >the modules.
>
> >> > =A0 After moving development from XP Pro, VS 2008 Pro, one of these
> >> >modules keeps throwing "error LNK2019: unresolved external symbol" fo=
r
> >> >symbols defined in these common libraries.
>
> > =A0 < Snip >
>
> >> It sounds like your 3rd module isn't explicitly linked to the common
> >> libraries. In VS2010 they're set independently in Project | Properties
> >> | Linker | Input | Additional Dependencies for each project in the
> >> solution.
>
> >Thanks Geoff:
>
> > =A0 That seems to work, as I explicitly identify libraries in the
> >project's linker property, the unresolved external errors for symbols
> >in these libraries go away. =A0New unresolved external symbol errors are
> >generated for references made by these libraries.
>
> > =A0 Complicating this is that these libraries haven't had .lib files
> >generated in their <lib_name>\debug and
> ><lib_name>\release directories, even though I've run "Rebuild
> >Solution" for both debug and release versions of the application.
>
> > =A0 So I have to open each library and run debug and release builds.
> >This does build the .lib files.
>
> > =A0 I have a lot of libraries, and this is very time consuming. =A0Like
> >everybody else, time is tight for me and I'd rather put effort into
> >cutting code.
>
> Batch build might be the solution here.
>
>
>
> > =A0 The three executables are, an install module, the application, and
> >an uninstall module.
>
> > =A0 The install module is the one that fails with these linker
> >errors.
>
> > =A0 The other two modules apparently can be built from the .obj files
> >in the <lib_name>\<lib_name>\debug and <lib_name>\<lib_name>\release
> >directories, by File - Add - Existing Project and specifying
> ><lib_name>.
>
> Tweak project dependencies perhaps?
>
> > =A0 Is there some method to make the install module use the same
> >resources the other modules use when they build?
>
> The modules I've done are all independent but transferred from VS6 to
> VS2010. I spent hours getting it back into shape so I could build and
> debug all three DLLs at once in the new toolset. The migration path is
> painful and I am far from expert at it.

Thanks Geoff:

    I appreciate your information.  I think I'll take this to the
Microsoft forums.

                      Larry
0
Reply Larry 2/8/2011 7:42:41 PM

4 Replies
423 Views

(page loaded in 0.095 seconds)

Similiar Articles:













7/24/2012 5:57:03 AM


Reply: