c - C:使用 clang 在 Visual Studio Code 中设置自定义入口点
问题描述
我正在尝试将 clang 设置为使用名为 entry() 的函数(而不是 main)作为入口点(以防止 C 运行时初始化),但编译器似乎无法识别任何入口设置参数 - - 它一直说应该工作的参数未使用)。执行 -eentry 会显示此消息:
clang: warning: argument unused during compilation: '-e entry' [-Wunused-command-line-argument]
然后:
clang: error: linker command failed with exit code 1561 (use -v to see invocation)
执行 -Wl,-emymain 会显示此消息:
At line:1 char:120
+ ... -nostartfiles -nostdinc -nostdlib -nodefaultlibs --debug -Wl,-eentry
+ ~
Missing argument in parameter list.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : MissingArgument
然后:
clang: error: linker command failed with exit code 1561 (use -v to see invocation)
执行 -Xlinker -eentry 会显示此消息:
clang: warning: argument unused during compilation: '-Xlinker -eentry' [-Wunused-command-line-argument]
然后:
clang: error: linker command failed with exit code 1561 (use -v to see invocation)
解决方案
推荐阅读
- ios - 我怎样才能使用 SnapKit 实现这一点?
- windows - 在 Windows 10 上安装自定义应用程序期间出现错误 1723
- ignite - 如何在 SqlQuery 中使用枚举值?
- java - 创建名称为“flightController”的 bean 时出错:通过字段“flightrepos”表示的依赖关系不满足;
- c++ - 将 Int 中的数字分隔为单独的 Int
- javascript - 如何通过javascript创建图像效果过滤器面板?
- ruby-on-rails - 如何使用 ActiveStorage 以嵌套形式上传文件?
- oracle - 在查询中使用参数时 Oracle ORA-01858
- maven - 将appium从5.0.4版升级到6.1.0版后初始化页面工厂类时遇到java.lang.ExceptionInInitializerError
- java - 标准生成器 API。IN子句查询