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

nw-gyp compillation #16

Open
VladislavAnkudinov opened this issue Apr 18, 2014 · 11 comments
Open

nw-gyp compillation #16

VladislavAnkudinov opened this issue Apr 18, 2014 · 11 comments

Comments

@VladislavAnkudinov
Copy link

I have an error when trying to compile with nw-gyp rather then node-gyp
"CIL library ( CIL module *) : error LNK2005: "public: class v8::Local __thiscall ... ... alerady defined in nw.lib(nw.exe)

whats goin on? is it some headers included two times?

@jokesterfr
Copy link
Owner

Hi,
it seems that the problem is in your nw.lib (node webkit lib if I'm right?), I've never tried to use nw-gyp and I'm not planning to support it any time soon. Did you tried to compile node-pcsc using node-gyp ?
I did all my tests on a Linux machine, compilation may fail on windows, we can manage to fix it together if you want.

@VladislavAnkudinov
Copy link
Author

my module should work on client side thats why i use node-webkit and nw-gyp rather then node-gyp (node-webkit and node use diffrend ABI). The problem was in header files. If put #include <node.h> directly in sources but not in headers it compiles well with node-gyp and nw-gyp. It looks like some linker settings can be changed to achive same result but i dont know much about cpp linkers and dont have such solution. May be Ludovic can advise something^^?

@mn1aC
Copy link

mn1aC commented Mar 21, 2015

I also cant compile with nw-gyp

../src/common.h:13:48: warning: format specifies type 'unsigned long' but the argument has type 'LONG' (aka 'int') [-Wformat]
pcsc_stringify_error(result), result);
^~~~~~
../src/pcsclite.cpp:45:52: warning: comparison of integers of different signs: 'LONG' (aka 'int') and 'unsigned int' [-Wsign-compare]
if ((result != SCARD_S_SUCCESS) && (result != SCARD_E_TIMEOUT)) {
~~~~~~ ^ ~~~~~~~~~~~~~~~
../src/pcsclite.cpp:155:20: warning: comparison of integers of different signs: 'LONG' (aka 'int') and 'unsigned int' [-Wsign-compare]
if (result == SCARD_E_NO_READERS_AVAILABLE) {
~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.
CXX(target) Release/obj.target/pcsclite/src/cardreader.o
In file included from ../src/cardreader.cpp:2:
../src/common.h:13:48: warning: format specifies type 'unsigned long' but the argument has type 'LONG' (aka 'int') [-Wformat]
pcsc_stringify_error(result), result);

getting some warnings...

@mn1aC
Copy link

mn1aC commented Mar 21, 2015

I would like to use the smartcard reader on windows and mac.. (error log above is from mac)

@mn1aC
Copy link

mn1aC commented Mar 21, 2015

for the record on OSX I get the same errors with node-gyp

@mn1aC
Copy link

mn1aC commented Mar 21, 2015

Ok compilation worked now.

I had to make a few changes to the .cpp files (I will send them to the creator of this project)
I also had to install buffertools with npm in the pcsc folder

@mn1aC
Copy link

mn1aC commented Mar 21, 2015

The program I am running now on OSX opens up and show's the name of my cardreader and than crashes...

@mn1aC
Copy link

mn1aC commented Mar 21, 2015

So I guess something is wrong with the C++ code at runtime now.. How could i debug the .cpp code? (I'm not really used to program in this language)

@mn1aC
Copy link

mn1aC commented Mar 21, 2015

commented some js code now, and It seems after creation var pcsc = pcsc(); the program crashed after a few seconds.

@jokesterfr
Copy link
Owner

@mn1aC did you pushed any branch I could look at?

@jokesterfr
Copy link
Owner

@mn1aC bump :)

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

3 participants