Nested static libraries in Visual Studio?

I have a static library for implementation Vector

in C.

Now I am creating a new library that will rely on Vector

to use the property. This new library is called String

. Both are static libraries created in Visual Studio with their own files .c

and .h

.

I do the following as if I was linking to any other static library

  • Create a new static library. Create it .c

    and .h

    files.

  • project -> properties -> C/C++ -> Additional include directories

    and set as the folder containing files .c

    and .h

    for myVector

  • File -> Add -> Existing Project

    and install the .vcxproj

    project file Vector

    .

  • In my solution explorer, I got under my solution String

    and right clicked References

    and then check the checked box Vector

    .

At this moment mine String

now sees correctly Vector

.

Problem

When I open a new project, repeat the same steps, except as the String

target library, I get the following error:

Severity    Code    Description Project File    Line    Suppression State
Error   MSB8006 The Platform for project 'C-DataStructuresLib.vcxproj' is invalid.  Platform='HPD'. This error may also appear if some other project is trying to follow a project-to-project reference to this project, this project has been unloaded or is not included in the solution, and the referencing project does not build using the same or an equivalent Platform.    CStringLib  C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.InvalidPlatform.Targets    21

      

Line:

This error can also appear if some other project tries to follow a project reference for the project, that project has been unloaded or is not included in the solution, and the reference project is not being built using the same or equivalent platform

Correct, because that's exactly what I'm trying to do. How can this be fixed?

+3


source to share


1 answer


Are you trying to compile as a 64 bit project?
Go to the properties page of the section: Linker → Advanced → Target Machine



-1


source







All Articles