当前位置:首页 > 编程开发

ps 记录

webgou16年前 (2010-11-30)编程开发358
ps 记录 [B]Compiler Error C2733 - second C linkage of overloaded function 'function' not allowed[/B] If we try to compile with Microsoft Visual C++ 2010 Express a project that includes old Microsoft Platform SDK headers and against old libraries, we have to modify Additional include Directories and Additional library Directories. When we install Microsoft Visual C++ 2010, it updates the old Windows SDK, adding a new directory in C:\Program Files named Microsoft SDKs. This directory contains new headers and new libs, so if we try to compile an old project with persistent references to the old SDK, Visual C++ will return a bunch of errors C2733 (in my case "second C linkage of overloaded function '_interlockedbittestandset' not allowed"). As said above, the solution is to update the paths in Additional include Directories and Additional library Directories. (example, from C:\Program Files\\Microsoft Platform SDK\Include to C:\Program Files\Microsoft SDKs\Windows\v7.0A\include). Best regards. [B]fatal error C1853 预编译头文件来自编译器的早期版本,或者预编译头为 C++ 而在 C 中使用它(或相反) [/B] 方案1: 适用于绝大多数文件是 .cpp 或绝大多数文件是.c的情况。在这种情况下,将少数的不同类文件设为不使用预编译头是比较平衡的做法,方法是:对于 VC++6.0,在 FileView 里对要取消预编译头的 .c (或 .cpp) 文件点右键,选择 settings,在弹出的对话框右边选择 category 为 precompiled headers,再设置选项为 not using ...;(对于 VS2005,则在 solution explorer 中对相应文件点右键选择 properties,在 precompiled headers 项下设置 not using... 即可。如果需要设置多个文件,则可以按住 Ctrl 键再同时选中这些文件并设置)PS:解释如下点击项目 点击属性 然后选择C/C++ 预编译头 创建使用头文件 不使用预编译头文件(解决方案资源管理器-右击需要排除的c或cpp文件]-弹出属性菜单-展开C/C++-预编译头-创建/使用预编译头-选择不适用预编译头) 方案2: 影响的文件比较多,则把它们都设置禁止预编译头的话仍然会使项目总体的编译速度大大降低,得不偿失。这时考虑可以为这组文件建立专用的预编译头。在 VC++ 极早期版本(1.5及以前版本)中是支持单个工程中建立分别针对 .c 和 .cpp 的预编译头的,但之后的版本中只支持单独的预编译头。在这种情况下,我们可以在workspace(或 solution)中建立一个新的静态链接库 (Static Library) 工程,将所有的 .c 文件独立出来加入到该工程中单独编译,这样就可以在该静态链接库中针对 .c 文件创建预编译头。但是这样做在一定程度上需要被独立出来的代码在逻辑上是属于同一模块中的,这样才便于维护。不过从设计的角度来说,这个要求一般是满足 的,否则就应考虑下项目的总体设计了:P 最后别忘了设置原项目的依赖项 (dependency) 为独立出来的这个静态库项目。 [B]Re: ERROR: Use of C runtime library internal header file.[/B] Then in VS make sure the Preprocessor Directives and Include file path are set properly for your project, by doing the following: 1) In VS 2005, go to Project > Properties > C/C++ > Preprocessor, and make sure that at least these three Preprocessor Definitions are set: _WIN32_WCE;UNDER_CE;_X86_ Then do either 2A or 2B: 2A) Be sure your INCLUDE environment variable is set to "C:\Program Files\Windows CE Tools\wce600\\Include\X86" (or whatever your appropriate Include path is). (This is what the compiler uses as the "Standard Include Path".) or 2B) In ...C/C++ > Preprocessor, set "Ignore Standard Include Path" to "Yes (/X)", and in the General settings, set "Additional Include Directories" to "C:\Program Files\Windows CE Tools\wce600\\Include\X86" (or whatever your appropriate Include path is). Hope this helps... David K

扫描二维码推送至手机访问。

版权声明:本文由知了博客发布,如需转载请注明出处。

本文链接:https://www.webgou.info/?id=403

分享给朋友:

“ps 记录” 的相关文章

Android选项卡具体代码编写方式介绍

在对Android操作系统进行相应修改中,我们可以发现,这一系统的编程方式非常简单易懂,方便开发人员实现各种功能需求。在这里就先从Android选项卡的实现来具体了解一下这一系统的编写方式。首先创建Android工程命名自己的Activity为HelloTabWidget在main.xml或者自己定…

Android类库常用类型解析

在Android类库中,各种包写成android.*的方式,重要包的描述如下所示:android.app :提供高层的程序模型、提供基本的运行环境android.content 包含各种的对设备上的数据进行访问和发布的类android.database :通过内容提供者浏览和操作数据库android…

Android消息传递应用功能解析

Android手机操作系统中有一种叫做Intent的消息传递机制。这在实际编程中是一个核心技术,值得我们去深入的研究。在这里大家将会了解到有关Android消息传递的一些基础应用技巧,帮助大家理解。每一个Cursor、ContentResolver做为一个小的注册中心,相关观察者可以在这个中心注册,…

Android核心模块内容概述

Android作为一个移动设备的平台,其软件层次结构包括了一个操作系统(OS),中间件(MiddleWare)和应用程序(Application)。根据Android的软件框图,其Android核心模块结构自下而上分为以下几个层次:第一、操作系统层(OS)第二、各种库(Libraries)和Andr…

mysql 5.0存储过程学习总结

一.创建存储过程 1.基本语法:create procedure sp_name() begin ......... end 2.参数传递 二.调用存储过程 1.基本法:call sp_name() 注意:存储过程名称后面必须加括号,哪怕该存储过程没有参数传递 三.删除存储过程...…

内存映射文件/堆 栈

内存映射文件 对文件进行操作几乎是所有应用程序都必须进行的,并且这常常是人们争论的一个问题。应用程序究竟是应该打开文件,读取文件并关闭文件,还是打开文件,然后使用一种缓冲算法,从文件的各个不同部分进行读取和写入呢?M i c r o s o f t提供了一种两全其美的方法,那就是内存映射文件…

评论列表

webgou
webgou

A simple windows programm in c

The following programm is a minimal windows program. It opens a window and writes a text into the window.
If you compile it with MinGW, be sure to add the -mwindows flag in order to prevent the ... undefined reference to 'TextOutA@20' and ... undefined reference to 'GetStockObject@4 linker error.
#include <windows.h>
LRESULT CALLBACK WndProc(
HWND hWnd,
UINT msg,
WPARAM wParam,
LPARAM lParam ) {
switch( msg ) {
case WM_PAINT: {
PAINTSTRUCT ps;
HDC hDC = BeginPaint( hWnd, &ps );
TextOut(hDC, 10, 10, "ADP GmbH", 8 );
EndPaint( hWnd, &ps );
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc( hWnd, msg, wParam, lParam);
}
return 0;
}

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。