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

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.

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.

Error while adding mp4parser library to a project in android studio

I'm trying to use mp4parser library in my project. My android studio version is 1.0.2. Here's what I've done so far:
I've downloaded mp4parser zipfile from the link: https://github.com/sannies/mp4parser
I've extracted the zip file to MyProjectName/app/libraries
Renamed the folder to mp4parser
Add this line of code to settings.gradle file:
include ':app:libraries:mp4parser'
Add this line of code to build.gradle (in dependencies block):
compile project('libraries:mp4parser')
Now I want to sync the project with gradle files. This error pops up:
Error:Configuration with name 'default' not found.
I don't have this problem with other libraries. Seems that its only mp4parser that I have problem with. How can I fix this?
If you're including the library as source, the best thing to do is to unpack it somewhere and import it as a module.
The error you're getting is cryptic but it means that the build system is looking for a build.gradle file at that location and not finding it (or it doesn't see an apply plugin statement in the file telling it what to do). I'm assuming that the library you're trying to use doesn't have a Gradle build script.
If you import the library using the Android Studio UI, a build script will be generated for the module and you should be good to go.

Building with dokan.lib

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.

Mt.exe doesn't like absolute paths in the -dll option

Is it just me, or does Mt.exe hate absolute paths in the -dll option?
I have a Visual C++ project in Visual Studio 2008 with a reference to an isolated (registration free) COM DLL. I copy the COM DLL into the project's output directory using a Pre-Build Event. In the project's properties, on the Configuration Properties > Manifest Tool > Isolated COM dialog I used the following settings:
Type Library File: $(OutDir)\MyCom.tlb
Registrar Script File:
Component File Name: $(OutDir)\MyCom.dll
Replacements File:
Visual Studio shows me the generated command line command:
mt.exe /nologo
/tlb:"C:\[ ... snip ... ]\OtherProject\Release\MyCom.tlb"
/dll:"C:\[ ... snip ... ]\OtherProject\Release\MyCom.dll"
/outputresource:"..\Release\OtherProject.exe;#1"
It builds fine, but I get a runtime FileNotFound exception. The application can't find MyCom.dll! Changing Component File Name to the following relative path works fine:
Component File Name: ..\$(ConfigurationName)\MyCom.dll

Resources