user13333704 wrote:It is technically possible to create a C/C++ application without using compiler libraries but it that is an esoteric subject that has nothing to do with anything you might be doing with JNI.
Is there any configuration setting in VS 2010 to specify not to use Visual C++?
That is exactly, being a java programmer, where am stuck.It is technically possible to create a C/C++ application without using compiler libraries but it that is an esoteric subject that has nothing to do with anything you might be doing with JNI.
Yes. I, in my Java code, am loading the hidapi.dll dynamically, to perform some communication with the USB device, which is a JNI C dll, I created using VS2010 and the C code uses the static library setupapi.lib (for communicating directly with the OS).I am rather certain that the missing component, hidapi.dll, has nothing to do with C/C++ compiler libraries.
I have MS SDK V7.0A pre-installed (along with Visual Studio - VS2010) in my system which has the library. So it works in my System (Windows 7). Problem arises only when i try to run the same code in another system, which has no VS.And unless you have a static library for that, which is not the same as the dll, there is no way you are going to link to that statically.
That is exactly what i am trying to do here.Realistically what it really comes done to is that you must understand what dependencies your own application has first before you explore the options for delivering it.
Obvious that the linker has no clue about these functions which are defined in external library 'Setupapi.lib' & setupapi.dll and hence I tried linking the file by adding the command '-lsetupapi.lib' (without 's), '-llibsetupapi.a' and -l'setupapi.dll' in vain. The compiler saysI think you could have worked that out for yourself. The compiler is treating the entire -llibsetupapi.a as a library name to find. Get rid of the '-l' and 'lib' parts of that.
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../../mingw32/bin/ld.exe: cannot find -llibsetupapi.a (with whatever linker option i give)
collect2: ld returned 1 exit status
What am i doing wrong here?
I think you could have worked that out for yourself. The compiler is treating the entire -llibsetupapi.a as a library name to find. Get rid of the '-l' and 'lib' parts of that.I couldn't do that as i were building it with Eclipse C/C++ IDE and there were no options in linker for it (At least i couldn't find the right place for it).
user13333704 wrote:I use VS because it is so easy to do it.
Two: After pathetically failing to create a working dll with VS2010,
I tried to compile the code using Mingw gcc compilerOne advantage to that of course is that you are going to have to actually figure out what the command line options mean. The above VS example does that for you - there is even a place in the properties that shows you what the complete command line looks like.