Using WinPcap in VC++ programs - visual-studio-2010

I am trying to include WinPcap library in one of my Visual C++ program and I am using Visual Studio 10 Ultimate.
In the documentation it says
To add a preprocessor definition, you
must select Properties from the
Project menu, then select C/C++ from
the list control on the left, and
under the category Preprocessor, you
must add the definition under the
Preprocessor Definitions text box.
Project -> Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions-> Added WPCAP
I have performed this step successfully, then
To add a new library to the project,
you must select Properties from the
Project menu, then select Linker from
the list control on the left, and
under the category Input add the name
of the new library in the Additional
Dependencies text box.
Project -> Properties -> Linker -> Input -> Additional Dependencies -> Added wpcap.lib
Now I have problem while performing the third step.
To add a new path where Microsoft
Visual Studio will look for the
libraries, you must select Options
from the Tools menu, then Project and
Solutions from the list control on the
left, VC++ Directories, then choose
Library Files in the Show directories
for combobox, and the add the path in
the box below.
Tools -> Options -> Project and Solutions -> VC++ Directories.
Here it says VC++ Directories editing in Tools > Options has been deprecated.
Now where is this user property sheet located ? Can some one point me in a right direction?
Thanks.

It is now a project property and located in project properties -> VC++ Directories.

Related

Linking in visual studio 2015

So I'm trying to link a library into my project, but I'm not getting the option to link after clicking on add existing item and selecting the .lib to add...
when I click on the arrow near the add tab, I just get the options "add" and "show previous versions" ...
so how do I actually link in visual studio 2015 ?
Libraries aren't treated like source files. Remove the library from the source files list, and instead right-click on a project in Solution Explorer, select Properties->Configuration Properties->Linker->Input and add libraries to the Additional Dependencies list. Suppose you want to add foo.lib, the line would look like
foo.lib;%(AdditionalDependencies)
This can all be found in the linker documentation
If your project is C++, try this:
Open project property window
Go to Configuration Properties->Linker->Input, add your lib to Additional Dependencies
Go to Configuration Properties->Linker->General, add directory of your lib to Additional Library Directories

Force visual studio to have same include directories between debug and release mode

I was wondering if there is a way to synchronize settings for include and link directories between debug and release configurations for project/solution?
More precisely, is there any way to tell visual studio I would like project properties
C/C++ - > General -> "Additional Include Directories"
Linker -> General -> "Additional Library Directories"
Linker -> Input -> "Additional Dependencies"
to be same for debug and release configuration, or somehow efficiently/automatically forward those settings from one configuration to the other configurations? Perhaps there is any plugin/script for that, since it is only necessary to change few lines in project text file to do what I want?
I'm currently using visual studio 2005, but I think this feature should not depend too much on version of the studio, so please post answers/solutions for any version of visual studio.
Use property sheets: create a property sheet containing the common properties, then include it in each build configuration. Do everything via the Property Manager window; be careful now: any change you want to make to the common properties must be made in the property sheet, not in the project properties!

How do I add a lib file to link in Visual C++ 2010?

I've found the Additional Dependencies thing on Visual C++ 2010, but I can't seem to find any option of adding new .lib files when I go to .
I need to add wsock32.lib to link with my file, how do I make it happen?
Thanks!
Add the wsock32.lib in the text field.
Project Properties -> Linker -> Input -> Additional Dependencies.
When you click in the field, you get a ... button. Click on this button and add one library name per line. Alternatively you can write the names in the field. Separate all entries with space characters.
You can verify that it's on the command line in
Project Properties -> Linker -> Command Line.
Here is a GUI way to add a LIB file to your Visual Studio project in C and C++ Languages (for those of us who like to mouse-around like me). I did this in Visual Studio 2012. But I think it works in previous versions, as well.
Find the LIB or other file you want to add to your project in
Windows Explorer. Drag the LIB file from Windows Explorer onto
Visual Studio's Solution Explorer, to the project to which you wish
to add the LIB file. Now, you will see the file listed in Solution Explorer.
That's it! Just one step! You will not see the file in "Project Properties -> Linker -> Input -> Additional Dependencies." However, it is there hidden in the macro
%(AdditionalDependencies).
edit Additional Dependencies and puts wsock32.lib in it.
and also add the path of lib in Link->general-> additional library directories

Windows Driver Development with Eclipse

Is that possible to integrate WDK into Eclipse? WDK seems to have its own compiler and debugger, so I wonder if there is a plug-in or it could be done manually?
See DDKBUILD for an example of how to launch the WDK build procedure from a bath file:
http://www.osronline.com/article.cfm?article=43
Typically all you need to do is modify this procedure to fit your IDE.
-scott
Run Eclipse from build environment that you need (free or checked with needed architecture)
Create project or import C/C++ / Existing code as makefile project. Select GNU Toolchain.
Properties -> Builders -> New -> Environment -> Select, select all variables, mark "add to all configurations", select "replace native environment with specified on". On the Main tab select full path to build.exe of the selected build environment. Select your project directory in workspace as "working directory"
Properties -> C/C++ Build -> On Bulder Settings tab remove "Use default build command" flag and type "build"
Properties -> C/C++ Build -> Tool Chain Editor -> Select Tools. Personaly I selected msvc compilers.
Properties -> C/C++ General -> Paths and Symbols -> select includes that you need including WDK ones
Enjoy

Visual C++ 2010 project properties macros - how to edit?

I need to change the value of macro TargetExt. How can I do this? I can't find a way to do that from IDE (??!) and those macros aren't stored in project file either.
Go to: Project -> NAME properties... -> Configuration properties -> Target Extension

Resources