code::blocks中怎么printf编译器版本?
codeblocks吧
全部回复
仅看楼主
level 9
萧云晨 楼主
RT.code::blocks中怎么printf编译器版本?
就像linux中 在终端输入gcc --version 一样把编译器版本打印出来
2017年02月09日 06点02分 1
level 9
萧云晨 楼主
windows 中怎么printf编译器版本?
2017年02月09日 07点02分 2
level 4
#ifdef __GNUC__
printf("\nCompiled by gcc-%d.%d.%d\n", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
#elif _MSC_VER
switch (_MSC_VER)
{
case 1910 :
{
printf("\nCompiled by VC2017 RC1\n");
break;
}
case 1900 :
{
printf("\nCompiled by VC2015\n");
break;
}
case 1800 :
{
printf("\nCompiled by VC2013\n");
break;
}
case 1700 :
{
printf("\nCompiled by VC2012\n");
break;
}
case 1600 :
{
printf("\nCompiled by VC2010\n");
break;
}
case 1500 :
{
printf("\nCompiled by VC2008\n");
break;
}
case 1400 :
{
printf("\nCompiled by VC2005\n");
break;
}
case 1310 :
{
printf("\nCompiled by VC2003\n");
break;
}
case 1200 :
{
printf("\nCompiled by VC6.0\n");
break;
}
default:
{
printf("\nCompiled by Other VC compiler\n");
break;
}
}
#endif // __GNUC__
2017年02月10日 00点02分 4
感谢, Compiled by gcc-4.2.1 ,貌似我的编译器没设置对——
2017年03月09日 10点03分
@萧云晨 好吧,Compiled by gcc-5.1.0..... 原来我这个是要从CbLauncher.exe打开,而不是codeblocks.exe
2017年03月09日 11点03分
1