GithubHelp home page GithubHelp logo

Build fails on Windows 7 about geoip HOT 13 OPEN

magicalhobo avatar magicalhobo commented on July 17, 2024
Build fails on Windows 7

from geoip.

Comments (13)

kuno avatar kuno commented on July 17, 2024

@magicalhobo

Thanks for report, let me take a look.

from geoip.

kuno avatar kuno commented on July 17, 2024

@magicalhobo

Sorry, I have not virtual studio installed, os, it is quite difficult for me to testing that.

Can you install other node c++ addon ? such as ws?

from geoip.

magicalhobo avatar magicalhobo commented on July 17, 2024

Yes, ws and other C++ modules install fine for me. I have node-gyp working on my machine.

I know it's difficult if you don't have the environment setup, so let me know if there's anything I can try to get you more information.

from geoip.

kuno avatar kuno commented on July 17, 2024

@magicalhobo

Can you clone the repo and do make rebuild at the root, then post the result here?

from geoip.

magicalhobo avatar magicalhobo commented on July 17, 2024

I think the closest thing that makes sense in Windows would be

SET NODE_ENV=test & node-gyp rebuild

Which gives this output:

gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info spawn python
gyp info spawn args [ 'C:\\Users\\Sean\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\geoip\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Sean\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Sean\\.node-gyp\\0.10.4\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Sean\\.node-gyp\\0.10.4',
gyp info spawn args   '-Dmodule_root_dir=D:\\geoip',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\geoip\\build',
gyp info spawn args   '-Goutput_dir=.' ]

module.js:340
    throw err;
          ^
Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.require.resolve (module.js:384:19)
    at [eval]:1:33
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
    at startup (node.js:80:7)
    at node.js:901:3
gyp: Call to 'node -p -e "require('path').dirname(require.resolve('nan'))"' returned exit status 8. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\Sean\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\Sean\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\geoip
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok

from geoip.

kuno avatar kuno commented on July 17, 2024

@magicalhobo

You need install npm module nan first, I think.

from geoip.

kingsumos avatar kingsumos commented on July 17, 2024

C:\temp\node_modules\geoip\build\binding.sln : Solution file error MSB5004: The solution file has two projects named "geoip".

This because the libgeoip target name is also "geoip". Then node-gyp is creating a solution file (binding.sln) containing two projetcs with same name.
But even after fixing this by renaming the target name from "geoip" to "libgeoip" the build fails while compiling libgeoip (node-gyp is using MVS compiler to build libgeoip). To skip this issue I'm using a MinGW/Msys libgeoip build.
So I have removed the libgeoip from the dependency list. But now the the build fails while compiling the geoip module:

D:\Node-new\GeoIP>npm install

[email protected] install D:\Node-new\GeoIP
node-gyp rebuild

D:\Node-new\GeoIP>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
city6.cc
country.cc
country6.cc
city.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\city.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
init.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\country.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
region.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\country6.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
netspeed.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\city6.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
org.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\init.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
utils.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\region.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
global.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\netspeed.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\org.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\utils.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
C:\Users\sumo.node-gyp\0.10.22\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)' [D:\Node-new\GeoIP\build\geoip.vc
xproj]
with

T=v8::Object

gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Node-new\GeoIP
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the geoip package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls geoip
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd D:\Node-new\GeoIP
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\Node-new\GeoIP\npm-debug.log
npm ERR! not ok code 0

D:\Node-new\GeoIP>

from geoip.

kingsumos avatar kingsumos commented on July 17, 2024

Despites the project name bug, Microsoft Visual Studio doesn't supports C99 extension (they are still developing this in MVS2013).
For instance:
Error 1 error C2057: expected constant expression .\GeoIP\src\city6.cc 72 1 geoip
Error 2 error C2466: cannot allocate an array of constant size 0 .\GeoIP\src\city6.cc 72 1 geoip

from geoip.

kuno avatar kuno commented on July 17, 2024

@kingsumos

why c99 ?, this module is mainly wrote in c++, it's just call libgeoip's functions.

from geoip.

kingsumos avatar kingsumos commented on July 17, 2024

Although the module is in C++ it its using some features from C99, for instance variable-length arrays:
char host_cstr[host_str->Length() + 1];
Visual Studio still doesn't supports variable-length arrays...

from geoip.

kuno avatar kuno commented on July 17, 2024

@kingsumos

Thanks for your clarifications.

from geoip.

kkoopa avatar kkoopa commented on July 17, 2024

Just figured I'd add a tip: http://www.appveyor.com/ offers free windows-based CI testing, like Travis does for real operating systems.

from geoip.

felixfbecker avatar felixfbecker commented on July 17, 2024

I would really like to see this on Windows

from geoip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.