Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#5700 closed Bug (fixed)

transmission-2.83 doesn't build on Fedora rawhide

Reported by: rahulsundaram Owned by: jordan
Priority: Normal Milestone: None Set
Component: Qt Client Version: 2.83
Severity: Normal Keywords:
Cc:

Change History (12)

comment:1 Changed 8 years ago by mike.dld

  • Component changed from Transmission to Qt Client
  • Owner set to jordan

Not exactly a defect as (I believe) there is a decision to slowly move to C++11 in Qt client.

Does Rawhide have a C++11-compatible compiler? If no, I guess you'll have to make a patch yourself. Another workaround would be to not build Qt client. (Fedora is mostly GTK+-based, isn't it?)

Last edited 8 years ago by mike.dld (previous) (diff)

comment:2 Changed 8 years ago by mike.dld

It looks like CONFIG += c++11 (currently present in qt/qtr.pro) only works for Qt 5. When using Qt 4, QMAKE_CXXFLAGS += -std=c++11 (or c++0x) should be present in some form.

comment:3 Changed 8 years ago by rahulsundaram

  • Resolution set to fixed
  • Status changed from new to closed

@mike.did, thanks for the hint. That did fix the problem

@jordan, we do have a c++11 compatible compiler in Rawhide. GNOME is the default but KDE etc is supported as well and the Qt frontend does have some Fedora users.

comment:4 follow-up: Changed 8 years ago by mike.dld

  • Resolution fixed deleted
  • Status changed from closed to reopened

The issue is not yet fixed per se. Do we still support Qt 4, jordan?

comment:5 follow-up: Changed 8 years ago by rosc

Can someone explain how to set these vars to get this to compile? I installed qt5, and still get the same errors trying to compile Transmission.

mainwin.cc:1169:3: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat] mainwin.cc: In member function 'void TrMainWindow::openTorrent()': mainwin.cc:1168:3: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat] mainwin.cc:1168:8: error: 'l' does not name a type mainwin.cc:1169:7: error: 'l' was not declared in this scope mainwin.cc:1169:12: error: 'nullptr' was not declared in this scope mainwin.cc:1174:3: error: 'l' was not declared in this scope mainwin.cc: In member function 'void TrMainWindow::removeTorrents(bool)': mainwin.cc:1316:3: warning: 'auto' changes meaning in C++11; please remove it [-Wc++0x-compat] mainwin.cc:1316:8: error: 'layout' does not name a type mainwin.cc:1317:17: error: 'nullptr' was not declared in this scope mainwin.cc:1319:20: error: invalid use of member function (did you forget the '()' ?) mainwin.cc:1320:31: error: no matching function for call to 'QMessageBox::setLayout(<unresolved overloaded function type>)' mainwin.cc:1320:31: note: candidate is: In file included from /usr/lib/qt/include/QtWidgets/qabstractbutton.h:47:0,

from /usr/local/Qt-5.3.0/include/QtWidgets/qcheckbox.h:45, from /usr/local/Qt-5.3.0/include/QtWidgets/QCheckBox:1, from mainwin.cc:14:

/usr/lib/qt/include/QtWidgets/qwidget.h:525:10: note: void QWidget::setLayout(QLayout*) /usr/lib/qt/include/QtWidgets/qwidget.h:525:10: note: no known conversion for argument 1 from '<unresolved overloaded function type>' to 'QLayout*' mainwin.cc:1323:9: error: invalid use of member function (did you forget the '()' ?) mainwin.cc:1323:9: error: base operand of '->' is not a pointer mainwin.cc:1323:34: error: invalid use of member function (did you forget the '()' ?) mainwin.cc:1323:34: error: base operand of '->' is not a pointer mainwin.cc:1323:61: error: invalid use of member function (did you forget the '()' ?) mainwin.cc:1323:61: error: base operand of '->' is not a pointer make: * [mainwin.o] Error 1

comment:6 in reply to: ↑ 5 Changed 8 years ago by mike.dld

Replying to rosc:

Can someone explain how to set these vars to get this to compile? I installed qt5, and still get the same errors trying to compile Transmission.

Make sure you're using qmake command from Qt 5, not Qt 4. If you have both installed, the name would probably differ (like, say, qmake5 instead of qmake).

comment:7 Changed 8 years ago by rosc

I did a 'make clean' and tried invoking it directly, as '/usr/local/qt5/bin/qmake qtr.pro' but get the same errors

I have a symlink as /usr/local/qt pointing to /usr/local/Qt-5.3.0, and the symlink /usr/lib/qt points to /usr/local/qt. Not sure what else to check to get this compiled.

Is my version of gcc/g++ too old? Using g++ (GCC) 4.7.3

comment:8 Changed 8 years ago by rosc

I figured out how to get it to compile: Just removed 'c++11' from the CONFIG line in qtr.pro and added QMAKE_CXXFLAGS += -std=c++11

All good now. Sorry for the noobness :)

comment:9 in reply to: ↑ 4 ; follow-up: Changed 8 years ago by jordan

Replying to mike.dld:

The issue is not yet fixed per se. Do we still support Qt 4, jordan?

From what you're saying, it sounds like the issue is in cmake's rules rather than in Transmission. If we were to accelerate the move from qmake to cmake as discussed, would that resolve the issue?

comment:10 in reply to: ↑ 9 Changed 8 years ago by mike.dld

Replying to jordan:

If we were to accelerate the move from qmake to cmake as discussed, would that resolve the issue?

I know the issue could be solved in cmake by testing whether compiler supports the -std=c++11 or -std=c++0x option, or whether compiler is of some specific version. I guess the issue could be solved in Qt 4's qmake (maybe in some less elegant way), but I'm not enough proficient with it to provide the best solution possible (anyone?). The very need to do this kind of magic has probably led to c++11 CONFIG option being added in Qt 5 (no prooflinks, sorry).

So subjectively yes, cmake would solve this particular issue from my POV.

comment:11 Changed 7 years ago by mike.dld

  • Resolution set to fixed
  • Status changed from reopened to closed

I'm closing this as fixed since there is now CMake support in trunk (see #5828).

comment:12 Changed 7 years ago by mike.dld

I think I fixed it for qmake builds in r14426.

Note: See TracTickets for help on using tickets.