It's the first time that I want to use a downloaded SDK. What is the best way to include its source files, by not adding them to the project folder (external)?
(I'm using VC++ 6.)
You just need to set up your compiler and linker include paths to reference the new headers and libraries that are included in the SDK.
For VC6, right click on your project in the Workspace -> Settings:
C/C++ -> Category 'Preprocessor' ->
Additional include directories
Link-> Category 'Input' -> Additional
library path
For later versions - right click on your project in the Solution Explorer - open Properties.
Configuration Properties-> C/C++ ->
General -> Additional Include
Directories
Configuration Properties-> Linker ->
General -> Additional Library
Directories
Related
I am trying to set the override the destination directory of the merge module as described here. I set the destination directory to [BIN]. BIN is public property. At compile time the value of [BIN] is C:\Program Files (x86)\CompanyName\ProductName.
Based on the user input in a custom dialog, this property is updated to C:\Program Files (x86)\CompanyName\UserInputName\ProductName.
All the DLL files from the merge module are copied into the compile-time value of [BIN] - C:\Program Files (x86)\CompanyName\ProductName. For some reason, the dynamic value is ignored in this case.
Can someone tell me what could be going wrong?
I am using Install Shield Version 2010 Professional Edition, Project Type is Basic MSI Project
Merge Modules add a GUID to every primary key to prevent merge collisions. So the BIN identifier actually turns into BIN.G_U_I_D when used in a Merge Module.
To resolve this issue, Merge Modules are designed to be "retargetable".
I have posted the same question on InstallShield forum, the conclusion there was it is not supported by InstallShield to change destination directory of an MSM file during run time.
A workaround suggested is to have a custom action 'Set Directory'.
Here are the steps:
In the Redistributable view, right click on the MSM file ->
Properties -> Destination -> set to [MSM_DEST_STATIC_DIR].
Create a custom action of type'Set Directory', with Directory Name -
MSM_DEST_STATIC_DIR, Directory Value - [MSD_DEST_DIR_DYNAMIC_VALUE]
After getting the user input from the dialog, first, update the MSD_DEST_DIR_DYNAMIC_VALUE, then execute the custom action created in step 2.
While doing this I also realized that it is not possible to update the IISROOTFOLDER based on the dynamic user input. I followed the same procedure with the custom action to update the IISROOTFOLDER.
In Visual Studio 2013/VC++ for a statically linked executable, how do I override a property setting, when it is in bold( not inherited) by using a property sheet? I cannot edit the vcxproj file as it is auto generated and direct edits are lost when it is generated.
Details:
I have a Visual studio solution that contains two projects:
Dependency.vcxproj --> Generates Dependency.lib which is a static library.
MyProg.vcxproj --> Links to Dependency.lib and generates MyProg.exe
Of these, Dependency.vcxproj is auto generated and I do not have control over its generation( It is generated from a build script every time I run it). I see that It has Optimization set to O2 and also has Debug Information Format set to none. ( Both of these are in bold - so I assume they have been explicitly turned off). However, to allow for debug, I want to override these properties and set Optimization Disabled and Debug Information Format to /Zi when I am building it as part of my solution.
I tried overriding it using a .props file for the project, but the values are not overridden - I read somewhere that a property needs to inherit for a props sheet to override.
Is there any way to override such an already modified property without editing the vcxproj file itself?
You need to make sure you lib project is actually using your .props file. Means, it has to be included in the project. If you want to override already defined property with .props, this .props needs to be included after the property is set to override it. Basically .props work similar to text inclusion.
Another option could be to use .user file to override the properties (.user may be already included into generated .vcxproj, with condition "if exists"). But anyways you need to find a way to include your file re-defining the linker properties into the .vcxproj file.
Normally, you use "debug" vs "release" configurations to allow/disallow debugging. Maybe you just need to select "debug" configuration for your solution (this one can be found in the toolbar, a combo box in Visual studio) and then build?
If this is not the case, I would say the easiest way out may be modifying the script you use to generate the project to generate the project you want.
I normally work with C#. In C# I can have a hierarchy, and they reference each other.
I am trying to do the same in VC++, but I dont know how. I don't have much experience with C++ in general.
I have:
TestProject1
TestProject2: I need to use classes that are in TestProject1 here.
I tried adding TestProject1 as reference of TestProject2:
Right Clikc on the TestProject1-> Properties -> Common Properties -> Framework and References -> Add New Reference -> Selected TestProject2
But this results in an error, because TestProject2 is not built as a lib.
From what I can see only a list of obj files are generated.
What is the correct way to reference TestProject2 in TestProject1 so I can use its classes?
Update: How I solved it
I solved the issues by following SOReader instructions, but I added the lib in a different way:
First I changed the TestProject1 project type as SOReader indicated (Right Click on TestProject1 project -> Properties-> Configuration Properties -> General-> Set Configuration Type to Static library (lib)
Add reference to TestProject1 in TestProject2 -> Right Click on TestProject2 project -> Properties-> Common Properties -> Framework and References -> Add New Reference -> Select TestProject1
It's not so easy as it is in C#.
You must have TestProject1 build as static library if you want to simply include it to another project. After this you go to dependent project properties and add lib file to linker and headers folder for headers lookup.
Assuming Dll has its include .h file in its root folder (which actually should not have) you simply add an entry to Additional Include Directories to point the place where Dll root folder is.
Now you can just write #include <theheaderfile.h> in you cpp file in Main application to reference exported functionality.
Here are few others locations in msdn that might help: import/export, static libraries, hpp vs h
When I type:
System.
I am expecting Windows to be one of the options available with the Intellisense, but it is not.
Why not?
Maybe you don't have a reference to the correct assembly. You need to make that yourself if you have a console project for example.
You need to right click the references and add a new one:
System.Windows.Forms
See also How to: Add or Remove References in Visual Studio
You don't have a reference in your project to System.Windows.Forms?
Writing a console app?
Are you working on a Windows Forms project?
If so, you should have a reference to System.Windows.Forms added in your project references.
But for a class library (and probably eg console or ASP.NET project), you won't have this by default.
You need to add reference.
go to -> Add Reference ".Net" -> "System.Windows.Forms".
I use m2e. I have dynamic web project A, java project B and project A is dependent on project B. I want the JAR file that is generated in the target folder of project B to be moved to the WebContent/lib of project A. What is the simplest way to achieve this?
1) Enter Project B as dependency in the POM of project A. That ist the prerequiste for maven to resolve the dependency from A to B.
2) In the Eclipse project preferences of project A make sure the in the section "maven" the option "Resolve dependencies form Workspace projects" option is enables (should be by default.
Usually, this should do it