Giter Site home page Giter Site logo

iconv and cygwin about node-iconv HOT 6 CLOSED

bnoordhuis avatar bnoordhuis commented on August 16, 2024
iconv and cygwin

from node-iconv.

Comments (6)

bnoordhuis avatar bnoordhuis commented on August 16, 2024

This is second-hand information but on cygwin you probably need to compile with -Wl,--out-implib,iconv.dll.a and you might have to drop -fPIC.

Let me know if it works and we'll figure out a way to add it to the build script.

from node-iconv.

irenbi avatar irenbi commented on August 16, 2024

Sorry, it doesn't work.
I droped -fPIC. and used:
$ g++ -I/usr/local/include/node -O2 -Wl,--out-implib,iconv.dll.a -shared -Wall
-ansi -o iconv.node iconv.cc

Same effect!
I'm using Windows 7 Professional, 32 Bit Platform

from node-iconv.

bnoordhuis avatar bnoordhuis commented on August 16, 2024

Have you tried it with and without -fPIC?

Another thing you can try is to compile to iconv.dll instead of iconv.node. I'm fairly sure that the cygwin g++ has some file extension heuristics built in.

from node-iconv.

irenbi avatar irenbi commented on August 16, 2024

Yes, I removed -fPIC. But this was already ignored by g++. I did'nt see that now a library
iconv.dll.a was created.

Creating library file: iconv.dll.a

How to create iconv.dll? Changing only the attribute -o doesn't work!

from node-iconv.

bnoordhuis avatar bnoordhuis commented on August 16, 2024

According to the documentation, it should be as simple as -o mylib.dll.

Note the 'Linking Against DLLs' sections: it's conceivable that you need to generate a .def from the node executable since that is the place where all the V8 symbols live.

Unless the node.js build script produces a v8.dll nowadays - but that's not the case, is it?

from node-iconv.

irenbi avatar irenbi commented on August 16, 2024

OK, I got it running.
I don't know if it is the right way, but it's linked. When building node, there is also build a dll node.dll.a. If not you can do it with
$ make dynamiclib
$NODE_PATH/build/default/libnode.dll.a

Also libiconv.a must be linked.
The easyest way ist to copy or make an symbolic link of this libraries to iconv directory.

$ g++ -I/usr/local/include/node -O2 -shared -Wall-ansi -o iconv.node iconv.cc -L/usr/local/lib/node/iconv libnode.dll.a libiconv.a

Now it's OK. It seems that my library pathes are not OK.

Thank's for your help!

from node-iconv.

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.