Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编译通不过。 #76

Closed
YangtseSu opened this issue Dec 4, 2011 · 21 comments
Closed

编译通不过。 #76

YangtseSu opened this issue Dec 4, 2011 · 21 comments

Comments

@YangtseSu
Copy link

Arch x86_64
原先能的,最新的git。出现下列错误。

g++ -c -m64 -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -Wall -W -D_REENTRANT -DAUDIO_SUPPORT -DJOYSTICK_SUPPORT -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include/phonon -I/usr/include -Iinclude/lua -Iinclude -Isrc/client -Isrc/core -Isrc/dialog -Isrc/package -Isrc/scenario -Isrc/server -Isrc/ui -Isrc/util -Iinclude/irrKlang -I/usr/include/phonon_compat -I. -I. -o thicket.o src/package/thicket.cpp
g++ -c -m64 -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -Wall -W -D_REENTRANT -DAUDIO_SUPPORT -DJOYSTICK_SUPPORT -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include/phonon -I/usr/include -Iinclude/lua -Iinclude -Isrc/client -Isrc/core -Isrc/dialog -Isrc/package -Isrc/scenario -Isrc/server -Isrc/ui -Isrc/util -Iinclude/irrKlang -I/usr/include/phonon_compat -I. -I. -o contestdb.o src/server/contestdb.cpp
g++ -c -m64 -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -Wall -W -D_REENTRANT -DAUDIO_SUPPORT -DJOYSTICK_SUPPORT -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include/phonon -I/usr/include -Iinclude/lua -Iinclude -Isrc/client -Isrc/core -Isrc/dialog -Isrc/package -Isrc/scenario -Isrc/server -Isrc/ui -Isrc/util -Iinclude/irrKlang -I/usr/include/phonon_compat -I. -I. -o gamerule.o src/server/gamerule.cpp
src/package/thicket.cpp:99:18: warning: unused parameter 'damage' [-Wunused-parameter]
src/package/thicket.cpp:165:18: warning: unused parameter 'event' [-Wunused-parameter]
src/package/thicket.cpp: In member function 'virtual bool Lieren::trigger(TriggerEvent, ServerPlayer*, QVariant&) const':
src/package/thicket.cpp:235:73: error: conversion from 'long int' to 'const QVariant' is ambiguous
src/package/thicket.cpp:235:73: note: candidates are:
/usr/include/QtCore/qvariant.h:433:12: note: QVariant::QVariant(void*)
/usr/include/QtCore/qvariant.h:227:5: note: QVariant::QVariant(Qt::GlobalColor) <near match>
/usr/include/QtCore/qvariant.h:227:5: note:   no known conversion for argument 1 from 'long int' to 'Qt::GlobalColor'
/usr/include/QtCore/qvariant.h:194:5: note: QVariant::QVariant(const char*)
/usr/include/QtCore/qvariant.h:192:5: note: QVariant::QVariant(float)
/usr/include/QtCore/qvariant.h:191:5: note: QVariant::QVariant(double)
/usr/include/QtCore/qvariant.h:190:5: note: QVariant::QVariant(bool)
/usr/include/QtCore/qvariant.h:189:5: note: QVariant::QVariant(qulonglong)
/usr/include/QtCore/qvariant.h:188:5: note: QVariant::QVariant(qlonglong)
/usr/include/QtCore/qvariant.h:187:5: note: QVariant::QVariant(uint)
/usr/include/QtCore/qvariant.h:186:5: note: QVariant::QVariant(int)
/usr/include/QtCore/qvariant.h:177:5: note: QVariant::QVariant(QVariant::Type) <near match>
/usr/include/QtCore/qvariant.h:177:5: note:   no known conversion for argument 1 from 'long int' to 'QVariant::Type'
/usr/include/QtCore/qmap.h:507:16: error:   initializing argument 2 of 'const T QMap<Key, T>::value(const Key&, const T&) const [with Key = QString, T = QVariant]'
src/package/thicket.cpp:235:94: error: expected primary-expression before '*' token
src/package/thicket.cpp:235:95: error: expected primary-expression before '>' token
src/package/thicket.cpp:235:97: error: expected primary-expression before ')' token
src/package/thicket.cpp:259:40: error: conversion from 'long int' to 'const QVariant' is ambiguous
src/package/thicket.cpp:259:40: note: candidates are:
/usr/include/QtCore/qvariant.h:433:12: note: QVariant::QVariant(void*)
/usr/include/QtCore/qvariant.h:227:5: note: QVariant::QVariant(Qt::GlobalColor) <near match>
/usr/include/QtCore/qvariant.h:227:5: note:   no known conversion for argument 1 from 'long int' to 'Qt::GlobalColor'
/usr/include/QtCore/qvariant.h:194:5: note: QVariant::QVariant(const char*)
/usr/include/QtCore/qvariant.h:192:5: note: QVariant::QVariant(float)
/usr/include/QtCore/qvariant.h:191:5: note: QVariant::QVariant(double)
/usr/include/QtCore/qvariant.h:190:5: note: QVariant::QVariant(bool)
/usr/include/QtCore/qvariant.h:189:5: note: QVariant::QVariant(qulonglong)
/usr/include/QtCore/qvariant.h:188:5: note: QVariant::QVariant(qlonglong)
/usr/include/QtCore/qvariant.h:187:5: note: QVariant::QVariant(uint)
/usr/include/QtCore/qvariant.h:186:5: note: QVariant::QVariant(int)
/usr/include/QtCore/qvariant.h:177:5: note: QVariant::QVariant(QVariant::Type) <near match>
/usr/include/QtCore/qvariant.h:177:5: note:   no known conversion for argument 1 from 'long int' to 'QVariant::Type'
/usr/include/QtCore/qvariant.h:229:15: error:   initializing argument 1 of 'QVariant& QVariant::operator=(const QVariant&)'
src/package/thicket.cpp: At global scope:
src/package/thicket.cpp:465:18: warning: unused parameter 'player' [-Wunused-parameter]
src/package/thicket.cpp:562:6: warning: unused parameter 'Self' [-Wunused-parameter]
src/package/thicket.cpp:692:18: warning: unused parameter 'from' [-Wunused-parameter]
src/package/thicket.cpp:692:18: warning: unused parameter 'to' [-Wunused-parameter]
src/package/thicket.cpp:706:18: warning: unused parameter 'player' [-Wunused-parameter]
make: *** [thicket.o] Error 1
make: *** Waiting for unfinished jobs....
src/server/gamerule.cpp: In member function 'virtual bool HulaoPassMode::trigger(TriggerEvent, ServerPlayer*, QVariant&) const':
src/server/gamerule.cpp:701:6: warning: argument 'player' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
@YangtseSu
Copy link
Author

我用的是QT 4.7.4

@ubun
Copy link
Contributor

ubun commented Dec 4, 2011

有没有重新生成cxx

@Moligaloo
Copy link
Contributor

每当 swig 目录下的 .i 发生变动的时候,需要用 swig 更新 sanguosha_wrap.cxx 文件

@YangtseSu
Copy link
Author

我用的compile.sh,

swig -c++ -lua sanguosha.i

@YangtseSu
Copy link
Author

用20111126以及之前的的git一直能编译成功。

@ibicdlcod
Copy link
Contributor

不是那个,是E:\swigwin-2.0.1\swig.exe(换成你装swig的目录。。。) -c++ -lua sanguosha.i

@Moligaloo
Copy link
Contributor

嗯,知道了,似乎是天启改的 thicket.cpp 的 235 行出了问题,你把那一行替换成:
ServerPlayer *target = zhurong->tag["LierenTarget"].value<PlayerStar>();
试试

@YangtseSu
Copy link
Author

g++ -c -m64 -pipe -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -fno-strict-aliasing -Wall -W -D_REENTRANT -DAUDIO_SUPPORT -DJOYSTICK_SUPPORT -DQT_NO_DEBUG -DQT_PHONON_LIB -DQT_SQL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++-64 -I. -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtSql -I/usr/include/phonon -I/usr/include -Iinclude/lua -Iinclude -Isrc/client -Isrc/core -Isrc/dialog -Isrc/package -Isrc/scenario -Isrc/server -Isrc/ui -Isrc/util -Iinclude/irrKlang -I/usr/include/phonon_compat -I. -I. -o thicket.o src/package/thicket.cpp
src/package/thicket.cpp:99:18: 警告:未使用的参数‘damage’ [-Wunused-parameter]
src/package/thicket.cpp:165:18: 警告:未使用的参数‘event’ [-Wunused-parameter]
src/package/thicket.cpp: 在成员函数‘virtual bool Lieren::trigger(TriggerEvent, ServerPlayer*, QVariant&) const’中:
src/package/thicket.cpp:235:67: 错误:对‘QVariant::value()’的调用没有匹配的函数
src/package/thicket.cpp:235:67: 附注:备选是:
/usr/include/QtCore/qvariant.h:335:14: 附注:template<class T> T QVariant::value() const
src/package/thicket.cpp:259:40: 错误:从‘long int’到‘const QVariant’的转换有歧义
src/package/thicket.cpp:259:40: 附注:备选是:
/usr/include/QtCore/qvariant.h:433:12: 附注:QVariant::QVariant(void*)
/usr/include/QtCore/qvariant.h:227:5: 附注:QVariant::QVariant(Qt::GlobalColor) <就近匹配>
/usr/include/QtCore/qvariant.h:227:5: 附注:  no known conversion for argument 1 from ‘long int’ to ‘Qt::GlobalColor’
/usr/include/QtCore/qvariant.h:194:36: 附注:QVariant::QVariant(const char*)
/usr/include/QtCore/qvariant.h:192:5: 附注:QVariant::QVariant(float)
/usr/include/QtCore/qvariant.h:191:5: 附注:QVariant::QVariant(double)
/usr/include/QtCore/qvariant.h:190:5: 附注:QVariant::QVariant(bool)
/usr/include/QtCore/qvariant.h:189:5: 附注:QVariant::QVariant(qulonglong)
/usr/include/QtCore/qvariant.h:188:5: 附注:QVariant::QVariant(qlonglong)
/usr/include/QtCore/qvariant.h:187:5: 附注:QVariant::QVariant(uint)
/usr/include/QtCore/qvariant.h:186:5: 附注:QVariant::QVariant(int)
/usr/include/QtCore/qvariant.h:177:5: 附注:QVariant::QVariant(QVariant::Type) <就近匹配>
/usr/include/QtCore/qvariant.h:177:5: 附注:  no known conversion for argument 1 from ‘long int’ to ‘QVariant::Type’
/usr/include/QtCore/qvariant.h:229:15: 错误:以初始化‘QVariant& QVariant::operator=(const QVariant&)’的实参 1
src/package/thicket.cpp: 在全局域:
src/package/thicket.cpp:465:18: 警告:未使用的参数‘player’ [-Wunused-parameter]
src/package/thicket.cpp:562:6: 警告:未使用的参数‘Self’ [-Wunused-parameter]
src/package/thicket.cpp:692:18: 警告:未使用的参数‘from’ [-Wunused-parameter]
src/package/thicket.cpp:692:18: 警告:未使用的参数‘to’ [-Wunused-parameter]
src/package/thicket.cpp:706:18: 警告:未使用的参数‘player’ [-Wunused-parameter]
make: *** [thicket.o] 错误 1
/usr/share/qt/mkspecs/modules/qt_phonon.pri(7):Function 'fromfile' is not implemented
/usr/share/qt/mkspecs/modules/qt_phonon.pri(7):'!contains' is not a recognized test function
/usr/share/qt/mkspecs/features/default_post.prf(5):Function 'system' is not implemented
Updating '/home/yangtse/aur/qsanguosha-git/src/QSanguosha/sanguosha.qm'...
    Generated 631 translation(s) (631 finished and 0 unfinished)
Well, everything is OK. You can run it with ./QSanguosha

似乎还是不行。

@Moligaloo
Copy link
Contributor

更新了,该死的 github, 把我的尖括号吞了

@Moligaloo
Copy link
Contributor

ServerPlayer *target = zhurong->tag["LierenTarget"].value<PlayerStar>();

@YangtseSu
Copy link
Author

ServerPlayer *target = zhurong->tag["LierenTarget"].value<ServerPlayer *>();

或者

ServerPlayer *target = zhurong->tag["LierenTarget"].value<PlayerStar>();

都没能成功。

@YangtseSu
Copy link
Author

我对编程了解得很少。你看看是不是应该这里也修改一下。

    //zhurong->tag["LierenTarget"] = NULL;
    zhurong->tag["LierenTarget"].isNull() == true;

@ubun
Copy link
Contributor

ubun commented Dec 4, 2011

你先把祝融注释掉吧。linux我也不熟,还得神主修,目前神主貌似没时间

@Moligaloo
Copy link
Contributor

lieren target 不一定非得保存 ServerPlayer *, 你也可以仅仅保存 target 的 objectName

@YangtseSu
Copy link
Author

我把第259行的

    zhurong->tag["LierenTarget"] = NULL;

注释掉编译就通过了。这句好像是在为对象赋予空值,而C++不允许这么使用。

@YangtseSu
Copy link
Author

@Moligaloo 第235行pull你的patch之后已经不出错了。现在出错的是259.

@Moligaloo
Copy link
Contributor

不要赋值为 NULL,用下面的还好些
zhurong->tag.remove("LierenTarget");

@ubun
Copy link
Contributor

ubun commented Dec 8, 2011

额,还好些,怎么处理是最好呢……

@Moligaloo
Copy link
Contributor

@ubun 根本不需要用用到 tag,你只需要判断 damage 的 chain 字段是否为 true 即可

@ubun
Copy link
Contributor

ubun commented Dec 8, 2011

可以么,应该不只有铁索一种情况吧。比如祝融杀小乔,小乔弹给周瑜,按新描述祝融是和小乔拼点,这其中不涉及连环

@Moligaloo
Copy link
Contributor

@ubun 按照这种情况,祝融既不能与小乔拼点,也不能与周瑜拼点

haveatry823 referenced this issue in haveatry823/QSanguosha Dec 6, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants