kcdodd / node-daqmx

A Node.js wrapper for the National Instruments DAQmx C API
11 stars 8 forks source link

error LNK2001: unresolved external symbol DAQmxGetSysDevNames... #1

Closed tuna-f1sh closed 7 years ago

tuna-f1sh commented 7 years ago

I realise this is over two years old and probably dormant but heres hoping...

I'm struggling to build this using node-gyp on Windows 10 64bit. It appears to be unable to resolve the main NIDAQmx lib but I have verified that the path is correct and exists. Here is my error log:

C:\Users\JWhittington\node-daqmx>node-gyp build
gyp info it worked if it ends with ok
gyp info using node-gyp@3.4.0
gyp info using node@6.7.0 | win32 | x64
gyp info spawn C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=x64' ]
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  error.cc
     Creating library C:\Users\JWhittington\node-daqmx\build\Release\nodedaqmx.lib and object C:\Us
  ers\JWhittington\node-daqmx\build\Release\nodedaqmx.exp
nodedaqmx.obj : error LNK2001: unresolved external symbol DAQmxGetSysDevNames [C:\Users\JWhittingto
n\node-daqmx\build\nodedaqmx.vcxproj]
nodedaqmx.obj : error LNK2001: unresolved external symbol DAQmxGetDeviceAttribute [C:\Users\JWhitti
ngton\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxGetReadAttribute [C:\Users\JWhit
tington\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxIsTaskDone [C:\Users\JWhittingto
n\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxCfgDigEdgeStartTrig [C:\Users\JW
hittington\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxGetTaskAttribute [C:\Users\JWhit
tington\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxClearTask [C:\Users\JWhittington
\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxStopTask [C:\Users\JWhittington\
node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxStartTask [C:\Users\JWhittington
\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxCfgAnlgEdgeStartTrig [C:\Users\J
Whittington\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxCreateTask [C:\Users\JWhittingto
n\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxCreateAIVoltageChan [C:\Users\JW
hittington\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxCfgSampClkTiming [C:\Users\JWhit
tington\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxReadAnalogF64 [C:\Users\JWhittin
gton\node-daqmx\build\nodedaqmx.vcxproj]
AIVoltageTask.obj : error LNK2001: unresolved external symbol DAQmxSetAnlgEdgeStartTrigHyst [C:\Use
rs\JWhittington\node-daqmx\build\nodedaqmx.vcxproj]
error.obj : error LNK2001: unresolved external symbol DAQmxGetExtendedErrorInfo [C:\Users\JWhitting
ton\node-daqmx\build\nodedaqmx.vcxproj]
C:\Users\JWhittington\node-daqmx\build\Release\nodedaqmx.node : fatal error LNK1120: 16 unresolved
externals [C:\Users\JWhittington\node-daqmx\build\nodedaqmx.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\JWhittington\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:276:23)
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 10.0.14393
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\JWhittington\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build"
gyp ERR! cwd C:\Users\JWhittington\node-daqmx
gyp ERR! node -v v6.7.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok

I'm fairly inexperienced with node-gyp or building C++ code in node for that matter so perhaps I missing something obvious. Any help would be appreciated.

tuna-f1sh commented 7 years ago

I've fixed this: it was due to this project using the legacy 32bit lib location (which still exists confusingly). I have created a fork, which builds on 64bit systems using the new 'Shared>ExternalCompilerSupport>C' folder.

The folder contains libs for both 32bit and 64bit systems and updated header files. I have changed binding.gyp to use the new path with 64bit lib by default, and a note for users on how to change it to 32bit lib. I've also updated the README with the latest NIDAQmx 16.0 download.

The fork is here: https://github.com/tuna-f1sh/node-daqmx, I'll create a pull request too.