qt - 如何使用 Qt 和 CMake 编译 ac 文件?
问题描述
使用Qt5.15.1和 cmake。
从 qtCreator 生成的一个新的空白 qml 项目开始。我需要添加 ac 文件。
在 CMakeLists.txt 中,我添加了这样的文件:
add_executable(untitled1
main.cpp
mainwindow.cpp
mainwindow.h
mainwindow.ui
c_file.c
)
如果我进行完整构建,这是日志文件:
[ 20%] Automatic MOC and UIC for target untitled1
[ 20%] Built target untitled1_autogen
Scanning dependencies of target untitled1
[ 40%] Building CXX object CMakeFiles/untitled1.dir/untitled1_autogen/mocs_compilation.cpp.obj
[ 60%] Building CXX object CMakeFiles/untitled1.dir/main.cpp.obj
[ 80%] Building CXX object CMakeFiles/untitled1.dir/mainwindow.cpp.obj
[100%] Linking CXX executable untitled1.exe
[100%] Built target untitled1
可以看到,c 文件没有被编译。我应该怎么办?
解决方案
推荐阅读
- html - 使用禁用或只读时 textarea 丢失换行符
- javascript - Javascript退出函数并从另一个函数返回
- visual-studio - 使用 gulp 更新 nuget 包
- python - 使用远程解释器检查 Pycharm 代码
- android - RxAndroidBle - 使用 CALLBACK_TYPE_ALL_MATCHES 或 CALLBACK_TYPE_FIRST_MATCH 时的不同结果
- windows - MXE + CMake:如何在 Windows 上部署静态链接的 Qt 应用程序?
- websocket - Websocket 连接失败
- openshift - 推送新仓库并开始构建后的openshift node.js错误
- java - 从配置或属性文件中加载巨大的枚举
- html - Angular 的 fxFlex API 的问题