Opened 12 years ago

Closed 12 years ago

#36332 closed defect (fixed)

qca: error: use of undeclared identifier 'set'

Reported by: ben@… Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: qca

Description (last modified by ryandesign (Ryan Carsten Schmidt))

I get the following error when attempting to build qca (a dependency of ktouch).

I'm using Mountain Lion, Xcode 4.5, and my ports are installed to /opt/macports.

The log file that it mentions is attached.

Attachments (2)

main.log (51.3 KB) - added by ben@… 12 years ago.
/opt/macports/var/macports/logs/_opt_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_qca/qca/main.log
g++-base.conf (970 bytes) - added by ben@… 12 years ago.
/opt/macports/share/qt4/mkspecs/common/g++-base.conf

Download all attachments as: .zip

Change History (13)

Changed 12 years ago by ben@…

Attachment: main.log added

/opt/macports/var/macports/logs/_opt_macports_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_qca/qca/main.log

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Owner: changed from macports-tickets@… to michaelld@…
Summary: Building qca failsqca: error: use of undeclared identifier 'set'

Remember to use WikiFormatting and to Cc the maintainer of the affected port.

I've deleted the log output you pasted into the ticket description since the log you attached contains the same information.

comment:2 Changed 12 years ago by michaelld (Michael Dickens)

I don't know that I've tried compiling QCA with clang. Might be that I need to block that compiler; I'll give it a try using the latest Apple clang & see what happens.

comment:3 Changed 12 years ago by michaelld (Michael Dickens)

Please attach the file "/opt/macports/share/qt4/mkspecs/common/g++-base.conf". A recent revision to the qt4-mac portfile allowed clang from (xcode >= 4.3). Which I think will be an issue because QMake doesn't play nicely with clang yet -- it does not provided configuration files (such as the one I've asked you to attach) for clang yet; I fully expect Qt 5 will do so, but it's still in development. QCA uses this file to determine the compiler to use, ignoring that provided by MacPorts at configuration time. From your logfile, "/usr/bin/clang++" is being used which means it must be embedded in the QMake configuration files; also since the 'mkspecs' file is "macx-g++", this leads me to believe that qt4-mac was compiled using Apple's latest clang. So, while I'm impressed that qt4-mac was buildable using clang, it does worry me at the same time because of the issue for tickets like this.

Changed 12 years ago by ben@…

Attachment: g++-base.conf added

/opt/macports/share/qt4/mkspecs/common/g++-base.conf

comment:4 Changed 12 years ago by ben@…

Sorry about the mangled formatting in the original post by the way. I tried to edit it as Ryan did but could not find a link to do so. Perhaps I do not have permission.

comment:5 Changed 12 years ago by michaelld (Michael Dickens)

Do I interpret things correctly that you installed qt4-mac with Apple's clang from XCode 4.5.0 as the compiler? That seems to be the case from everything I've seen thus far.

comment:6 Changed 12 years ago by ben@…

Yes, I trashed my old MacPorts install when I upgraded to Mountain Lion (as the docs recommend). So it's all freshly built with Xcode 4.5.

comment:7 Changed 12 years ago by michaelld (Michael Dickens)

OK; thanks for the prompt replies. It'll take me some time to get qt4-mac re-installed with clang. In the mean time, if you want to "fix" this issue then reinstall qt4-mac using "configure.compiler=llvm-gcc-4.2" appended after the "sudo port install qt4-mac ..." command. Then, qca should install correctly. It might be that I just have to block clang from qt4-mac again, but I'll test it out before doing so.

comment:8 Changed 12 years ago by ben@…

I can confirm that rebuilding qt4-mac and qca with configure.compiler=llvm-gcc-4.2 avoids the issue.

The key was rebuilding qt4-mac - I'm pretty sure I tried recompiling just qca with that flag (I read https://trac.macports.org/wiki/ProblemHotlist before filing this bug) but that was not enough.

comment:9 Changed 12 years ago by michaelld (Michael Dickens)

Thanks for your feedback; that's good to know. Strange, too. I'm researching this issue, to see what makes the most sense for "fixing" it. I suspect I'll end up blocking clang again, but, as I said, I'm going to do some testing first.

comment:10 Changed 12 years ago by michaelld (Michael Dickens)

Looks like it's clang just being picky about C++ template inheritance, but otherwise clang as the compiler for Qt and related ports seems to be OK. I'll patch the code and push that fix shortly.

comment:11 Changed 12 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: newclosed

Done in r98169. With your identical setup and clang++, this patch works for me. So, I'm closing this ticket as fixed. Do a "sudo port selfupdate" and try building qca again using your qt4-mac (either should work). You can keep your qt4-mac with clang or with llvm-gcc; I'd recommend the latter for now, but the former might work OK. For this specific issue, GCC was able to figure out the template method inheritance correctly while clang was not able to.

Note: See TracTickets for help on using tickets.