简体   繁体   English

将两个项目链接到一个解决方案中 Visual Studio 2013

[英]Linking two projects in one solution visual studio 2013

I'd like to compile one project depending of another one in the same solution.我想根据同一解决方案中的另一个项目来编译一个项目。 The problem is the following : in my project one, in the main file I'm including camera.hpp and i call the constructor of camera.问题如下:在我的项目一中,在主文件中我包含了camera.hpp,我调用了camera的构造函数。 So i've got a error like LNK2001 because the compilator doesn't link the camera.cpp file who the constructor comes from.所以我有一个像 LNK2001 这样的错误,因为编译器没有链接构造函数来自的 camera.cpp 文件。 Anybody can help me?任何人都可以帮助我吗? Sorry for my english.对不起我的英语不好。

You'll have to link the project having camera.cpp with the main project.您必须将具有camera.cpp的项目与主项目链接起来。

  • Project 2: (containing camera.cpp ) Create a static/dynamic library.项目2:(包含camera.cpp)创建一个静态/动态库。

  • Project 1: (containing main ) Create the executable providing the .lib of the Project 2项目 1:(包含 main )创建提供项目 2 的.lib的可执行文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM