Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / C++ Tier 2 - STD library header files can't be found on Mac but can on Windows

Author
Message
RGBZ
7
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 26th May 2017 00:36
I am developing a game using tier 2 and I'm currently setting up the infrastructure of my game. I am also working on two machines depending on where I am during the day. I code on a mac with xcode sometimes and other times I use a windows machine with visual studio 2017. I have only the common files checked into source control and make use of the appropriate templates on the two platforms. So far, except for a few issues that I was able to resolve, I have been able to work on the same code on both machines using bit bucket for source control.

But today I was working on the windows machine and made use of the tuple in one of my classes so that I can return some iterators for traversing a vector. On the windows machine everything works correctly.

I had to switch to my mac and pulled my changes and I ran into one issue that I can't seem to figure out. XCode is complaining that it can't find the <tuple> header file and won't compile, that is the only error of all the things I added to my project today. Is there some issue in XCode that it can't locate a standard C++ library?

I also have my XCode project set with the following c and c++ settings:
C++ language dialect GNU++14
C++ Standard Library Compiler Default
C language dialect Compiler Default.

All of my cpp files in xcode are set as Objective C++ Source
and all of my header files are set as Default C Header.

Also I am making use of other standard libraries with issue like string, vector, map, etc... without issues on both the mac and the windows machine

Any ideas would be greatly appreciated.
RGBZ
7
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 26th May 2017 03:03
I still couldn't get XCode to find the tuple header file when it has no problem finding all the other std libraries I am using.

I would still like to know why it can't locate it if anyone has any ideas, but I did take a different approach that is probably better in this case.

Instead if using a tuple I created a template generic class to transport the vector iterators that I needed and it is working well.
Lucas Tiridath
AGK Developer
16
Years of Service
User Offline
Joined: 28th Sep 2008
Location: Kings Langley, UK
Posted: 26th May 2017 19:38
Hi RGBZ. Yes unfortunately if you're needing to build for OS X using Tier 2, you won't be able to use any C++11 or newer standard libraries. The tuple header was new in C++11 I believe, which is why you can't use it. This is also why your other includes are working. string, vector, and map were all in C++98/03.

To elaborate further, you were on the right lines trying to change your compiler settings. However the issue isn't actually the compiler but the standard library implementation. AppGameKit is built with libstdc++ on OS X and iOS, which doesn't support C++11. Unfortunately whilst you can change your own project over to using libc++, which does support C++11, you'll be able to compile your code but be unable to link with the AppGameKit libraries, because you will get a whole load of symbol redefinition linker errors. I have mentioned this before and asked that this be changed, so given how much activity is going on around AppGameKit at the moment, I think there is some hope for this. However for the time being, we're stuck using C++03 libraries.
RGBZ
7
Years of Service
User Offline
Joined: 19th Apr 2017
Location:
Posted: 27th May 2017 13:24
Thank you for the reply. That helps a lot and I also hope that we can make use of the newer features in c++ soon.
Alex_Peres
AGK Master
15
Years of Service
User Offline
Joined: 13th May 2009
Location: The Milky Way Galaxy
Posted: 27th May 2017 19:19
The same story with Android...

Login to post a reply

Server time is: 2024-09-30 03:22:46
Your offset time is: 2024-09-30 03:22:46