but0n / recastCLI.js

CLI tool & Node.js addon to generate navigation mesh
MIT License
49 stars 16 forks source link

Compilation error #11

Open mimooh opened 6 years ago

mimooh commented 6 years ago

First thing is I cannot find /usr/include/node/node.h. Which I fix by adding this line to makefile: CPPFLAGS+=-I/usr/include/node/

make[1]: Leaving directory '/home/mimooh/recastCLI.js-nodejs/recast' ===> Building main.a: make[1]: Entering directory '/home/mimooh/recastCLI.js-nodejs/main' CC build.o CC port.o port.cpp:3:18: fatal error: node.h: No such file or directory compilation terminated.

: recipe for target 'port.o' failed make[1]: *** [port.o] Error 1 make[1]: Leaving directory '/home/mimooh/recastCLI.js-nodejs/main' makefile:13: recipe for target 'main' failed make: *** [main] Error 2 Second thing is I get this compile error: recastCLI.js-nodejs$ make ===> Building recast.a: make[1]: Entering directory '/home/mimooh/recastCLI.js-nodejs/recast' CC RecastAlloc.o CC RecastMeshDetail.o CC RecastRasterization.o CC RecastLayers.o CC RecastFilter.o CC RecastMesh.o CC ChunkyTriMesh.o CC InputGeom.o CC RecastContour.o CC MeshLoaderObj.o CC RecastAssert.o CC RecastRegion.o CC Recast.o CC RecastArea.o AR all make[1]: Leaving directory '/home/mimooh/recastCLI.js-nodejs/recast' ===> Building main.a: make[1]: Entering directory '/home/mimooh/recastCLI.js-nodejs/main' CC build.o CC port.o CC main.o main.cpp: In function 'int main(int, const char**)': main.cpp:49:236: error: cannot convert 'const char*' to 'float' for argument '1' to 'char* build(float, float, float, float, float, float, float, float, float, float, float, float, float)' _agentMaxClimp, c_agentMaxSlope, c_regionMinSize, c_regionMergeSize, c_edgeMaxLen, c_edgeMaxError, c_vertsPerPoly, c_detailSampleDist, c_detailSampleMaxErro); ^ : recipe for target 'main.o' failed make[1]: *** [main.o] Error 1 make[1]: Leaving directory '/home/mimooh/recastCLI.js-nodejs/main' makefile:13: recipe for target 'main' failed make: *** [main] Error 2
but0n commented 6 years ago

Hi, To generate executable binary file, you should switch to master branch first [#9] Probably the document is not clear enough, my mistake ; )

mimooh commented 6 years ago

OK, this time I get this error on Ubuntu 16.04:

mimooh:master$ pwd /home/git/recastCLI.js.git/branches/master mimooh:master$ make ===> Building recast.a: make[1]: Entering directory '/home/git/recastCLI.js.git/branches/master/recast' AR all make[1]: Leaving directory '/home/git/recastCLI.js.git/branches/master/recast' ===> Building main.a: make[1]: Entering directory '/home/git/recastCLI.js.git/branches/master/main' CC build.o build.cpp: In function 'int build(const char*, float, float, float, float, float, int, int, int, int, float, int, int, int)': build.cpp:106:33: error: 'memset' was not declared in this scope memset(&m_cfg, 0, sizeof(m_cfg)); ^

: recipe for target 'build.o' failed make[1]: *** [build.o] Error 1 make[1]: Leaving directory '/home/git/recastCLI.js.git/branches/master/main' makefile:13: recipe for target 'main' failed make: *** [main] Error 2
mimooh commented 6 years ago

May be confusing, because I use svn in github. But with git it is the same for me:

mimooh:recastCLI.js$ git checkout master Branch master set up to track remote branch master from origin. Switched to a new branch 'master' mimooh:recastCLI.js$ ls main recast LICENSE README.md dungeon.obj make.config makefile nav_test.obj mimooh:recastCLI.js$ make ===> Building recast.a: make[1]: Entering directory '/home/git/recastCLI.js/recast' CC RecastAlloc.o CC RecastMeshDetail.o CC RecastRasterization.o CC RecastLayers.o CC RecastFilter.o CC RecastMesh.o CC RecastContour.o CC RecastAssert.o CC RecastRegion.o CC Recast.o CC RecastArea.o AR all make[1]: Leaving directory '/home/git/recastCLI.js/recast' ===> Building main.a: make[1]: Entering directory '/home/git/recastCLI.js/main' CC ChunkyTriMesh.o CC InputGeom.o CC MeshLoaderObj.o CC build.o build.cpp: In function 'int build(const char*, float, float, float, float, float, int, int, int, int, float, int, int, int)': build.cpp:106:33: error: 'memset' was not declared in this scope memset(&m_cfg, 0, sizeof(m_cfg)); ^

: recipe for target 'build.o' failed make[1]: *** [build.o] Error 1 make[1]: Leaving directory '/home/git/recastCLI.js/main' makefile:13: recipe for target 'main' failed make: *** [main] Error 2
but0n commented 6 years ago

Fixed memset issues, but still have some trouble #8

MrSonicMaster commented 6 years ago

I'm getting this

===> Building recast.a:
make[1]: Entering directory '/home/mrsonic/Downloads/master/recast'
AR all
make[1]: Leaving directory '/home/mrsonic/Downloads/master/recast'
===> Building main.a:
make[1]: Entering directory '/home/mrsonic/Downloads/master/main'
CC port.o
CC main.o
main.cpp: In function ‘int main(int, const char**)’:
main.cpp:49:236: error: cannot convert ‘const char*’ to ‘float’ for argument ‘1’ to ‘char* build(float, float, float, float, float, float, float, float, float, float, float, float, float)’
 lSize, c_cellHeight, c_agentHeight, c_agentRadius, c_agentMaxClimp, c_agentMaxSlope, c_regionMinSize, c_regionMergeSize, c_edgeMaxLen, c_edgeMaxError, c_vertsPerPoly, c_detailSampleDist, c_detailSampleMaxErro);
                                                                                                                                                                                                                 ^
<builtin>: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
make[1]: Leaving directory '/home/mrsonic/Downloads/master/main'
makefile:13: recipe for target 'main' failed
make: *** [main] Error 2
but0n commented 6 years ago

@MrSonicMaster

Try node-gyp rebuild

Or switch to master branch before make git checkout master

MrSonicMaster commented 6 years ago

'/home/mrsonic/Downloads/*master*/main' I was using master branch, and node-gyp rebuild didn't/wouldn't help (as this isn't node version, it's master branch.) Thank's for the fast reply though

but0n commented 6 years ago

Probably you haven't switching to master branch correctly.

image

port.c doesn't exist in master branch.

Vagelis-Prokopiou commented 5 years ago
  1. On the nodejs branch I get the following error:
    
    # node-gyp rebuild
    internal/modules/cjs/loader.js:583
    throw err;
    ^

Error: Cannot find module 'graceful-fs' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (/usr/share/node-gyp/lib/node-gyp.js:12:10) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3)

I have graceful-fs installled globally.

2. On the `master` branch I get the following error:

make

===> Building recast.a: make[1]: Entering directory 'recastCLI.js/recast' C++ RecastAlloc.o C++ RecastLayers.o C++ RecastFilter.o C++ RecastMesh.o C++ RecastRasterization.o C++ RecastContour.o C++ RecastAssert.o C++ Recast.o C++ RecastRegion.o C++ RecastMeshDetail.o C++ RecastArea.o AR all make[1]: Leaving directory 'recastCLI.js/recast' ===> Building main.a: make[1]: Entering directory 'recastCLI.js/main' C++ ChunkyTriMesh.o C++ InputGeom.o C++ MeshLoaderObj.o C++ build.o C++ main.o AR all make[1]: Leaving directory 'recastCLI.js/main' Done C++ all main/main.a(build.o): In function build(char const*, float, float, float, float, float, int, int, int, int, float, int, int, int)': build.cpp:(.text+0x26b): undefined reference torcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0x33e): undefined reference to `rcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0x510): undefined reference to rcCalcGridSize(float const*, float const*, float, int*, int*)' build.cpp:(.text+0x538): undefined reference torcAllocHeightfield()' build.cpp:(.text+0x56b): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' build.cpp:(.text+0x5c4): undefined reference torcCreateHeightfield(rcContext, rcHeightfield&, int, int, float const, float const, float, float)' build.cpp:(.text+0x5eb): undefined reference to `rcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0x63a): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' build.cpp:(.text+0x697): undefined reference torcMarkWalkableTriangles(rcContext, float, float const, int, int const, int, unsigned char)' build.cpp:(.text+0x6d0): undefined reference to rcRasterizeTriangles(rcContext*, float const*, int, int const*, unsigned char const*, int, rcHeightfield&, int)' build.cpp:(.text+0x6fb): undefined reference torcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0x762): undefined reference to `rcFilterLowHangingWalkableObstacles(rcContext, int, rcHeightfield&)' build.cpp:(.text+0x78f): undefined reference to rcFilterLedgeSpans(rcContext*, int, int, rcHeightfield&)' build.cpp:(.text+0x7b8): undefined reference torcFilterWalkableLowHeightSpans(rcContext, int, rcHeightfield&)' build.cpp:(.text+0x7bd): undefined reference to rcAllocCompactHeightfield()' build.cpp:(.text+0x7f0): undefined reference torcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0x826): undefined reference to rcBuildCompactHeightfield(rcContext*, int, int, rcHeightfield&, rcCompactHeightfield&)' build.cpp:(.text+0x84d): undefined reference torcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0x874): undefined reference to `rcFreeHeightField(rcHeightfield)' build.cpp:(.text+0x89d): undefined reference to rcErodeWalkableArea(rcContext*, int, rcCompactHeightfield&)' build.cpp:(.text+0x8c4): undefined reference torcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0x9e7): undefined reference to `rcMarkConvexPolyArea(rcContext, float const, int, float, float, unsigned char, rcCompactHeightfield&)' build.cpp:(.text+0xa17): undefined reference to `rcBuildDistanceField(rcContext, rcCompactHeightfield&)' build.cpp:(.text+0xa3e): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' build.cpp:(.text+0xa74): undefined reference torcBuildRegions(rcContext, rcCompactHeightfield&, int, int, int)' build.cpp:(.text+0xa9f): undefined reference to `rcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0xae0): undefined reference to rcBuildRegionsMonotone(rcContext*, rcCompactHeightfield&, int, int, int)' build.cpp:(.text+0xb07): undefined reference torcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0xb34): undefined reference to `rcBuildLayerRegions(rcContext, rcCompactHeightfield&, int, int)' build.cpp:(.text+0xb5b): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' build.cpp:(.text+0xb6a): undefined reference torcAllocContourSet()' build.cpp:(.text+0xb9d): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' build.cpp:(.text+0xbe4): undefined reference torcBuildContours(rcContext, rcCompactHeightfield&, float, int, rcContourSet&, int)' build.cpp:(.text+0xc0b): undefined reference to `rcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0xc1a): undefined reference to rcAllocPolyMesh()' build.cpp:(.text+0xc4d): undefined reference torcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0xc7a): undefined reference to `rcBuildPolyMesh(rcContext, rcContourSet&, int, rcPolyMesh&)' build.cpp:(.text+0xca1): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' build.cpp:(.text+0xcb0): undefined reference torcAllocPolyMeshDetail()' build.cpp:(.text+0xce3): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' build.cpp:(.text+0xd30): undefined reference torcBuildPolyMeshDetail(rcContext, rcPolyMesh const&, rcCompactHeightfield const&, float, float, rcPolyMeshDetail&)' build.cpp:(.text+0xd57): undefined reference to `rcContext::log(rcLogCategory, char const, ...)' build.cpp:(.text+0xd7e): undefined reference to rcFreeCompactHeightfield(rcCompactHeightfield*)' build.cpp:(.text+0xd98): undefined reference torcFreeContourSet(rcContourSet)' main/main.a(InputGeom.o): In function `InputGeom::loadMesh(rcContext, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)': InputGeom.cpp:(.text+0x41d): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' InputGeom.cpp:(.text+0x474): undefined reference torcContext::log(rcLogCategory, char const, ...)' InputGeom.cpp:(.text+0x4c2): undefined reference to `rcCalcBounds(float const, int, float, float)' InputGeom.cpp:(.text+0x507): undefined reference to rcContext::log(rcLogCategory, char const*, ...)' InputGeom.cpp:(.text+0x588): undefined reference torcContext::log(rcLogCategory, char const*, ...)' collect2: error: ld returned 1 exit status makefile:3: recipe for target 'all' failed make: *** [all] Error 1


My OS is Debian GNU/Linux 9.6 (stretch).

Any insight on this?
but0n commented 5 years ago

@Vagelis-Prokopiou

  1. This issue relate to npm, here are some informations I've found:
  2. Unfortunately, I don't have enough C++ experience to handle this cross platform issues yet. Still confused about this error, sames like the compilation options is incorrect. #8
jdestefx commented 4 years ago

I'm getting the same errors as @Vagelis-Prokopiou lots of undefined references. CentOS 7