c - 从文件管理器打开编译的 C 程序
问题描述
如果我有一个已编译的具有 GUI 的 C 程序,我如何制作可执行文件以从文件管理器而不是终端启动程序?我已经用 GCC 编译了程序,但我只能从终端启动它。当我从文件管理器打开它时,我收到一条错误消息,提示“没有为共享库文件安装应用程序”。我在 Ubuntu Mate 中使用 C 语言中的 IUP GUI 库。该文件是一个共享库,但它是用 GCC 编译的。GCC 正在创建一个共享库,但我想创建一个可执行文件。它从终端打开。
解决方案
You (usually) can't execute a library. That's what applications are for. How do you "call" your library from the terminal? There are utilities like rundll.exe (Windows) or dlcall (Unix) which allow "execution" of libraries (actually, they just load the library and call the function from the library, so the utility is actually called first instance).
推荐阅读
- r - 使用 R 去除引号内的引号
- apache-kafka - 当手动提交特定偏移量失败但序列中的下一个偏移量成功提交时会发生什么?
- c++ - 为什么我的 bool 函数返回 true 会导致读取访问冲突?
- php - 如何在 php 中从 MySQL 进行登录验证?
- javascript - 如果单击按钮,则更改颜色表行
- laravel-5.8 - 你能分享使用 Laravel Auth 的简单论坛部分的源代码或包吗
- java - 为什么java Graphics drawImage第一次很慢
- python - 有没有办法从 html 模板中动态设置 wtform 单选框的默认值?
- .net - 我不能在 c# 类库中使用 Server.MapPath?
- amazon-web-services - 是否支持具有 Direct Connect 和 Internet 网关的 AWS VPC?