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

Can't use it in windows 7x64 #16

Open
vasilevich opened this issue Nov 24, 2016 · 4 comments
Open

Can't use it in windows 7x64 #16

vasilevich opened this issue Nov 24, 2016 · 4 comments

Comments

@vasilevich
Copy link

Hello! I am sorry if this library was not intended to be used on a windows machine
however it was not stated otherwise in its description.
I've spent about 3 days now trying to compile it on windows 7 x64
with node-gyp enivorment set up properly(I think, since I can compile other native modules such as bcrypt)
the bugs that I have encountered vary from :
C:\projects\contracto\node_modules\poppler-simple>if not
defined npm_config_node_gyp (node "C:\Program Files\nodej
s\node_modules\npm\bin\node-gyp-bin\....\node_modules\n
ode-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild
)
[eval]:1
'v=process.versions.node.split(.);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Invalid or unexpected token
at Object.exports.runInThisContext (vm.js:78:16)
at Object. ([eval]-wrapper:6:22)
at Module._compile (module.js:573:32)
at Immediate. (bootstrap_node.js:383:29)
at runCallback (timers.js:637:20)
at tryOnImmediate (timers.js:610:5)
at processImmediate [as _immediateCallback] (timers.j
s:582:5)
gyp: Call to 'node -pe 'v=process.versions.node.split("."
); v[0];'' returned exit status 1 while in binding.gyp. w
hile 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:\Program F
iles\nodejs\node_modules\npm\node_modules\node-gyp\lib\co
nfigure.js:305:16)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)

gyp ERR! stack at Process.ChildProcess._handle.onexit
(internal/child_process.js:215:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C
:\Program Files\nodejs\node_modules\npm\node_modules
\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\projects\contracto\node_modules\poppler-s
imple
gyp ERR! node -v v7.1.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\
Program Files\nodejs\node_modules\npm\bin\npm-cli.js
" "install" "poppler-simple"
npm ERR! node v7.1.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: (node-gyp rebuild ) || (exit 1)

I tried to fix these problems myself
and after a long and frustrating battle
got to the point where the only thing that cant compile is is "NodePopplerDocument.cc" missing:
GlobalParams.h and poppler\doc.h and some more in the file NodePopplerDocument.h

which is the only file that yet does not compile.

can someone provide this module precompiled for windows 7 x64 please I need it only for development purpose and I am really lacking the knowledge to get it to work properly for me.
alternatively can you provide me links or instructions
how to properly and which versions of poppler and iconv to add to my windows enivorment path
thank you very much.

@blackbeam
Copy link
Owner

Sorry but this library was not intended to be used on windows. Also my windows development experience is too limited to advice you anything.
I think you need to link to libiconv and poppler (>= v0.18) somehow.

missing: GlobalParams.h and poppler\doc.h

Obviously you need poppler headers somewhere in your include dirs.

@vasilevich
Copy link
Author

Can you advice what is the latest poppler version you tried? Maybe my poppler is too new? I am not sure anymore its a frustrating battle, do you think it's possible to cross compile it from a Linux box to windows or that makes no sense?

@blackbeam
Copy link
Owner

Can you advice what is the latest poppler version you tried?

Definitely works on v0.42.0.

do you think it's possible to cross compile it from a Linux box to windows or that makes no sense?

Don't know unfortunately.

its a frustrating battle

Maybe it is an option for you to wrap poppler binaries (pdfinfo, pdftocairo, pdftoppm) if they are available on Windows? It will be slower but may be enough if your target is not a high performance renderer.

@vasilevich
Copy link
Author

thats what i ended up doing, i just wanted to make things more efficient, I like the idea of doing all in memory so much better. and the production server is linux, the only problem is that I develop it on my windows 7x64 machine, I wish I could do both, but I will move on for now, maybe some day come back to this and commit you a working windows fix, tho I never worked with C or anything related in a serious matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants