recastnavigation + irrlicht

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
easy163
Posts: 24
Joined: Wed Jul 10, 2013 12:50 pm

recastnavigation + irrlicht

Post by easy163 »

Hi, I downloaded recastnavigation and can't compile the demo example of which is found on the forum http://irrlicht.sourceforge.net/forum/v ... =9&t=47017.
Demo example of the recastnavigation compiled without problems.
In the debugger writes

Code: Select all

1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcBuildContours(class rcContext *,struct rcCompactHeightfield &,float,int,struct rcContourSet &,int)" (?rcBuildContours@@YA_NPAVrcContext@@AAUrcCompactHeightfield@@MHAAUrcContourSet@@H@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFreeHeightField(struct rcHeightfield *)" (?rcFreeHeightField@@YAXPAUrcHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention duLogBuildTimes(class rcContext &,int)" (?duLogBuildTimes@@YAXAAVrcContext@@H@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcBuildRegionsMonotone(class rcContext *,struct rcCompactHeightfield &,int,int,int)" (?rcBuildRegionsMonotone@@YA_NPAVrcContext@@AAUrcCompactHeightfield@@HHH@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcRasterizeTriangles(class rcContext *,float const *,int,int const *,unsigned char const *,int,struct rcHeightfield &,int)" (?rcRasterizeTriangles@@YAXPAVrcContext@@PBMHPBHPBEHAAUrcHeightfield@@H@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFreeContourSet(struct rcContourSet *)" (?rcFreeContourSet@@YAXPAUrcContourSet@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcBuildRegions(class rcContext *,struct rcCompactHeightfield &,int,int,int)" (?rcBuildRegions@@YA_NPAVrcContext@@AAUrcCompactHeightfield@@HHH@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcBuildPolyMeshDetail(class rcContext *,struct rcPolyMesh const &,struct rcCompactHeightfield const &,float,float,struct rcPolyMeshDetail &)" (?rcBuildPolyMeshDetail@@YA_NPAVrcContext@@ABUrcPolyMesh@@ABUrcCompactHeightfield@@MMAAUrcPolyMeshDetail@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcCreateHeightfield(class rcContext *,struct rcHeightfield &,int,int,const float *a,const float *,float,float)" (?rcCreateHeightfield@@YA_NPAVrcContext@@AAUrcHeightfield@@HHPBM2MM@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFilterLowHangingWalkableObstacles(class rcContext *,int,struct rcHeightfield &)" (?rcFilterLowHangingWalkableObstacles@@YAXPAVrcContext@@HAAUrcHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcCalcBounds(float const *,int,float *,float *)" (?rcCalcBounds@@YAXPBMHPAM1@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcBuildPolyMesh(class rcContext *,struct rcContourSet &,int,struct rcPolyMesh &)" (?rcBuildPolyMesh@@YA_NPAVrcContext@@AAUrcContourSet@@HAAUrcPolyMesh@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcCalcGridSize(const float *a,const float *a,float,int *,int *)" (?rcCalcGridSize@@YAXPBM0MPAH1@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcMarkWalkableTriangles(class rcContext *,float,float const *,int,int const *,int,unsigned char *)" (?rcMarkWalkableTriangles@@YAXPAVrcContext@@MPBMHPBHHPAE@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFilterLedgeSpans(class rcContext *,int,int,struct rcHeightfield &)" (?rcFilterLedgeSpans@@YAXPAVrcContext@@HHAAUrcHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFilterWalkableLowHeightSpans(class rcContext *,int,struct rcHeightfield &)" (?rcFilterWalkableLowHeightSpans@@YAXPAVrcContext@@HAAUrcHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcBuildDistanceField(class rcContext *,struct rcCompactHeightfield &)" (?rcBuildDistanceField@@YA_NPAVrcContext@@AAUrcCompactHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcErodeWalkableArea(class rcContext *,int,struct rcCompactHeightfield &)" (?rcErodeWalkableArea@@YA_NPAVrcContext@@HAAUrcCompactHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "public: void Convention rcContext::log(enum rcLogCategory,char const *,...)" (?log@rcContext@@QAAXW4rcLogCategory@@PBDZZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFreeCompactHeightfield(struct rcCompactHeightfield *)" (?rcFreeCompactHeightfield@@YAXPAUrcCompactHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall BuildContext::AC BuildContext(void)" (??1BuildContext@@UAE@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol "public: __thiscall BuildContext::BuildContext(void)" (??0BuildContext@@QAE@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFreePolyMesh(struct rcPolyMesh *)" (?rcFreePolyMesh@@YAXPAUrcPolyMesh@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""bool Convention rcBuildCompactHeightfield(class rcContext *,int,int,struct rcHeightfield &,struct rcCompactHeightfield &)" (?rcBuildCompactHeightfield@@YA_NPAVrcContext@@HHAAUrcHeightfield@@AAUrcCompactHeightfield@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol "void Convention rcFreePolyMeshDetail(struct rcPolyMeshDetail *)" (?rcFreePolyMeshDetail@@YAXPAUrcPolyMeshDetail@@@Z)
1>recast_util.obj : error LNK2001: unresolved external symbol ""struct rcCompactHeightfield * Convention rcAllocCompactHeightfield(void)" (?rcAllocCompactHeightfield@@YAPAUrcCompactHeightfield@@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol ""struct rcContourSet * Convention rcAllocContourSet(void)" (?rcAllocContourSet@@YAPAUrcContourSet@@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol ""struct rcPolyMeshDetail * Convention rcAllocPolyMeshDetail(void)" (?rcAllocPolyMeshDetail@@YAPAUrcPolyMeshDetail@@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol ""struct rcPolyMesh * Convention rcAllocPolyMesh(void)" (?rcAllocPolyMesh@@YAPAUrcPolyMesh@@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol ""struct rcHeightfield * Convention rcAllocHeightfield(void)" (?rcAllocHeightfield@@YAPAUrcHeightfield@@XZ)"
1>C:\SDK\Project\pathfinder\Release\pathfinder.exe : fatal error LNK1120: unresolved external elements: 30
The way that I plugged
Image

What could be the problem? Please help :(

Spread the project in Visual Studio 2012 http://puu.sh/4m5BL.zip
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: recastnavigation + irrlicht

Post by smso »

Check the following:

1. Make sure that the relevant .cpp files are compiled to the corresponding object files, e.g. RecastMesh.cpp to RecastMesh.o
2. Could the compiler find the object files?
3. Have you linked the object files?

Regards,
smso
easy163
Posts: 24
Joined: Wed Jul 10, 2013 12:50 pm

Re: recastnavigation + irrlicht

Post by easy163 »

Here is the last version of the project and libraries (3 pieces)
http://yadi.sk/d/4q8cCusF8tthN
http://yadi.sk/d/A0GjLLEt8uBNs
I compiled static library and now writes only 2 errors
Can see what did I do wrong?
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: recastnavigation + irrlicht

Post by smso »

easy163 wrote:Here is the last version of the project and libraries (3 pieces)
http://yadi.sk/d/4q8cCusF8tthN
http://yadi.sk/d/A0GjLLEt8uBNs
I compiled static library and now writes only 2 errors
Can see what did I do wrong?
It's helpful if you could post the 2 errors in compilation.

Regards,
smso
easy163
Posts: 24
Joined: Wed Jul 10, 2013 12:50 pm

Re: recastnavigation + irrlicht

Post by easy163 »

the libraries not found the correct function is likely, although everything seems to compile correctly :(

Code: Select all

 
1>------ Build started: project: pathfinder, Configuration: Release Win32 ------
1>recast_util.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall BuildContext::AC BuildContext(void)" (??1BuildContext@@UAE@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol "public: __thiscall BuildContext::BuildContext(void)" (??0BuildContext@@QAE@XZ)"
1>C:\SDK\Project\pathfinder\Release\pathfinder.exe : fatal error LNK1120: unresolved external elements: 2
========== Building: success: 0, errors: 1 changed: 0 skipped: 0 ==========
 
smso
Posts: 246
Joined: Fri Jun 04, 2010 3:28 pm
Location: Hong Kong

Re: recastnavigation + irrlicht

Post by smso »

easy163 wrote:the libraries not found the correct function is likely, although everything seems to compile correctly :(

Code: Select all

 
1>------ Build started: project: pathfinder, Configuration: Release Win32 ------
1>recast_util.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall BuildContext::AC BuildContext(void)" (??1BuildContext@@UAE@XZ)"
1>recast_util.obj : error LNK2001: unresolved external symbol "public: __thiscall BuildContext::BuildContext(void)" (??0BuildContext@@QAE@XZ)"
1>C:\SDK\Project\pathfinder\Release\pathfinder.exe : fatal error LNK1120: unresolved external elements: 2
========== Building: success: 0, errors: 1 changed: 0 skipped: 0 ==========
 
I guess the linker cannot find the recast_util.obj file. Please check your version of Visual Studio on how to include the .obj file or its location in the linker's properties.

Or, as a workaround, you can try appending the absolute path of the object file to the LIB environment variable.

Regards,
smso
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: recastnavigation + irrlicht

Post by mongoose7 »

The linker has recast_util.obj. It cannot find the references in that file, namely BuildContext and AC BuildContext (??!!).
easy163
Posts: 24
Joined: Wed Jul 10, 2013 12:50 pm

Re: recastnavigation + irrlicht

Post by easy163 »

Compiled neatly, 5 libraries recastnavigation. An example could gather, when you start the Console writes that generated the navmesh, but after the app crashes. Perhaps the example of the curve, try to write itself. Thanks for the help :)
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: recastnavigation + irrlicht

Post by mongoose7 »

Compile it for debug then run it in the debugger to find where the crash occurs.
easy163
Posts: 24
Joined: Wed Jul 10, 2013 12:50 pm

Re: recastnavigation + irrlicht

Post by easy163 »

Find other libraries, the library found AI http://inexin.sourceforge.net/. There is a function of the host Triangles

Code: Select all

 
ai_index AI_NavigationMesh::addEdge  ( ai_index  i_t1,  
  ai_index  i_t2,  
  ai_index  i_v1,  
  ai_index  i_v2   
 )    
 
Add edge into navigation mesh. 
Parameters:
 i_t1  Index of the first adjacent triangle of winged edge.  
 i_t2  Index of the second adjacent triangle of winged edge.  
 i_v1  Index of the first vertex of the edge.  
 i_v2  Index of the second vertex of the edge.  
 
I can not understand that the first and second her post, now at the top of the mesh 4, 2 triangles, 5 faces.
I touch all the vertices and add their coordinates

Code: Select all

navigation_mesh.addVertex(*listVertexPositionIterator);
Then I realized that would convey the triangles should be sent to the top three. So far I've manually added them to avoid mistakes, those indexes that I received when iterating vertices.

Code: Select all

 
navigation_mesh.addTriangle(0,1,2);
navigation_mesh.addTriangle(1,0,3);
 
Next you need to add 5 edge, I can not understand what I'm doing wrong. Add 3 edge of the first triangle

Code: Select all

 
navigation_mesh.addEdge(0,1,0,1);
navigation_mesh.addEdge(0,1,1,2);
navigation_mesh.addEdge(0,1,2,0);
 
Next, 3 or 2 CSE need? Even if you add only one like this

Code: Select all

navigation_mesh.addEdge(1,0,1,3);
When you start writing that the triangles are too many edges.
What am I doing wrong? :(
Post Reply