mercredi 25 décembre 2019

Something wrong when I tried to add C++11 support to my Xcode project in Mac Terminal

I have a Xcode project built by Cmake, this project needs C++ 11 support, I used to do this in my Xcode project settings: change "C++ Language Dialect" to "GNU++11[std=gnu++1]" and change "C++ Standard Library:" to "libc++(LLVM C++ standard library with C++ 11 support)", which is a manually work. But now I have to do it on Jenkins, so all the stuff must be implemented in my Mac Terminal.

This is the procedure before:

mkdir -p build_ios && cd build_ios
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake   -GXcode ../
(open Xcode project, change settings to support C++11 in Navigation project)
cd ..
cmake --build build_ios --config Release

Now I do this:

mkdir -p build_ios && cd build_ios
cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake   -GXcode ../
clang++ -std=c++11 -stdlib=libc++ -Weverything ../../../Src/libRecastDLL.cpp -I ../../../../Navigation -I ../../../../Detour
cd ..
cmake --build build_ios --config Release

By the way, this project is used to produce libRecast.a file, I add "-I ../../../../Navigation -I ../../../../Detour" because it tells me some header file cannot be found.

here is the wrong msg:

In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
../../../../Navigation/NavMesh.h:2:9: warning: macro name is a reserved
      identifier [-Wreserved-id-macro]
#define _NAVMESH_H_
        ^
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:5:
../../../../Detour/DetourNavMesh.h:102:26: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_TILE_FREE_DATA = 0x01,
                                ^
../../../../Detour/DetourNavMesh.h:110:43: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_STRAIGHTPATH_OFFMESH_CONNECTION = 0x04,      ///< The vertex ...
                                                 ^
../../../../Detour/DetourNavMesh.h:117:38: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_STRAIGHTPATH_ALL_CROSSINGS = 0x02,   ///< Add a vertex at eve...
                                            ^
../../../../Detour/DetourNavMesh.h:124:30: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_FINDPATH_ANY_ANGLE   = 0x02,         ///< use raycasts durin...
                                      ^
../../../../Detour/DetourNavMesh.h:130:29: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_RAYCAST_USE_COSTS = 0x01,            ///< Raycast should calc...
                                   ^
../../../../Detour/DetourNavMesh.h:144:36: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_POLYTYPE_OFFMESH_CONNECTION = 1,
                                          ^
../../../../Detour/DetourNavMesh.h:176:76: warning: implicit conversion loses
      integer precision: 'int' to 'unsigned char' [-Wimplicit-int-conversion]
  ...char t) { areaAndtype = (areaAndtype & 0x3f) | (t << 6); }
                           ~ ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
../../../../Detour/DetourNavMesh.h:519:11: warning: use of old-style cast
      [-Wold-style-cast]
                return ((dtPolyRef)salt << (m_polyBits+m_tileBits)) | ((...
                        ^          ~~~~
../../../../Detour/DetourNavMesh.h:519:58: warning: use of old-style cast
      [-Wold-style-cast]
  ...((dtPolyRef)salt << (m_polyBits+m_tileBits)) | ((dtPolyRef)it << m_polyB...
                                                     ^          ~~
../../../../Detour/DetourNavMesh.h:519:89: warning: use of old-style cast
      [-Wold-style-cast]
  ...| ((dtPolyRef)it << m_polyBits) | (dtPolyRef)ip;
                                       ^          ~~
../../../../Detour/DetourNavMesh.h:540:31: warning: use of old-style cast
      [-Wold-style-cast]
                const dtPolyRef saltMask = ((dtPolyRef)1<<m_saltBits)-1;
                                            ^          ~
../../../../Detour/DetourNavMesh.h:541:31: warning: use of old-style cast
      [-Wold-style-cast]
                const dtPolyRef tileMask = ((dtPolyRef)1<<m_tileBits)-1;
                                            ^          ~
../../../../Detour/DetourNavMesh.h:542:31: warning: use of old-style cast
      [-Wold-style-cast]
                const dtPolyRef polyMask = ((dtPolyRef)1<<m_polyBits)-1;
                                            ^          ~
../../../../Detour/DetourNavMesh.h:543:10: warning: use of old-style cast
      [-Wold-style-cast]
  ...salt = (unsigned int)((ref >> (m_polyBits+m_tileBits)) & saltMask);
            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../Detour/DetourNavMesh.h:544:8: warning: use of old-style cast
      [-Wold-style-cast]
                it = (unsigned int)((ref >> m_polyBits) & tileMask);
                     ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../Detour/DetourNavMesh.h:545:8: warning: use of old-style cast
      [-Wold-style-cast]
                ip = (unsigned int)(ref & polyMask);
                     ^             ~~~~~~~~~~~~~~~~
../../../../Detour/DetourNavMesh.h:559:31: warning: use of old-style cast
      [-Wold-style-cast]
                const dtPolyRef saltMask = ((dtPolyRef)1<<m_saltBits)-1;
                                            ^          ~
../../../../Detour/DetourNavMesh.h:560:10: warning: use of old-style cast
      [-Wold-style-cast]
  ...return (unsigned int)((ref >> (m_polyBits+m_tileBits)) & saltMask);
            ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../Detour/DetourNavMesh.h:574:31: warning: use of old-style cast
      [-Wold-style-cast]
                const dtPolyRef tileMask = ((dtPolyRef)1<<m_tileBits)-1;
                                            ^          ~
../../../../Detour/DetourNavMesh.h:575:10: warning: use of old-style cast
      [-Wold-style-cast]
                return (unsigned int)((ref >> m_polyBits) & tileMask);
                       ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../Detour/DetourNavMesh.h:589:31: warning: use of old-style cast
      [-Wold-style-cast]
                const dtPolyRef polyMask = ((dtPolyRef)1<<m_polyBits)-1;
                                            ^          ~
../../../../Detour/DetourNavMesh.h:590:10: warning: use of old-style cast
      [-Wold-style-cast]
                return (unsigned int)(ref & polyMask);
                       ^             ~~~~~~~~~~~~~~~~
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:6:
../../../../Detour/DetourNavMeshQuery.h:403:19: warning: parameter 'flags' not
      found in the function declaration [-Wdocumentation]
        ///  @param[in]         flags           govern how the raycast b...
                                ^~~~~
../../../../Detour/DetourNavMeshQuery.h:403:19: note: did you mean 'options'?
        ///  @param[in]         flags           govern how the raycast b...
                                ^~~~~
                                options
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:7:
../../../../Detour/DetourTileCache.h:15:36: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
  ...= 0x01,                                    ///< Navmesh owns the tile m...
           ^
../../../../Detour/DetourTileCache.h:35:22: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_OBSTACLE_REMOVING,
                            ^
../../../../Detour/DetourTileCache.h:42:26: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
        DT_OBSTACLE_ORIENTED_BOX, // OBB
                                ^
../../../../Detour/DetourTileCache.h:222:17: warning: commas at the end of
      enumerator lists are incompatible with C++98 [-Wc++98-compat-pedantic]
                REQUEST_REMOVE,
                              ^
../../../../Detour/DetourTileCache.h:162:77: warning: zero as null pointer
      constant [-Wzero-as-null-pointer-constant]
  ...float dt, class dtNavMesh* navmesh, bool* upToDate = 0);
                                                          ^
                                                          nullptr
../../../../Detour/DetourTileCache.h:176:11: warning: use of old-style cast
      [-Wold-style-cast]
                return ((dtCompressedTileRef)salt << m_tileBits) | (dtCo...
                        ^                    ~~~~
../../../../Detour/DetourTileCache.h:176:54: warning: use of old-style cast
      [-Wold-style-cast]
  ...((dtCompressedTileRef)salt << m_tileBits) | (dtCompressedTileRef)it;
                                                 ^                    ~~
../../../../Detour/DetourTileCache.h:182:41: warning: use of old-style cast
      [-Wold-style-cast]
  ...const dtCompressedTileRef saltMask = ((dtCompressedTileRef)1<<m_saltBits...
                                           ^                    ~
../../../../Detour/DetourTileCache.h:183:10: warning: use of old-style cast
      [-Wold-style-cast]
                return (unsigned int)((ref >> m_tileBits) & saltMask);
                       ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../Detour/DetourTileCache.h:189:41: warning: use of old-style cast
      [-Wold-style-cast]
  ...const dtCompressedTileRef tileMask = ((dtCompressedTileRef)1<<m_tileBits...
                                           ^                    ~
../../../../Detour/DetourTileCache.h:190:10: warning: use of old-style cast
      [-Wold-style-cast]
                return (unsigned int)(ref & tileMask);
                       ^             ~~~~~~~~~~~~~~~~
../../../../Detour/DetourTileCache.h:196:11: warning: use of old-style cast
      [-Wold-style-cast]
                return ((dtObstacleRef)salt << 16) | (dtObstacleRef)it;
                        ^              ~~~~
../../../../Detour/DetourTileCache.h:196:40: warning: use of old-style cast
      [-Wold-style-cast]
                return ((dtObstacleRef)salt << 16) | (dtObstacleRef)it;
                                                     ^              ~~
../../../../Detour/DetourTileCache.h:202:35: warning: use of old-style cast
      [-Wold-style-cast]
                const dtObstacleRef saltMask = ((dtObstacleRef)1<<16)-1;
                                                ^              ~
../../../../Detour/DetourTileCache.h:203:10: warning: use of old-style cast
      [-Wold-style-cast]
                return (unsigned int)((ref >> 16) & saltMask);
                       ^             ~~~~~~~~~~~~~~~~~~~~~~~~
../../../../Detour/DetourTileCache.h:209:35: warning: use of old-style cast
      [-Wold-style-cast]
                const dtObstacleRef tileMask = ((dtObstacleRef)1<<16)-1;
                                                ^              ~
../../../../Detour/DetourTileCache.h:210:10: warning: use of old-style cast
      [-Wold-style-cast]
                return (unsigned int)(ref & tileMask);
                       ^             ~~~~~~~~~~~~~~~~
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
../../../../Navigation/NavMesh.h:48:89: warning: 'nullptr' is incompatible with
      C++98 [-Wc++98-compat]
  ...start, const float* end, float* hitpt, float* out_tangent = nullptr);
                                                                 ^
../../../../Navigation/NavMesh.h:59:23: warning: zero as null pointer constant
      [-Wzero-as-null-pointer-constant]
                        float* outPoints = 0, int* outPointCount = 0);
                                           ^
                                           nullptr
../../../../Navigation/NavMesh.h:59:47: warning: zero as null pointer constant
      [-Wzero-as-null-pointer-constant]
                        float* outPoints = 0, int* outPointCount = 0);
                                                                   ^
                                                                   nullptr
../../../../Navigation/NavMesh.h:113:51: warning: 'nullptr' is incompatible with
      C++98 [-Wc++98-compat]
                void tileCacheUpdate(float dt, bool* complete = nullptr);
                                                                ^
../../../../Navigation/NavMesh.h:86:26: warning: zero as null pointer constant
      [-Wzero-as-null-pointer-constant]
                        if (debug_log_func != NULL)
                                              ^~~~
                                              nullptr
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include/stddef.h:100:18: note:
      expanded from macro 'NULL'
#    define NULL __null
                 ^
In file included from ../../../Src/libRecastDLL.cpp:1:
../../../Src/libRecastDLL.h:21:7: warning: no previous extern declaration for
      non-static variable 'LoadSucceed' [-Wmissing-variable-declarations]
        bool LoadSucceed = false;
             ^
../../../Src/libRecastDLL.cpp:4:16: warning: declaration requires an exit-time
      destructor [-Wexit-time-destructors]
static NavMesh sdg_nav;
               ^
../../../Src/libRecastDLL.cpp:4:16: warning: declaration requires a global
      destructor [-Wglobal-constructors]
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
../../../../Navigation/NavMesh.h:82:11: warning: padding class
      'RecastNavigation::NavMesh' with 4 bytes to align 'debug_log_func'
      [-Wpadded]
                FuncPtr debug_log_func;
                        ^
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:5:
../../../../Detour/DetourNavMesh.h:649:15: warning: padding class 'dtNavMesh'
      with 4 bytes to align 'm_posLookup' [-Wpadded]
        dtMeshTile** m_posLookup;                       ///< Tile hash lookup.
                     ^
../../../../Detour/DetourNavMesh.h:323:7: warning: padding size of 'dtNavMesh'
      with 4 bytes to alignment boundary [-Wpadded]
class dtNavMesh
      ^
../../../../Detour/DetourNavMesh.h:186:8: warning: padding size of
      'dtPolyDetail' with 2 bytes to alignment boundary [-Wpadded]
struct dtPolyDetail
       ^
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:6:
../../../../Detour/DetourNavMeshQuery.h:550:18: warning: padding struct
      'dtNavMeshQuery::dtQueryData' with 4 bytes to align 'lastBestNode'
      [-Wpadded]
                struct dtNode* lastBestNode;
                               ^
../../../../Detour/DetourNavMeshQuery.h:554:24: warning: padding struct
      'dtNavMeshQuery::dtQueryData' with 4 bytes to align 'filter' [-Wpadded]
                const dtQueryFilter* filter;
                                     ^
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:7:
../../../../Detour/DetourTileCache.h:243:20: warning: padding class
      'dtTileCache' with 4 bytes to align 'm_talloc' [-Wpadded]
        dtTileCacheAlloc* m_talloc;
                          ^
../../../../Detour/DetourTileCache.h:21:33: warning: padding struct
      'dtCompressedTile' with 4 bytes to align 'header' [-Wpadded]
        struct dtTileCacheLayerHeader* header;
                                       ^
../../../../Detour/DetourTileCache.h:24:17: warning: padding struct
      'dtCompressedTile' with 4 bytes to align 'data' [-Wpadded]
        unsigned char* data;
                       ^
../../../../Detour/DetourTileCache.h:82:23: warning: padding struct
      'dtTileCacheObstacle' with 2 bytes to align 'next' [-Wpadded]
        dtTileCacheObstacle* next;
                             ^
../../../Src/libRecastDLL.cpp:91:57: warning: zero as null pointer constant
      [-Wzero-as-null-pointer-constant]
        return sdg_nav.raycast(startPoint, endPoint, hitPoint, 0);
                                                               ^
                                                               nullptr
../../../Src/libRecastDLL.cpp:219:2: warning: C++98 requires newline at end of
      file [-Wc++98-compat-pedantic]
}
 ^
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:6:
../../../../Detour/DetourNavMeshQuery.h:154:7: warning: 'dtPolyQuery' has no
      out-of-line virtual method definitions; its vtable will be emitted in
      every translation unit [-Wweak-vtables]
class dtPolyQuery
      ^
In file included from ../../../Src/libRecastDLL.cpp:1:
In file included from ../../../Src/libRecastDLL.h:4:
In file included from ../../../../Navigation/NavMesh.h:7:
../../../../Detour/DetourTileCache.h:98:8: warning: 'dtTileCacheMeshProcess' has
      no out-of-line virtual method definitions; its vtable will be emitted in
      every translation unit [-Wweak-vtables]
struct dtTileCacheMeshProcess
       ^
63 warnings generated.
Undefined symbols for architecture x86_64:
  "RecastNavigation::NavMesh::setExtents(float, float, float)", referenced from:
      _setExtents in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::addObstacle(float const*, float, float, unsigned int*)", referenced from:
      _addObstacle in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::loadNavMesh(char const*)", referenced from:
      _loadNavMeshData in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::setAreaCost(int, float)", referenced from:
      _setAreaCost in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::findFullPath(float const*, float const*, float*, int&, unsigned char*, unsigned int*, unsigned int*)", referenced from:
      _findFullPath in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::nearestPoint(float const*, NavmeshPoint*)", referenced from:
      _nearestPoint in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::addBoxObstacle(float const*, float const*, unsigned int*)", referenced from:
      _addAABBBoxObstacle in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::addBoxObstacle(float const*, float const*, float, unsigned int*)", referenced from:
      _addBoxObstacle in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::findFollowPath(float const*, float const*, float*, int&)", referenced from:
      _findFollowPath in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::findSlicedPath(float const*, float const*, float*, int&)", referenced from:
      _findSlicedPath in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::removeObstacle(unsigned int)", referenced from:
      _removeObstacle in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::getExcludeFlags()", referenced from:
      _getExcludeFlags in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::getIncludeFlags()", referenced from:
      _getIncludeFlags in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::setExcludeFlags(unsigned int)", referenced from:
      _setExcludeFlags in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::setIncludeFlags(unsigned int)", referenced from:
      _setIncludeFlags in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::tileCacheUpdate(float, bool*)", referenced from:
      _tileCacheUpdate in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::findStraightPath(float const*, float const*, float*, int&, unsigned char*, unsigned int*)", referenced from:
      _findStraightPath in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::resetExcludeFlags()", referenced from:
      _resetExcludeFlags in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::resetIncludeFlags()", referenced from:
      _resetIncludeFlags in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::loadTileCacheNavMesh(char const*, char const*, float)", referenced from:
      _loadTileCacheNavMeshData in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::buildNavMeshFromBuffer(unsigned char const*, unsigned long, bool)", referenced from:
      _buildNavMeshFromBuffer in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::findRandomPointAroundCircle(NavmeshPoint, float, NavmeshPoint*)", referenced from:
      _randomPoint in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::buildTileCacheNavMeshFromBuffer(unsigned char const*, unsigned long, char*, float)", referenced from:
      _buildTileCacheNavMeshFromBuffer in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::posArea(float, float, float, unsigned char*)", referenced from:
      _posArea in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::raycast(float const*, float const*, float*, float*)", referenced from:
      _raycast in libRecastDLL-a6a712.o
      _raycastGetTangent in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::posHeight(float, float, float&)", referenced from:
      _posHeight in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::NavMesh()", referenced from:
      ___cxx_global_var_init in libRecastDLL-a6a712.o
  "RecastNavigation::NavMesh::~NavMesh()", referenced from:
      ___cxx_global_var_init in libRecastDLL-a6a712.o
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
bigworld@woodyplus build_ios %

Aucun commentaire:

Enregistrer un commentaire