10-04-2017 05:56 PM - edited 10-04-2017 05:57 PM
Hi, all,
Questions:
I want to control Microsoft Visual Studio to use the dll which generated from labview. I have some problems here. I use labview 2017 and visual studio 2015.
1.
I create a test project and I create a math.vi to do mathematics addition. Then I use Build Specifications under project to create shared library.
2.
I create a win32 console application in visual studio and create a math project.
project -> properties -> configuration properties -> vc++ directories -> include directories: C:\Program Files\National Instruments\LabVIEW 2017\cintools was added
move SharedLib.lib to ...\Visual Studio 2015\Projects\math\math
project -> properties -> configuration properties -> vc++ directories -> library directories: Visual Studio 2015\Projects\math\math was added
project -> properties -> configuration properties -> Linker -> Input -> Addtional Dependencies: SharedLib.lib was added
move the ShareLib. h to ...\Visual Studio 2015\Projects\math\math and add it from header files in solution 'math'
3. motify the math.cpp file
#include "stdafx.h"
#include "SharedLib.h"
int main()
{
double k = Math(3.2, 4.5);
return 0;
}
It could successfully compiled by visual studio and then I move the dll file under ...\Visual Studio 2015\Projects\math\math.
But, when I build it, it give me the following error:
Warning LNK4272 library machine type 'x64' conflicts with target machine type 'X86' math D:\Wenxu Documents\My Documents\Visual Studio 2015\Projects\math\math\SharedLib.lib 1
Error LNK2019 unresolved external symbol _Math referenced in function _main math d:\wenxu documents\my documents\visual studio 2015\Projects\math\math\math.obj 1
Error LNK1120 1 unresolved externals math d:\wenxu documents\my documents\visual studio 2015\Projects\math\Debug\math.exe 1
All files are attached. I am pretty new to labview. Thanks for your help very much! I was confused on it for a couple days. I appreciate a lot if you could give me some hints.
Best