Tag: visual studio

如何防止输出屏幕在Visual Studio 2013 C ++编译器中消失

我刚刚下载了Visual Studio 2013.当我编译C时,它没有显示我的输出。 输出屏幕将显示一小段时间然后消失。 #include int main() { printf(“hi”); return 0; } “程序'[5688] Project1.exe’已退出,代码为0(0x0)。” 我知道我的代码工作正常并且运行正常,但我不能让输出屏幕保持打开状态而不会在一秒钟之后退出。

使用Visual Studio 2012编译C app

我计划使用Microsoft Visual Studio 2012在C中编写应用程序。问题是我找不到在编辑器中编译它的方法。 我找到了这个解决方案http://msdn.microsoft.com/en-us/library/bb384838.aspx但我不喜欢它。 你能推荐我在Visual Studio 2012中编译C程序的方法吗?

如何将VSTS .lib转换为MinGW .a?

我有一个用Visual Studio编译的静态库,我想从MinGW链接到它。 我尝试更改后缀但是我得到了一堆警告: Warning: .drectve /DEFAULTLIB:”uuid.lib” /DEFAULTLIB:”uuid.lib” /DEFAULTLIB:”MSVCRT” /DEFAULTLIB:”OLDNAMES” ‘ unrecognized 。 还有一些错误,包括: ./libetpan.a(Release_ssl/mailimap.obj):(.text[_mailimap_noop]+0x7): undefined reference to 。 ./libetpan.a(Release_ssl/mailimap.obj):(.text[_mailimap_noop]+0x7): undefined reference to ___ security_cookie’`。 任何帮助是极大的赞赏。

是否可以使用Visual C ++编译pre-ANSI(K&R-style)C代码?

我们有一些旧的C代码,具有预ANSI(K&R风格)函数声明。 例如: int foo(x, y) double x, y; { /* do some stuff */ } 是否有编译器开关在Visual C ++ 2008中启用对此的支持?

Visual Studio 2008中奇怪的编译错误

编译以下代码时遇到问题: #include #include int main () { printf(“short: [%d,%d]\n”,SHRT_MIN,SHRT_MAX); printf(“int: [%d, %d]\n”,INT_MIN, INT_MAX); printf(“long: [%d, %d]\n”,LONG_MIN,LONG_MAX); int aa=017; printf(“%d\n”,aa); return 0; } 错误信息是: 1>c:\tic\ex1\ex2\ex2.c(12) : error C2143: syntax error : missing ‘;’ before ‘type’ 1>c:\tic\ex1\ex2\ex2.c(13) : error C2065: ‘aa’ : undeclared identifier 但是,编译这个很好: #include #include int main () { int aa=017; printf(“short: [%d,%d]\n”,SHRT_MIN,SHRT_MAX); printf(“int: [%d, […]

在Visual Studio 2012中编译GTK3程序

随着Windows的Gtk 3发布,我想到升级我的Gtk 2 C应用程序以利用新的GtkGrid小部件。 该程序在linux下编译或在Windows下使用MinGW(带代码块),但是当我在Visual Studio 2012下尝试相同的文件集时,给我50个左右的编译错误,说gutils.h,gtrashstack.h和gstring.h有一堆语法错误(假设我只使用一个基本程序,只有一个gtk_init和gtk_main)。 Visual Studio非常好地处理了gtk2。 为什么拒绝使用gtk3进行编译? 有什么办法让它与它一起工作? 尽管我喜欢Code :: Blocks,外部powershell迫使我保持​​我的代码VS2012兼容…… 编辑:我创建了一个存储库,其中包含一个简单的gtk3程序和VS2012和Codeblocks的预配置项目文件。 https://github.com/The-J-Person/Example-gtk3-vs2012-project 编辑2:这是VS2012给出的编译错误列表: http ://pastebin.com/ThZpwVmg

Visual C ++ / Studio:应用程序配置不正确?

我的C(++)程序,使用Visual C(++)/ Visual Studio编写和编译,在我自己的机器上运行良好,但拒绝在另一台机器上运行。 我得到的错误消息是“此应用程序无法启动,因为应用程序配置不正确。重新安装应用程序可能会解决此问题。”

如何在Visual Studio中为我的应用程序分配所有可用内存?

我想在我的基于Windows的软件中渲染4百万个三角形,该软件是用Visual Studio C ++ 2010(在发布模式下构建)编写的。 当我渲染390万个三角形时,软件消耗的总RAM内存为400MB。 但是当我尝试渲染4百万个三角形(仅多100K)时,系统会给我一个错误。 For Example: Point *P = new (std::nothrow) Point[nb_triangles]; //==> “(std::nothrow)” is for catching the run time memory allocation error. (Point is X, Y, Z floats) If(P == NULL) message(“System can’t allocate this much memory.”); // System gives me this error. It means the system can’t reserve huge memory […]

MSVC中的“interface”关键字是什么?

我正在浏览Windows 8.1 SDK和UnknownBase.h中的内容 typedef interface IUnknown IUnknown; 我之前从未见过这个interface关键字。 请注意,这绝对是一个.h标头,由cl.exe处理。 它不是IDL文件,并且它不由midl.exe处理。 我在网上找到了这个: http : //msdn.microsoft.com/en-us/library/50h7kwtb.aspx 但__interface与interface 谁能在这里提醒我?

C语言中__uuidof的替代

我正在使用一个使用DirectX的C项目,我遇到了一个问题。 某些DX调用需要IID对象,通常使用__uuidof生成。 这需要做的一件事是创建一个RenderTargetView。 DirectX示例/教程执行此操作: ID3D11Texture2D* pBackBuffer = NULL; hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( LPVOID* )&pBackBuffer ); 当我尝试在我的C代码中调用__uuidof时,出现编译错误: Error 19 error C4233: nonstandard extension used : ‘__uuidof’ keyword only supported in C++, not C DirectX有一个C接口,所以我想必须有办法做到这一点,但我不知道它会是什么。 谁知道?