如何在使用 SDL2 的 Eclipse 中构建 c++ 程序
How to build a c++ program in Eclipse which uses SDL2
我在 Eclipse 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)
您需要在应用程序中包含所需的运行时库(例如 SDL、Visual Studio 可再发行组件等,您使用的任何内容(。
通常,您需要将所需的库添加到应用程序安装程序/包中 - 您还需要构建这些库。
对于Windows,这通常是一个MSI文件。对于Linux,RPM或DEB包很常见。
相关文章:
- 如何在使用 SDL2 的 Eclipse 中构建 c++ 程序
- 如何在 Eclipse 中一次从多个源文件进行构建
- 我必须构建才能摆脱 Eclipse 中的错误吗?
- 虽然我添加了boost库,但Eclipse并不是用C++构建的.为什么
- Eclipse IDE C/C++ 自动包含来自定制构建脚本的路径
- 如何从 Linux 控制台使用 CMake 构建 Eclipse C++ 项目(没有可用的 GUI)
- 在 eclipse 中以发布模式构建后没有可执行文件
- Eclipse构建但不会启动精灵
- Eclipse 构建错误在默认的 hello world 上
- 从 Eclipse 索引中排除构建中包含的文件
- GoogleMock发出用Eclipse构建C 的简单代码
- Eclipse 不构建C++文件
- 我正在尝试在Eclipse中构建一个C 项目,但是即使在使用MINGW路径设置路径变量之后,也会获得构建错误
- 如何知道命令行庇护以构建在Eclipse中编码的项目
- 添加多个源文件以在 Eclipse 中构建
- Eclipse 在检查语法时看不到包含文件,但在构建或运行应用程序时会看到
- 使用eclipse构建cocos2dios应用程序
- eclipse c++构建错误
- Eclipse c++构建错误:没有这样的文件或目录
- 如何在Windows上使用Eclipse构建wxWidgets