Build solution fails because of linker errors on newly added projects
up vote
3
down vote
favorite
I have a solution in VS 2015 which makes use of multiple similar projects.
I added two new ones from a provided template and now building the entire solution shows two linker errors on those two projects.
I have compared configuration with other similar projects within the solution and everything was exactly the same. Building the projects one by one is successful.
At the Linker properties-> Input-> Additional dependencies I have the following libraries, created from other projects within the solution:
CommonLib.lib;UsermodeLibrary.lib
And the linker error I get is either:
Error LNK1181 cannot open input file 'CommonLib.lib' ProjectName
Or:
Error LNK1181 cannot open input file 'UsermodeLibrary.lib' ProjectName
I put the projects in the same folder as the others, and the solution makes use of filters.
c visual-studio-2015 linker
add a comment |
up vote
3
down vote
favorite
I have a solution in VS 2015 which makes use of multiple similar projects.
I added two new ones from a provided template and now building the entire solution shows two linker errors on those two projects.
I have compared configuration with other similar projects within the solution and everything was exactly the same. Building the projects one by one is successful.
At the Linker properties-> Input-> Additional dependencies I have the following libraries, created from other projects within the solution:
CommonLib.lib;UsermodeLibrary.lib
And the linker error I get is either:
Error LNK1181 cannot open input file 'CommonLib.lib' ProjectName
Or:
Error LNK1181 cannot open input file 'UsermodeLibrary.lib' ProjectName
I put the projects in the same folder as the others, and the solution makes use of filters.
c visual-studio-2015 linker
Have you checked that the linker actually searches the directory where the .lib files are? Try setting the 'Additional dependencies' paths to absolute paths of the libs are for the time being. If that works, the path you specified is just wrong, i.e. your .lib files aren't actually in the root folder of the project.
– nm_tp
Nov 22 at 10:22
Also, in VC++ Directories -> Library Directories, you can set the FOLDERS where the linker searches for the libraries, AFAIK. ALSO, check if the settings are set for the configuration you're actually trying to build.
– nm_tp
Nov 22 at 10:25
Thank you for the tips! The settings must be very specific to the new projects because I get the errors only on the new ones I added, even though I put them in the exact same folder with the other similar projects. So far I have checked with a file diff the new and the existing project files and they have the exact same paths configured. I will check the second thing you mentioned, but I did compare that even the build options are the same before asking the question.
– Gy. Timi
Nov 22 at 11:24
Each project requires specific configuration. If the paths aren't configured properly, they might contain some specific values instead of variables whose values are used.
– nm_tp
Nov 22 at 12:16
add a comment |
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have a solution in VS 2015 which makes use of multiple similar projects.
I added two new ones from a provided template and now building the entire solution shows two linker errors on those two projects.
I have compared configuration with other similar projects within the solution and everything was exactly the same. Building the projects one by one is successful.
At the Linker properties-> Input-> Additional dependencies I have the following libraries, created from other projects within the solution:
CommonLib.lib;UsermodeLibrary.lib
And the linker error I get is either:
Error LNK1181 cannot open input file 'CommonLib.lib' ProjectName
Or:
Error LNK1181 cannot open input file 'UsermodeLibrary.lib' ProjectName
I put the projects in the same folder as the others, and the solution makes use of filters.
c visual-studio-2015 linker
I have a solution in VS 2015 which makes use of multiple similar projects.
I added two new ones from a provided template and now building the entire solution shows two linker errors on those two projects.
I have compared configuration with other similar projects within the solution and everything was exactly the same. Building the projects one by one is successful.
At the Linker properties-> Input-> Additional dependencies I have the following libraries, created from other projects within the solution:
CommonLib.lib;UsermodeLibrary.lib
And the linker error I get is either:
Error LNK1181 cannot open input file 'CommonLib.lib' ProjectName
Or:
Error LNK1181 cannot open input file 'UsermodeLibrary.lib' ProjectName
I put the projects in the same folder as the others, and the solution makes use of filters.
c visual-studio-2015 linker
c visual-studio-2015 linker
asked Nov 22 at 10:14
Gy. Timi
161
161
Have you checked that the linker actually searches the directory where the .lib files are? Try setting the 'Additional dependencies' paths to absolute paths of the libs are for the time being. If that works, the path you specified is just wrong, i.e. your .lib files aren't actually in the root folder of the project.
– nm_tp
Nov 22 at 10:22
Also, in VC++ Directories -> Library Directories, you can set the FOLDERS where the linker searches for the libraries, AFAIK. ALSO, check if the settings are set for the configuration you're actually trying to build.
– nm_tp
Nov 22 at 10:25
Thank you for the tips! The settings must be very specific to the new projects because I get the errors only on the new ones I added, even though I put them in the exact same folder with the other similar projects. So far I have checked with a file diff the new and the existing project files and they have the exact same paths configured. I will check the second thing you mentioned, but I did compare that even the build options are the same before asking the question.
– Gy. Timi
Nov 22 at 11:24
Each project requires specific configuration. If the paths aren't configured properly, they might contain some specific values instead of variables whose values are used.
– nm_tp
Nov 22 at 12:16
add a comment |
Have you checked that the linker actually searches the directory where the .lib files are? Try setting the 'Additional dependencies' paths to absolute paths of the libs are for the time being. If that works, the path you specified is just wrong, i.e. your .lib files aren't actually in the root folder of the project.
– nm_tp
Nov 22 at 10:22
Also, in VC++ Directories -> Library Directories, you can set the FOLDERS where the linker searches for the libraries, AFAIK. ALSO, check if the settings are set for the configuration you're actually trying to build.
– nm_tp
Nov 22 at 10:25
Thank you for the tips! The settings must be very specific to the new projects because I get the errors only on the new ones I added, even though I put them in the exact same folder with the other similar projects. So far I have checked with a file diff the new and the existing project files and they have the exact same paths configured. I will check the second thing you mentioned, but I did compare that even the build options are the same before asking the question.
– Gy. Timi
Nov 22 at 11:24
Each project requires specific configuration. If the paths aren't configured properly, they might contain some specific values instead of variables whose values are used.
– nm_tp
Nov 22 at 12:16
Have you checked that the linker actually searches the directory where the .lib files are? Try setting the 'Additional dependencies' paths to absolute paths of the libs are for the time being. If that works, the path you specified is just wrong, i.e. your .lib files aren't actually in the root folder of the project.
– nm_tp
Nov 22 at 10:22
Have you checked that the linker actually searches the directory where the .lib files are? Try setting the 'Additional dependencies' paths to absolute paths of the libs are for the time being. If that works, the path you specified is just wrong, i.e. your .lib files aren't actually in the root folder of the project.
– nm_tp
Nov 22 at 10:22
Also, in VC++ Directories -> Library Directories, you can set the FOLDERS where the linker searches for the libraries, AFAIK. ALSO, check if the settings are set for the configuration you're actually trying to build.
– nm_tp
Nov 22 at 10:25
Also, in VC++ Directories -> Library Directories, you can set the FOLDERS where the linker searches for the libraries, AFAIK. ALSO, check if the settings are set for the configuration you're actually trying to build.
– nm_tp
Nov 22 at 10:25
Thank you for the tips! The settings must be very specific to the new projects because I get the errors only on the new ones I added, even though I put them in the exact same folder with the other similar projects. So far I have checked with a file diff the new and the existing project files and they have the exact same paths configured. I will check the second thing you mentioned, but I did compare that even the build options are the same before asking the question.
– Gy. Timi
Nov 22 at 11:24
Thank you for the tips! The settings must be very specific to the new projects because I get the errors only on the new ones I added, even though I put them in the exact same folder with the other similar projects. So far I have checked with a file diff the new and the existing project files and they have the exact same paths configured. I will check the second thing you mentioned, but I did compare that even the build options are the same before asking the question.
– Gy. Timi
Nov 22 at 11:24
Each project requires specific configuration. If the paths aren't configured properly, they might contain some specific values instead of variables whose values are used.
– nm_tp
Nov 22 at 12:16
Each project requires specific configuration. If the paths aren't configured properly, they might contain some specific values instead of variables whose values are used.
– nm_tp
Nov 22 at 12:16
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
My lab teacher figured this out for me.
For the sake of the answer let's call the new project I added from template "MyProject".
"You have to go the properties of the solution (right click on the solution -> Properties), there you go in the left tab to Common PropertiesProject Dependencies.
After that you choose at the middle top of your projects (ex.: MyProject) and in the bottom window, you have to search for UsermodeLibrary and check/select it as a dependency for the project.
The thing is that every project is configured OK in the Project Properties (linker related and the rest), the only problem is that when you are building the solution it has to know per solution that some projects depend on other projects.
Here the dependency hierarchy is the following:
MyProject -> UsermodeLibrary -> CommonLib (-> means "depends on").
That's why you are seeing that CommonLib can't be linked to the project because it is not built before those applications.
Somehow, your templates miss this setup in regard to the Solution in which they are created."
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53428611%2fbuild-solution-fails-because-of-linker-errors-on-newly-added-projects%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
My lab teacher figured this out for me.
For the sake of the answer let's call the new project I added from template "MyProject".
"You have to go the properties of the solution (right click on the solution -> Properties), there you go in the left tab to Common PropertiesProject Dependencies.
After that you choose at the middle top of your projects (ex.: MyProject) and in the bottom window, you have to search for UsermodeLibrary and check/select it as a dependency for the project.
The thing is that every project is configured OK in the Project Properties (linker related and the rest), the only problem is that when you are building the solution it has to know per solution that some projects depend on other projects.
Here the dependency hierarchy is the following:
MyProject -> UsermodeLibrary -> CommonLib (-> means "depends on").
That's why you are seeing that CommonLib can't be linked to the project because it is not built before those applications.
Somehow, your templates miss this setup in regard to the Solution in which they are created."
add a comment |
up vote
0
down vote
My lab teacher figured this out for me.
For the sake of the answer let's call the new project I added from template "MyProject".
"You have to go the properties of the solution (right click on the solution -> Properties), there you go in the left tab to Common PropertiesProject Dependencies.
After that you choose at the middle top of your projects (ex.: MyProject) and in the bottom window, you have to search for UsermodeLibrary and check/select it as a dependency for the project.
The thing is that every project is configured OK in the Project Properties (linker related and the rest), the only problem is that when you are building the solution it has to know per solution that some projects depend on other projects.
Here the dependency hierarchy is the following:
MyProject -> UsermodeLibrary -> CommonLib (-> means "depends on").
That's why you are seeing that CommonLib can't be linked to the project because it is not built before those applications.
Somehow, your templates miss this setup in regard to the Solution in which they are created."
add a comment |
up vote
0
down vote
up vote
0
down vote
My lab teacher figured this out for me.
For the sake of the answer let's call the new project I added from template "MyProject".
"You have to go the properties of the solution (right click on the solution -> Properties), there you go in the left tab to Common PropertiesProject Dependencies.
After that you choose at the middle top of your projects (ex.: MyProject) and in the bottom window, you have to search for UsermodeLibrary and check/select it as a dependency for the project.
The thing is that every project is configured OK in the Project Properties (linker related and the rest), the only problem is that when you are building the solution it has to know per solution that some projects depend on other projects.
Here the dependency hierarchy is the following:
MyProject -> UsermodeLibrary -> CommonLib (-> means "depends on").
That's why you are seeing that CommonLib can't be linked to the project because it is not built before those applications.
Somehow, your templates miss this setup in regard to the Solution in which they are created."
My lab teacher figured this out for me.
For the sake of the answer let's call the new project I added from template "MyProject".
"You have to go the properties of the solution (right click on the solution -> Properties), there you go in the left tab to Common PropertiesProject Dependencies.
After that you choose at the middle top of your projects (ex.: MyProject) and in the bottom window, you have to search for UsermodeLibrary and check/select it as a dependency for the project.
The thing is that every project is configured OK in the Project Properties (linker related and the rest), the only problem is that when you are building the solution it has to know per solution that some projects depend on other projects.
Here the dependency hierarchy is the following:
MyProject -> UsermodeLibrary -> CommonLib (-> means "depends on").
That's why you are seeing that CommonLib can't be linked to the project because it is not built before those applications.
Somehow, your templates miss this setup in regard to the Solution in which they are created."
answered Dec 4 at 18:36
Gy. Timi
161
161
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53428611%2fbuild-solution-fails-because-of-linker-errors-on-newly-added-projects%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Have you checked that the linker actually searches the directory where the .lib files are? Try setting the 'Additional dependencies' paths to absolute paths of the libs are for the time being. If that works, the path you specified is just wrong, i.e. your .lib files aren't actually in the root folder of the project.
– nm_tp
Nov 22 at 10:22
Also, in VC++ Directories -> Library Directories, you can set the FOLDERS where the linker searches for the libraries, AFAIK. ALSO, check if the settings are set for the configuration you're actually trying to build.
– nm_tp
Nov 22 at 10:25
Thank you for the tips! The settings must be very specific to the new projects because I get the errors only on the new ones I added, even though I put them in the exact same folder with the other similar projects. So far I have checked with a file diff the new and the existing project files and they have the exact same paths configured. I will check the second thing you mentioned, but I did compare that even the build options are the same before asking the question.
– Gy. Timi
Nov 22 at 11:24
Each project requires specific configuration. If the paths aren't configured properly, they might contain some specific values instead of variables whose values are used.
– nm_tp
Nov 22 at 12:16