Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error #11

Open
mimooh opened this issue Jun 6, 2018 · 11 comments
Open

Compilation error #11

mimooh opened this issue Jun 6, 2018 · 11 comments
Labels
duplicate This issue or pull request already exists

Comments

@mimooh
Copy link

mimooh commented Jun 6, 2018

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
Copy link
Owner

but0n commented Jun 6, 2018

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

@but0n but0n added the duplicate This issue or pull request already exists label Jun 7, 2018
@but0n but0n closed this as completed Jun 7, 2018
@mimooh
Copy link
Author

mimooh commented Jun 7, 2018

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
Copy link
Author

mimooh commented Jun 7, 2018

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 but0n reopened this Jun 7, 2018
but0n added a commit that referenced this issue Jun 7, 2018
@but0n
Copy link
Owner

but0n commented Jun 7, 2018

Fixed memset issues, but still have some trouble #8

@MrSonicMaster
Copy link

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
Copy link
Owner

but0n commented Sep 4, 2018

@MrSonicMaster

Try node-gyp rebuild

Or switch to master branch before make
git checkout master

@MrSonicMaster
Copy link

'/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
Copy link
Owner

but0n commented Sep 5, 2018

Probably you haven't switching to master branch correctly.

image

port.c doesn't exist in master branch.

@Vagelis-Prokopiou
Copy link
Contributor

Vagelis-Prokopiou commented Jan 12, 2019

  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.<anonymous> (/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.

  1. 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 to `rcContext::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 to `rcAllocHeightfield()'
build.cpp:(.text+0x56b): undefined reference to `rcContext::log(rcLogCategory, char const*, ...)'
build.cpp:(.text+0x5c4): undefined reference to `rcCreateHeightfield(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 to `rcMarkWalkableTriangles(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 to `rcContext::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 to `rcFilterWalkableLowHeightSpans(rcContext*, int, rcHeightfield&)'
build.cpp:(.text+0x7bd): undefined reference to `rcAllocCompactHeightfield()'
build.cpp:(.text+0x7f0): undefined reference to `rcContext::log(rcLogCategory, char const*, ...)'
build.cpp:(.text+0x826): undefined reference to `rcBuildCompactHeightfield(rcContext*, int, int, rcHeightfield&, rcCompactHeightfield&)'
build.cpp:(.text+0x84d): undefined reference to `rcContext::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 to `rcContext::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 to `rcBuildRegions(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 to `rcContext::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 to `rcAllocContourSet()'
build.cpp:(.text+0xb9d): undefined reference to `rcContext::log(rcLogCategory, char const*, ...)'
build.cpp:(.text+0xbe4): undefined reference to `rcBuildContours(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 to `rcContext::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 to `rcAllocPolyMeshDetail()'
build.cpp:(.text+0xce3): undefined reference to `rcContext::log(rcLogCategory, char const*, ...)'
build.cpp:(.text+0xd30): undefined reference to `rcBuildPolyMeshDetail(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 to `rcFreeContourSet(rcContourSet*)'
main/main.a(InputGeom.o): In function `InputGeom::loadMesh(rcContext*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
InputGeom.cpp:(.text+0x41d): undefined reference to `rcContext::log(rcLogCategory, char const*, ...)'
InputGeom.cpp:(.text+0x474): undefined reference to `rcContext::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 to `rcContext::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
Copy link
Owner

but0n commented Jan 13, 2019

@Vagelis-Prokopiou

  1. This issue relate to npm, here are some informations I've found:
  1. 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. Makefile linker Error #8

@jdestefx
Copy link

jdestefx commented Nov 23, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

5 participants