Posts Tagged ‘tips’
How To Set Environment Variable When Debugging Using Microsoft Visual Studio 2008
Posted by admin in Unix2Win32_Porting on October 18th, 2010
Set up project properties environment variable
I am new to microsoft windows visual studio 2008 IDE , Was looking for How to set environment variables when debugging in Visual Studio?
My project is in c/c++ windows console application.
Set Environment Variables in VS2008
Here are few simple steps to add environment variable.
- Open your project.
- Go to Project>Properties or pres Alt+F7
- Under Configuration Properties>Debugging, edit the ‘Environment’ value to set environment variables.
I wanted to set and add the directory “C:\Program Files\Hummingbird\Connectivity\13.00\Exceed” to the path when debugging app X applications, set the ‘Environment’ value to
PATH=%PATH%;C:\Program Files\Hummingbird\Connectivity\13.00\Exceed;C:\Program Files\Intel\Compiler\Fortran\10.1.021\IA32\Bin
And done.
Set System Wide Environment Variables in Windows PC
Other way to set up this is using system wide environment variable.
- Right click “My Computer”, Select properties
- Select the “advanced” tab
- Click the “environment variables” button
- In the “System variables” section, add the new environment variable that you desire
- “Ok” all the way out to accept your changes
Note : Visual Studio 2003 doesn’t allow you to set environment variables for debugging. In this case one can use _putenv function.
source – Windows Sysinternals: Documentation, downloads and additional resources
Solution – C Requires That a Struct Or Union Has At Least One Member
Posted by admin in Unix2Win32_Porting on August 3rd, 2010
Windows errors are strange,
I have one header file in which one structure is declared,
as
typedef struct {
key_t xyz;
——
}INFO;
For this When I compile using cl.exe I get following list of errors.
: error C2016: C requires that a struct or union has at least one member : error C2061: syntax error : identifier 'key_t' : error C2059: syntax error : '}'
Well I am doing Code migration from Unix system to Windows system so key_t is not known in windows.
It does not make sense for the
Compiler Error C2016
which says no closing single quotation mark. Scratching my head and going around with the error.
I do not see any mistake in struct declaration,
Solution – C requires that a struct or union has at least one member
Just add the declaration of key_t in same header file before structure declaration.
typedef int key_t;
And compile again you are done.
Number of View :10857