xmake更新到2.9.7之后,带moc带预编译头的工程反而编译不了了 #6171
Answered
by
wagcheg
Elite-stay
asked this question in
Q&A
-
用的#pragma once,gcc会报重定义,怀疑与#5858 有关,但是很难建一个能稳定复现的demo,人工提取预编译头+moc两个编译命令之后,简单模拟测试了下,先执行qt的moc,再执行gcc编译moc文件,再执行gcc编译预编译头,此时是可以正常编译,而如果是先执行gcc编译预编译头,再进行moc,就会有可能出问题,小工程是没有问题,大工程就出问题了
|
Beta Was this translation helpful? Give feedback.
Answered by
wagcheg
Feb 27, 2025
Replies: 2 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
-
文件编码是不是utf8-bom? |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Elite-stay
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
文件编码是不是utf8-bom?
gcc对这种编码的#pragma once支持有问题(clang似乎也不行)
加上头文件保护宏就行
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56549