我用C++编写了一个程序。如果我构建它并在我的机器上运行它,它工作得很好。但是如果我把它发送给没有SDL框架的人,它就不能工作。我的机器和另一台不能使用它的机器是mac。要构建我的程序,我需要更改哪些内容?
Eclipse中的构建控制台就是这样说的:
00:14:23 **** Incremental Build of configuration Release for project Salsa Kit ****
make all
Building file: ../src/main.cpp
Invoking: Cross G++ Compiler
g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.cpp"
Finished building: ../src/main.cpp
Building target: Salsa Kit.app
Invoking: Cross G++ Linker
g++ -L/Library/Frameworks/SDL2.framework -L/Library/Frameworks/SDL2_image.framework -framework SDL2 -framework Cocoa -framework SDL2_image -o "Salsa Kit.app" ./src/engine/SE.o ./src/engine/SE_Audio.o ./src/engine/SE_Graphics.o ./src/engine/SE_Input.o ./src/main.o
Finished building target: Salsa Kit.app
00:14:26 Build Finished. 0 errors, 0 warnings. (took 3s.139ms)发布于 2018-10-14 21:20:40
您需要在应用程序中包含所需的运行时库(如SDL、Visual Studio redistributables等)。
通常,您需要将所需的库添加到应用程序的安装程序/包中-您也需要构建这些库。
对于Windows,它通常是一个MSI文件。对于Linux,RPM或DEB包很常见。
https://stackoverflow.com/questions/52803050
复制相似问题