[gecode-users] Mac XCode configuration

Tomas Lidén tomas.liden at liu.se
Mon Apr 7 19:54:38 CEST 2014


Guido Tack skrev 2014-04-07 12:18:
> On 7 Apr 2014, at 5:40 pm, Tomas Lidén <tomas.liden at liu.se> wrote:
>
>> Thanks for quick and adequate response!
>> But still there's trouble... see below
>> /T
>>
>> Guido Tack wrote 2014-04-07 02:03:
>>> Hi,
>>>
>>> to add a system folder such as /usr/local, open the "Add Files to..." dialog, press Command+Shift+G, and enter the path directly.
>>>
>> Great. That got me halfway.
>> After adding the frameworks QtGui, QtWidgets and QtCore and adjusting the include statements to
>> #include <QtGui/QtGui>
>> #include <QtWidgets/QtWidgets>
>> the compilation ends with the following error:
>> /usr/local/qt5.1.0/lib/QtCore.framework/Headers/qlist.h:52:10: 'initializer_list' file not found
>>
>> According to (http://comments.gmane.org/gmane.comp.lib.qt.user/8357) and (the subsequent links) this is due to Qt requiring -stdlib=libc+ (not libc++ ?) and c++11 - which is in conflict with libstdc++ that is required by Gecode. Hmm.. I can't figure out to get passed this - tried varies ways in Xcode, but no luck so far. Should I perhaps download and install Qt directly from the source rather than using the version coming with Gecode?
> I will probably build new packages soon based on libc++ and linked to the newest version of Qt, but until then you basically have two alternatives: compile Gecode from sources with libc++, or compile Qt from sources with libstdc++.
>
Great. I will await the new builds. And until then I'll do without Qt.
>>> On the command line, I think Xcode may have changed the default paths for frameworks, you could try adding -F/Library/Frameworks to your compiler options.
>>>
>> That almost did the trick. Again I had to add options for selecting libstdc++ etc, but still I get an error. After trying the (what I think) options that Xcode uses I get:
>>
>> $ g++ -std=gnu++11 -stdlib=libstdc++ -O3 -F/Library/Frameworks -c money.cpp
>> money.cpp:1:1: error: expected unqualified-id
>> <U+001C>/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
>> ^
> Have a look at the money.cpp file, looks like there's a funny character on the first line.
>
>
:-§ That was a creepy one! And I had to pick just that file... Removing 
the character did the trick. Maybe you should fix that in the next build 
as well.

And in MGP section 2.3.2 there's some minor issues:
1) Correct the command line example - the last line should at least end 
with send-more-money.o
2) Update the Xcode description regarding adding frameworks

Thanks again for your help!
/Tomas




More information about the users mailing list