Building with dokan.lib - shared-libraries

I have downloaded the Dokan Library 0.6.0 (used to write a file system in user mode).
I'm using VS 2013 and have created a project to build the sample called mirror.c. It uses a LIB called dokan.lib. It compiles just fine but the linker gives an error saying
"unresolved external symbol __imp__DokanMain#8". I dumped the lib and __imp__DokanMain#8 does exist within dokan.lib.
Under Properties->Linker->Additional Library Directories, I added "c:\Program Files (x86)\Dokan\DokanLibrary" but that didn't help. Then I changed that to "c:\Program Files (x86)\Dokan\DokanLibrary\dokan.lib" but that also didn't help.
I have read everything at the dokan web site but nothing talks about building with Visual Studio.
Does anyone have any ideas?

Please move "dokan.lib" from Settings -> Linker ->General -> Additional Library Directories. This is meant to include only the paths to the libraries. You can leave the path to the library in tact in there (i.e, C:\Program Files (x86)\Dokan\DokanLibrary).
Place the "dokan.lib" in Settings->Linker->Input->Additional Dependencies.

Related

Microsip softphone build problem (cannot open file 'hid.lib')

I am going to build microsip softphone from www.microsip.org, which is based on pjsip project.
The pjsip project files are downloaded and built successfully.
but when I build microsip source I get the following error :
cannot open file 'hid.lib'
I use VS2017 and this file is specified in linker dependencies.
I don't know what is this lib and how can I get the file or compile any other source to get it.
if anybody has experience working with microsip and it's dependencied please help.
1) Install "Microsoft Windows Driver Kit"
2) Project -> Linker -> General -> Additional Library Directories. Set location of hid.lib (for me it's at C:\WinDDK\7600.16385.1\lib\win7\i386)

Cross-Project References in Visual Studio 2015

I am trying to reference a dll project from another project, and am encountering a few difficulties. I have done the following:
Added both projects to a solution
Within my executable project, I add the dll project as a reference.
I add the include directory under Properties --> C/C++ --> Additional Include directories.
I thought this was sufficient - I don't get any errors, my intellisense is detecting the dll project and everything compiles. But when I run, I get the following system error messagebox:
The program can't start because xxx.dll is missing from your computer.
Try reinstalling the program to fix this problem.
So I have tried adding the directory where the dll and lib files are built to to Reference Directories and Library Directories under VC++ Directories in the properties, but still get the same error.

Android-NDK: Unsatisfied Link Error : Cannot load library: soinfo_relocate: cannot locate symbol "tcgetattr"

I am building the app available at https://github.com/thibautd/android-serialport-api/tree/master/android-serialport-api/project using Android NDK.
What have I done until now:
Build the project using gradle version 'com.android.tools.build:gradle-experimental:0.7.0-alpha1'
I am building this on android-17 and running on Android device with 4.2. I have also tried android-19
Build goes through without any errors but at runtime I get the exception Cannot load library: soinfo_relocate: cannot locate symbol "tcgetattr"
I have tried several options to get this working but all of them fail
Options I have tried
Setting APP-PLATFORM like mentioned in Cannot locate symbol 'tcgetattr' referenced by "libcrypto.so"
Using $(PREBUILT_SHARED_LIBRARY) by including the .so file avialable in the same github location as mentioned in How can i Link prebuilt shared Library to Android NDK project?
Tried setting LOCAL_EXPORT_C_INCLUDES in both option 1) and 2) above as mentioned in the same post How can i Link prebuilt shared Library to Android NDK project?
Also tried option mentioned at Cannot load library: reloc_library[1285]: cannot locate 'rand'
Put all the required include files directly in the project under /jni and tried building the project.
My project compiles absolutely fine. When testing I have always deleted the contents in build folder and rebuilt the project. To make sure the .so files are indeed created properly.
In all the cases I end up in exactly the same error soinfo_relocate: cannot locate symbol "tcgetattr"
I think it is because of the fact that some of the includes like unistd.h are not correctly referenced in runtime but I am not able to figure out how to get this working.

Visual C++ - cant see which external missing

I try to build my multiproject application in Visuas C++ 10 in release mode.
I get the next link error:
2> All outputs are up-to-date.
2>PidAppLib.lib(ThreadWin32.obj) : error LNK2011: precompiled object not linked in; image may not run
2>C:\infinite_memories_svn\projects\sw\NewPidTools\PidWriter\Release\PidLabler.exe : fatal error LNK1120: 1 unresolved externals
2>
2>Build FAILED.
How can I know which object unresolved?
ThreadWin32.obj is external lib which was downloaded from internet.
Ok.
I've solved the problem.
I have 2 libraries, let say a.lib and b.lib, and project, c.
a.lib uses b.lib so in librarian dependencies of a.lib I added b.lib, c uses a.lib so I added
it to dependencies.
It works in debug but in release I should also add b.lib to dependencies of c.
Strange but it solved the problem
I had this error in a large project I was refactoring. During the refactoring process I would occasionally compile individual source files to check changes I'd made without having to build the entire project. Depending on your project configuration this can result in .obj files being output in a different directory to where they would normally be output when you build the project. In my case the .obj files for source files compiled manually were output in the source code directory instead of the intermediate build directory.
A side-effect of this appeared to be that when building the whole project, source files that had been manually compiled might not be recompiled even if other changes elsewhere meant they should be (like a change that required recompiling the precompiled header file).
The solution for me was to manually delete all .obj files generated by manually compiling individual source files. Depending on project configuration executing Clean on the project might also work.

static link mapi32.lib with my vc++ project in vs.net2005

I want to static link mapi32.lib with my vc++ project in vs.net2005 project. I am using the following import statement inside my testdll.cpp project which is my entry point of the application.
#import "mapi32.lib"
I have put references for C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Lib path inside c/c++ -> general section and Linker->general section of the project.And also add reference in properties -> debug source files section as well.
But after doing all this I am getting the following error, please help
Error 3 fatal error C1083: Cannot open
type library file: 'c:\program
files\microsoft visual studio
8\vc\platformsdk\lib\mapi32.lib':
Error loading type library/DLL.
c:\TestDll\TestDll\TestDll\TestDll.cpp
14
Regards,
To statically link with mapi.lib, you need to tell the linker about it. The best way to do this is in your project settings. Go to Linker -> Input and add the mapi32.lib to the Additional Dependencies field. You sould do this step for all your project configurations.
To refer to the lib within your code, of course you have to include the appropriate header files.
The #import "mapi32.lib" statement is usually used to import COM object type libraries and has nothing to do with static linking. So you should remove that line.
Good luck.

Resources