lib error



  • Trying to setup a dedicated server. So far ran into this error:

     

    Error: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /home/steam/screeps/server/modules/backend/greenworks/lib/greenworks-linux64.node)
    at Error (native)
    at Object.Module._extensions..node (module.js:583:18)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/steam/screeps/server/modules/backend/greenworks/greenworks.js:22:18)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)


  • Culture

    needs rebuilt for that system, I cloned greenworks from github, downloaded steamworks-sdk 1.37, and built it, overwriting the greenworks-linux64.node once done



  • Error: Module version mismatch. Expected 48, got 50.
    at Error (native)
    at Object.Module._extensions..node (module.js:583:18)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at bindings (/home/steam/screeps/server/modules/common/node_modules/bindings/bindings.js:76:44)
    at Object.<anonymous> (/home/steam/screeps/server/modules/common/node_modules/weak/lib/weak.js:7:35)
    at Module._compile (module.js:556:32)


  • Culture

    save this in the server folder and run, (I named it rebuild.sh) should rebuild all the native modules. If you are doing it for docker (As I was), `docker run --rm -v $PWD:/server -w /server node:6 bash rebuild.sh` (Assuming you want it build for the node:6 image)

    #!/bin/bash
    # Comment this out if not needed 
    npm install -g node-gyp
    for M in modules/*/
    do
        pushd $M
        npm build
        popd
    done
    pushd modules/backend/native/
    node-gyp configure
    node-gyp build
    popd


  • Same error, though it does error in the build about not being able to find graceful-fs. 

     

    Go Go Google Powers

     


  • Culture

    Node version? I know older graceful-fs versions (<=3.0.0) don't work in node7, may try adding `npm install` inside the loop



  • I don't have a modules/backend/native/ what is in that folder for you

     


  • Culture

    erm, maybe driver/native, I've been in so many folders today....

     



  • Well got that all working, till it didn't Back to the original error.



  • #!/bin/bash
    # Comment this out if not needed
    #npm install -g node-gyp
    for M in modules/*/
    do
    pushd $M
    # npm install graceful-fs
    rm node_modules -Rf
    npm install
    npm build
    popd
    done
    pushd modules/driver/native/
    node-gyp configure
    node-gyp build
    popd

     

    That did it.



  • Your last snippet doesn't work in my case.

    ~/.local/share/Steam/steamapps/common/Screeps/server
    ~/.local/share/Steam/steamapps/common/Screeps/server/modules/driver/native ~/.local/share/Steam/steamapps/common/Screeps/server
    gyp info it worked if it ends with ok
    gyp info using node-gyp@0.12.2
    gyp info using node@0.10.29 | linux | x64
    gyp info spawn python
    gyp info spawn args [ '/usr/share/node-gyp/gyp/gyp_main.py',
    gyp info spawn args   'binding.gyp',
    gyp info spawn args   '-f',
    gyp info spawn args   'make',
    gyp info spawn args   '-I',
    gyp info spawn args   '/home/kalvis/.local/share/Steam/steamapps/common/Screeps/server/modules/driver/native/build/config.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/usr/share/node-gyp/addon.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/usr/include/nodejs/common.gypi',
    gyp info spawn args   '-Dlibrary=shared_library',
    gyp info spawn args   '-Dvisibility=default',
    gyp info spawn args   '-Dnode_root_dir=/usr/include/nodejs',
    gyp info spawn args   '-Dmodule_root_dir=/home/kalvis/.local/share/Steam/steamapps/common/Screeps/server/modules/driver/native',
    gyp info spawn args   '--depth=.',
    gyp info spawn args   '--generator-output',
    gyp info spawn args   'build',
    gyp info spawn args   '-Goutput_dir=.' ]
    gyp info ok
    gyp info it worked if it ends with ok
    gyp info using node-gyp@0.12.2
    gyp info using node@0.10.29 | linux | x64
    gyp info spawn make
    gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    make: Entering directory '/home/kalvis/.local/share/Steam/steamapps/common/Screeps/server/modules/driver/native/build'
      CXX(target) Release/obj.target/native/src/main.o
    In file included from ../src/main.cc:1:0:
    ../../node_modules/nan/nan.h:324:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
       static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
                                                   ^
    In file included from ../src/main.cc:2:0:
    ../src/pf.h: In member function ‘void screeps::open_closed_t::clear()’:
    ../src/pf.h:161:9: error: ‘numeric_limits’ is not a member of ‘std’
         if (std::numeric_limits<unsigned int>::max() - 2 <= marker) {
             ^
    ../src/pf.h:161:29: error: expected primary-expression before ‘unsigned’
         if (std::numeric_limits<unsigned int>::max() - 2 <= marker) {
                                 ^
    ../src/pf.h:161:29: error: expected ‘)’ before ‘unsigned’
    ../src/pf.h: At global scope:
    ../src/pf.h:383:61: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
        const cost_t obstacle = std::numeric_limits<cost_t>::max();
                                                                 ^
    ../src/pf.h:383:28: error: ‘numeric_limits’ is not a member of ‘std’
        const cost_t obstacle = std::numeric_limits<cost_t>::max();
                                ^
    ../src/pf.h:383:54: error: expected primary-expression before ‘>’ token
        const cost_t obstacle = std::numeric_limits<cost_t>::max();
                                                          ^
    ../src/pf.h:383:55: error: ‘::max’ has not been declared
        const cost_t obstacle = std::numeric_limits<cost_t>::max();
                                                           ^
    ../src/pf.h:383:55: note: suggested alternative:
    In file included from /usr/include/c++/4.9/algorithm:61:0,
                     from ../../node_modules/nan/nan.h:50,
                     from ../src/main.cc:1:
    /usr/include/c++/4.9/bits/stl_algobase.h:261:5: note:   ‘std::max’
         max(const _Tp& __a, const _Tp& __b, _Compare __comp)
         ^
    native.target.mk:83: recipe for target 'Release/obj.target/native/src/main.o' failed
    make: *** [Release/obj.target/native/src/main.o] Error 1
    make: Leaving directory '/home/kalvis/.local/share/Steam/steamapps/common/Screeps/server/modules/driver/native/build'
    gyp ERR! build error
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack     at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:267:23)
    gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
    gyp ERR! System Linux 3.16.0-4-amd64
    gyp ERR! command "nodejs" "/usr/bin/node-gyp" "build"
    gyp ERR! cwd /home/kalvis/.local/share/Steam/steamapps/common/Screeps/server/modules/driver/native
    gyp ERR! node -v v0.10.29
    gyp ERR! node-gyp -v v0.12.2
    gyp ERR! not ok
    ~/.local/share/Steam/steamapps/common/Screeps/server


  • @akuukis: seems like u haven't updated your g++, which version are you using?

    g++ -v

    It should be something like 4.9.2 and above to compile C++11 code while greenworks rebuilding.

    Also be sure u have installed build-tools (smth like build-essential for Ubuntu).