在MSVC-2013 for Windows 8.0中,我无法获得与.exe应用程序链接的静态库。
我所做的:
int my_function(int x)。int my_function(int x) {return 0;}。#include "MyLib.h"在MyApp的CubeRenderer.cpp中。int y = my_function(6);中的CubeRenderer::CubeRenderer()中添加CubeRenderer.cpp。这会产生链接器错误。
error LNK2019: unresolved external symbol "int __cdecl my_function(int)" (?my_function@@YAHH@Z) MyApp依赖于MyLib,因此我不需要在Linker->Input->Addidtional Dependencies中设置。不管怎么说,我试过了,但还是会犯错误。
我在?my_function@@YAHH@Z的MyLib.lib上搜索过--在那里找到了5次。
也许我不能使用名为Static Library (Windows Phone 8.0)的模板,应该使用DLL (Windows Phone 8.0)或Windows Runtime Component (Windows Phone 8.0)。
发布于 2014-06-30 18:19:27
您需要向中添加一个项目以进行此构建。您可以通过右键单击项目Add->References并单击并将MyLib作为项目添加到项目引用来添加到MyApp中。
https://stackoverflow.com/questions/24405117
复制相似问题