Visual Studio DLL 项目在生成时不会创建 .lib 文件
Visual Studio DLL Project Won't Create a .lib File When Building
我试图创建一个小库(游戏引擎),可以导出为。dll,然后在另一个项目(游戏)中使用。我有一个解决方案在Visual Studio与两个项目一个dll项目(游戏引擎)和主要的gamewin32项目。
在游戏项目中,我将使用隐式链接,但问题是dll项目不会生成。lib文件。
在我的dll项目文件中,我有一个头文件,其中包含:
#pragma once
#ifdef _WIN32
#ifdef PHASESHIFTENGINE_EXPORTS
#define PHASESHIFTENGINE_API __declspec(dllexport)
#else
#define PHASESHIFTENGINE_API __declspec(dllimport)
#endif
#endif
和另一个要导出的简单2D矢量实现的头文件:
#pragma once
#include "phaseShiftAPI.h"
#include <algorithm>
template<class T>
class PHASESHIFTENGINE_API PSVec2
{
public:
union
{
T m_x, m_y;
T m_elements[1];
};
public:
PSVec2();
PSVec2(const T& m_x, const T& m_y);
PSVec2(const PSVec2& other);
PSVec2(PSVec2&& other);
~PSVec2();
PSVec2& operator=(const PSVec2& other);
PSVec2& operator=(PSVec2&& other);
PSVec2& operator+(const PSVec2& right);
PSVec2& operator+(const T& right);
PSVec2& operator++();
PSVec2& operator-(const PSVec2& right);
PSVec2& operator-(const T& right);
PSVec2& operator--();
PSVec2& operator*(const PSVec2& right);
PSVec2& operator*(const T& right);
PSVec2& operator/(const PSVec2& right);
PSVec2& operator/(const T& right);
};
与其。cpp文件一起。
我也有一个预编译头包含:
#pragma once
#ifdef _WIN32
#include "targetver.h"
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#include "phaseShiftAPI.h"
在所有这些之后,为什么不创建。lib文件?
在"Project Properties -> General
"中,设置"Configuration Type
"为"Static Library (.lib)
"
相关文章:
- 从 .lib 文件创建一个.dll文件
- lib OSMesa 屏幕外上下文创建在C++中失败,但仅在静态链接时失败
- 使用JNI和OPENCV创建的LIB的未定义符号
- 如何在Linux上为C和C 创建线程安全LIB
- add_library并未创建带有C源的.lib
- 错误:LNK1104:无法在 QT 创建器中打开文件'libumfpack.dlld.lib'
- 如何创建可供src/code和lib/libraries访问的全局对象
- 创建C .lib项目,消费者项目必须引用LIBS所包含的
- 如何隔离只允许创建为singleton的行为不好的第三方c-lib
- 在Visual Studio 2010中创建.lib文件
- 在 Visual Studio 项目中创建包含文件夹和 Lib 文件夹
- gzstream lib for C++ :已创建损坏的文件
- Scons:如何在使用变量替换时创建 LIB 依赖项
- 为什么视觉工作室会创建一个.LIB 以及.DLL
- C++:在 .lib 成功构建后在 VS2010 中创建.dll时"unresolved external symbol"
- Visual Studio-创建不带.lib的.dll
- 如何不在Visual C++.exe项目中创建.lib和.exp文件
- Visual Studio DLL 项目在生成时不会创建 .lib 文件
- 使用cl.exe创建.lib或.dll
- 创建.lib文件-第一次