从 Windows 上的 NetBeans 中的 C 项目创建 EXE 输出?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8461225/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Create EXE output from a C project in NetBeans on Windows?
提问by Shimmy Weitzhandler
I'm new to NetBeans.
I am using NB on my PC.
I just cleaned & built a project and the output was:
我是 NetBeans 的新手。
我在我的电脑上使用 NB。
我刚刚清理并构建了一个项目,输出是:
CLEAN SUCCESSFUL (total time: 1s)
make: Nothing to be done for `all'.
BUILD SUCCESSFUL (total time: 1s)
Now I can't seem to find any executable.
How do I set the IDE to create an EXE file output from the project?
现在我似乎找不到任何可执行文件。
如何设置 IDE 以从项目创建 EXE 文件输出?
Update- Please read my comment bellow.
更新- 请阅读下面我的评论。
采纳答案by Shimmy Weitzhandler
I re-read the instructions of that project (FFmpeg), and I had to configure
it first using ./configure
in msys
shell.
我重新阅读了该项目 (FFmpeg) 的说明,我必须configure
首先./configure
在msys
shell 中使用它。
As per building ffmpeg with amv-codec-tools, that's simple:
根据使用 amv-codec-tools 构建 ffmpeg,这很简单:
- Install MinGW + MSYS and add environment vars for their bin folders
- Checkout the latest revision of amv-codec-tools to the
msys\home
folder - Remove the folder
amv-codec-tools\AMVMuxer\ffmpeg
- Checkout the latest revision of FFmpeg to
amv-codec-tools\AMVMuxer\ffmpeg
instead the previous ver. - Open the MSYS shell
- Navigate to amv-codec-tools\AMVMuxer (
cd /home/amv-codec-tools/amvmuxer
) - Run
make build
- 安装 MinGW + MSYS 并为其 bin 文件夹添加环境变量
- 将最新版本的 amv-codec-tools 签出到
msys\home
文件夹 - 删除文件夹
amv-codec-tools\AMVMuxer\ffmpeg
- 签出 FFmpeg 的最新版本,
amv-codec-tools\AMVMuxer\ffmpeg
而不是以前的版本。 - 打开 MSYS 外壳
- 导航到 amv-codec-tools\AMVMuxer (
cd /home/amv-codec-tools/amvmuxer
) - 跑
make build
HTH
HTH
回答by Fabián Heredia Montiel
Press F6 or Shift F6 for project main file.
对于项目主文件,按 F6 或 Shift F6。
Also if you are coding Java(NetBeans) then you must create a main method in the class.
此外,如果您正在编写 Java(NetBeans),那么您必须在类中创建一个 main 方法。
EDIT: The file is available under $Projects -> $Projectname -> Debug || Release -> debug.exe || *.exe
编辑:该文件在 $Projects -> $Projectname -> Debug || 下可用 发布 -> debug.exe || *。可执行程序
回答by clyfe
After you build, the executable should be in a path like PROJECT/dist/PLATFORM/project.exe (dist or build can't remember exactly)
构建后,可执行文件应位于类似 PROJECT/dist/PLATFORM/project.exe 的路径中(dist 或 build 记不清了)