So i am trying to get a C# application that i have developed that uses the Iconic Zip library, when i compile the program into an executable, and run it on another machine i get an error saying
"Could not load file or assembly 'Iconic.Zip...' or one if its dependencies. The system cannot find the file specified."
I realise that this is because the .dll is not in the same directory/expected directory as the exe.
Is there a way to bundle in the .dll to the exe through Visual Studio so that i do not have to provide the library as a seperate entity?
Related
I'm migrating an existing, working project from Eclipse to Android Studio. The code base consists of a native C++ library built with the NDK (libMylib.so), a Java class that wraps all the native code (MyClass.java), and a test harness(MyApp).
In Android Studio, I've created a stand-alone project (not just a module) that builds "MyClass", and that project has a "src/main/jniLibs" folder where I place "libMyLibrary.so".
The project builds and produces "MyClass.aar", which contains all of its dependencies -- including those .so files.
My test app imports this .aar file as a new dependency "module". It builds and deploys to a device, but encounters a runtime exception when trying to call a native method contained in the .so file.
Trying to load lib /data/data/com.mycompany.webview/lib/libMylib.so 0x4131cd18
Added shared lib /data/data/com.mycompany.webview/lib/libMylib.so 0x4131cd18
nativeCalls.cpp﹕ JNI_OnLoad() called successfully.
No implementation found for native Lcom/mycompany/Mylib/MyClass;.nativeInit
Shutting down VM
The debug statement printed in "JNI_OnLoad()" is mine, so I know the correct .so is being loaded without issue. But then something goes wrong with the call to 'nativeInit()'.
What sorts of things could cause this kind of failure?
Thanks.
1) What value does JNI_OnLoad() return? In the code that I have it is JNI_VERSION_1_6.
2) Are the function names correct?
cd bin/classes
javah com.example.MyClass com.example.OneMoreClass
This will generate the correct C/C++ headers for your native functions.
I have windows dynamic linked library which I want to access from Linux environment. I don't have the source code of that library, so I cannot build .so file.
Is there a way by using Winelib or any other library or tool for converting library file to .so file, so that I can call functions defined in that library?
There is no easy way to do it, because the DLL cannot run in Linux enviromnemt all by itself. It will probably rely on user32.dll msvcrt.dll and friends at runtime, so you'll have to provide those files as well.
You can use winelib, but it doesn't just convert a .dll to an .so. You'll have to link the whole project that wants to call the DLL against winelib, and include the DLL itself with your app at runtime. If you are trying to port a Windows app to Linux, winelib will be able to convert your makefile for you, but it's far from automatic for complex projects.
I have a project which is windows 8 application that create by using VS C++, javascript and html5.
But when I compile the project (Windows Runtime Component project) using ARM solution platform, a winmd file is not generate. What I success to generate is dll file, pri file, ilk file and pdb file.
Can someone teach me how to generate winmd file?
Check the below image. You need to set the output type as Windows Runtime Component.
I am beginner in VC++. I create a simple VC++ ATL Project.when i will debug the project then it ask for Executable file Name. which file is enterd in the Executable file name.?
You probably created a DLL project. Such DLL can be used by some executable. So, you should provide there a name of the executable that will load and use your DLL. Another option is to create another test project (executable) that will load and use your DLL. That would be just for testing purposes.
How does the Visual C++ program load dll's before entering the main function in visual studio express 2008? In a project developed by others a dll was loaded by "a.ext:native" but I don't know how is this configured.
There are different ways to instruct the OS to load a DLL. The most common way is to link to a .lib file (through the project's linker settings), where the .lib is a build-time stub associated with the DLL. When the linker finds this .lib file during the linking stage, it knows that the DLL is required, and modifies the EXE internally to tell the operating system that the DLL must exist in order for the program to run.
When the program is later run, the operating system first looks for all required DLL's - even before beginning to execute the code for the program. If any of these DLL's are missing, the operating system throws an error, an error box pops up, and the program will not run.
It's also possible to dynamically load a DLL, but this isn't all that common.