是否有其他方法将.dll文件从一个项目复制到我的启动项目中的可执行文件旁边
Is there a different way to copy the .dll file from one project to beside my executable file in my startup project?
我正在使用Premake5来构建C Visual Studio 2019应用程序引擎。我需要弄清楚为什么在使用Premake5构建项目后它不起作用。
我试图将体系结构更改为x64,但它坚持CFG.System是X86_64。
workspace "Engine_Autry"
architecture "x64"
configurations
{
"Debug",
"Release",
"Dist"
}
outputdir = "%{cfg.buildcfg}-%{cfg.system}-%{cfg.architecture}"
project "Engine"
location "Engine"
kind "SharedLib"
language "C++"
targetdir ("bin/" .. outputdir .. "/%{prj.nam}")
objdir ("bin-int/" .. outputdir .. "/%{prj.nam}")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp"
}
includedirs
{
"%{prj.name}/vendor/spdlog/include"
}
filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"
defines
{
"APP_PLATFORM_WINDOWS",
"APP_BUILD_DLL"
}
postbuildcommands
{
{"{COPY} %{cfg.buildtarget.relpath} ../bin/" .. outputdir .. "/Sandbox"}
}
filter "configurations:Debug"
defines "APP_DEBUG"
symbols "On"
filter "configurations:Release"
defines "APP_RELEASE"
optimize "On"
filter "configurations:Dist"
defines "APP_DIST"
optimize "On"
project "Sandbox"
location "Sandbox"
kind "ConsoleApp"
language "C++"
targetdir ("bin/" .. outputdir .. "/%{prj.nam}")
objdir ("bin-int/" .. outputdir .. "/%{prj.nam}")
files
{
"%{prj.name}/src/**.h",
"%{prj.name}/src/**.cpp"
}
includedirs
{
"Engine/vendor/spdlog/include",
"Engine/src"
}
links
{
"Engine"
}
filter "system:windows"
cppdialect "C++17"
staticruntime "On"
systemversion "latest"
defines
{
"APP_PLATFORM_WINDOWS"
}
filter "configurations:Debug"
defines "APP_DEBUG"
symbols "On"
filter "configurations:Release"
defines "APP_RELEASE"
optimize "On"
filter "configurations:Dist"
defines "APP_DIST"
optimize "On"
它在我使用Premake5构建引擎之前正在工作。
Error MSB3073 The command "IF EXIST ..binDebug-windows-x86_64Engine.dll (xcopy /Q /E /Y /I ..binDebug-windows-x86_64Engine.dll ..binDebug-windows-x86_64Sandbox > nul) ELSE (xcopy /Q /Y /I ..binDebug-windows-x86_64Engine.dll ..binDebug-windows-x86_64Sandbox > nul)
:VCEnd" exited with code 2. Engine C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildMicrosoftVCv160Microsoft.CppCommon.targets 138
我遵循Thecherno的教程时也有相同的问题。
有两个问题引起了这个问题:
- 在我的后构建命令中,目录不正确。在您的情况下,目录是正确的。
- 将沙箱设置为启动项目。我认为您在重建和重新装载Visual Studio后忘了这样做。
尝试一下,让我知道。
相关文章:
- cmake在我的项目中所需的所有静态库都不成功
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 如何将我的 CMake 项目配置为运行所有单元测试?
- 编译器现在遵循C++14标准,我的项目不再编译神秘的SFML错误
- 如何在我的项目中从 CMAKE 中的同一项目获取多个库
- 为什么我的项目没有保存名称中所做的修改
- 如何将我的小程序转换为用于项目的函数?
- 如何在我的 Visual C++ 项目中使用 .a 文件
- 如何自动获取我的项目的路径并删除一些文件
- Qt - 为什么Visual Studio 2019在qml资源中添加10Mb文件后无法再编译我的项目?
- 我必须构建我的项目 2 次,第一次失败,因为它无法打开库
- 我怎样才能简单地将opencv 包含在我的项目中与CMake
- 我的快速排序在对预排序的项目进行排序时失败,如何改进?
- 部署基于 qt 的项目后,我的 sqlite3 文件不会被复制 (android)
- 如何将外部 dll 添加到我的 VS2019 项目?
- 如何在Cmake中正确查找头路径,以便在我的项目中构建Box2D
- 阻止我的项目调用__CxxFrameHandler3(CRT函数)
- 我的项目中某些仅标头文件不能包含使用 CMake 和 Vscode 的"SFML/Graphics.hpp"
- 如何从支持linux/mac操作系统的第三方代码为我的c#项目创建dll
- 如何在bazel中同时处理外部依赖项和我的项目