VC++Tips

源代码在linux下写的,先要在windows下编译,用到这几个函数,网上搜到替换(drand48()->((double)rand()/(RAND_MAX+1.0)), srand48->srand, lrand48->rand)


Visual C++ 2008 Standard:M_PI is not defined

In my app I use the constant M_PI.
As recommended, in my cpp file I wrote:

#define _USE_MATH_DEFINES
#include <cmath> 

The compiler complains: "error C2065: 'M_PI' : undeclared identifier"

I have transferred the solution and source files from the Visual Studio 2005 Standard. In this version of VS all was compiled and linked just fine.

Replacing the <cmath> with <math.h>

#define _USE_MATH_DEFINES
#include <math.h>

solves the problem: all compiles OK.

Also if I define _USE_MATH_DEFINES in ProjectProperties/C++/Prepocessor
and #include <cmath> in the cpp module, all works.


VS 2010: How to change VC++ directories Inherited values (read only)

VS2010 introduces the user settings file (Microsoft.cpp.<Platform>.users.props) to control global settings including Global search path. These files are located at $(USERPROFILE)\appdata\local\microsoft\msbuild\v4.0 directory.

The issue you are seeing is a bug in the UI. To make it possible to change the ordering of these read-only directories, here is the workaround that you can apply:

1. open up the property manager, 
2. right click on the .user.props file to bring up the property page
3. open up VC++ Directories -> Include Directories, add new paths after $(IncludePath)
4. Click on the "Edit" dropdown on VC++ Directories -> Include Directories property, the user directories as well as the inherited values will show up in the upper pane
5. you can move the directory orders as you wish and save. 

转载于:https://www.cnblogs.com/yxfhlh/archive/2012/11/26/2788688.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值