无法解析外部符号 __imp__CoUninitialize@0、_TID_D3DRMFrameTransformMatrix

1>------ 已启动生成: 项目: WinTest, 配置: Debug Win32 ------
1>生成启动时间为 2011/12/21 10:47:42。
1>InitializeBuildStatus:
1>  正在对“Debug\WinTest.unsuccessfulbuild”执行 Touch 任务。
1>ClCompile:
1>  所有输出均为最新。
1>ManifestResourceCompile:
1>  所有输出均为最新。
1>PlayVideo.obj : error LNK2001: 无法解析的外部符号 _TID_D3DRMFrameTransformMatrix
1>PlayVideo.obj : error LNK2001: 无法解析的外部符号 _TID_D3DRMFrame
1>PlayVideo.obj : error LNK2001: 无法解析的外部符号 _TID_D3DRMMesh
1>PlayVideo.obj : error LNK2001: 无法解析的外部符号 _TID_D3DRMAnimation
1>PlayVideo.obj : error LNK2001: 无法解析的外部符号 _TID_D3DRMAnimationSet
1>PlayVideo.obj : error LNK2001: 无法解析的外部符号 _TID_D3DRMAnimationKey
1>E:\Visual Studio 2010\Projects\WinTest\Debug\WinTest.exe : fatal error LNK1120: 6 个无法解析的
外部命令
1>
1>生成失败。
1>
1>已用时间 00:00:01.04
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
在VC工程里添加附加依赖项dxguid.lib并在代码里添加#include<rmxfguid.h>可以解决
1>------ 已启动生成: 项目: WinTest, 配置: Debug Win32 ------
1>生成启动时间为 2011/12/21 11:12:49。
1>InitializeBuildStatus:
1>  正在创建“Debug\WinTest.unsuccessfulbuild”,因为已指定“AlwaysCreate”。
1>ClCompile:
1>  所有输出均为最新。
1>ManifestResourceCompile:
1>  所有输出均为最新。
1>Link:
1>  所有输出均为最新。
1>PlayVideo.obj : error LNK2019: 无法解析的外部符号 __imp__CoUninitialize@0,该符号在函数 
_WinMain@16 中被引用
1>PlayVideo.obj : error LNK2019: 无法解析的外部符号 __imp__CoInitialize@4,该符号在函数 
_WinMain@16 中被引用
1>E:\Visual Studio 2010\Projects\WinTest\Debug\WinTest.exe : fatal error LNK1120: 2 个无法解析的
外部命令
1>
1>生成失败。
1>
1>已用时间 00:00:00.38
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
加上这个:ole32.lib

posted @ 2011-12-21 11:15 メmarsメ 阅读(3426) | 评论 (0)编辑 收藏

判断一个数是4的整数次幂

bool fn(unsigned int x) 

    if ( x & (x - 1) ) return false
    return x & 0x55555555; //如果前面两句能通过,就已经证明了x是4的整数倍数。这句返回的就是那个数 
    
//类型是bool 则返回值就是真了 
    
//任何二进制只有一个1的数(二的N次幂)
}

posted @ 2011-12-12 22:00 メmarsメ 阅读(295) | 评论 (0)编辑 收藏

编译器优化


#include<iostream>
using namespace std;
class C{
public:
    C(int i ){ cout << "constructor" << endl; }
    C( const C& c ){ cout << "copy" << endl; }
    C& operator = ( const C& c ){ cout << "=" << endl; }
private:
};
C fun(){
    return C(2);
}
int main(){
    C c( fun() );

}
/*
constructor
请按任意键继续. . .
*/
没有调用拷贝构造函数
编译器做了优化,C c( fun() )->C c(C(2))。构造两个同样的构造函数,
其中一个是没用的临时对象,编译器就直接把它转化为C c(2),

posted @ 2011-12-12 10:54 メmarsメ 阅读(195) | 评论 (0)编辑 收藏

static_cast注意点

#include "stdafx.h"
class C{
public:
    ~C(){ cout << "~C" << endl; }
};


class B:public C{
public:

    ~B(){ cout << "~B" << endl; }
};
int main(){
    B b;
    static_cast<C>(b);
    (C)b;
}
/*
~C
~C
~B
~C
请按任意键继续. . .
*/#include "stdafx.h"
class C{
public:
    ~C(){ cout << "~C" << endl; }
};


class B:public C{
public:

    ~B(){ cout << "~B" << endl; }
};
int main(){
    B b;
    C* pc;
    pc = static_cast<C*>(&b);
    pc = (C*)&b;

posted @ 2011-12-07 19:21 メmarsメ 阅读(143) | 评论 (0)编辑 收藏

类继承中调用函数

#include "stdafx.h"
class B{
public:
    void fun(){ fun2(); }
    void fun2(){ cout << "B" << endl; }
};

class C:public B{
public:
    void fun2(){ cout << "C" << endl; }
};

int main(){
    C c;
    c.fun();
}
// output:
// B

posted @ 2011-12-07 01:08 メmarsメ 阅读(195) | 评论 (0)编辑 收藏

LNK4006 symbol already defined in object; second definition ignored

1>LINK : warning LNK4075: 忽略“/INCREMENTAL”(由于“/FORCE”规范)
1>GRMA.obj : warning LNK4006: "struct HWND__ * GhDlg" (?GhDlg@@3PAUHWND__@@A) 已在 ConnectDatabase.obj 中定义;已忽略第二个定义
1>GRMA.obj : warning LNK4006: "char * szAppName" (?szAppName@@3PADA) 已在 ConnectDatabase.obj 中定义;已忽略第二个定义
1>GRMA.obj : warning LNK4006: "char * szHeadName" (?szHeadName@@3PADA) 已在 ConnectDatabase.obj 中定义;已忽略第二个定义
1>E:\Visual Studio 2010\Projects\Guest Room Management App\Debug\Guest Room Management App.exe : warning LNK4088: 因 /FORCE 选项生成了映像;映像可能不能运行
1>Manifest:

解决方案:
如果用头文件定义全局变量的话,就只能在一个cpp里面包含该头文件,其他地方用extern引用 
否则每个包含该头文件的cpp生成的obj都会有一个定义

posted @ 2011-11-29 09:54 メmarsメ 阅读(2229) | 评论 (0)编辑 收藏

vs2010出现link2005

在项目属性 链接器 命令行 上加上:/FORCE:MULTIPLE即可

posted @ 2011-11-29 09:38 メmarsメ 阅读(318) | 评论 (0)编辑 收藏

__imp__InitCommonControlsEx@4 __imp__EndDialog

1>------ 已启动生成: 项目: Guest Room Management App, 配置: Debug Win32 ------
1>生成启动时间为 2011/11/27 10:51:46。
1>InitializeBuildStatus:
1>  正在创建“Debug\Guest Room Management App.unsuccessfulbuild”,因为已指定“AlwaysCreate”。
1>ClCompile:
1>  所有输出均为最新。
1>ResourceCompile:
1>  所有输出均为最新。
1>ManifestResourceCompile:
1>  所有输出均为最新。
1>Link:
1>  所有输出均为最新。
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__EndDialog@8,该符号在函数 "int __stdcall DlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DlgProc@@YGHPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__SetFocus@4,该符号在函数 "int __stdcall DlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DlgProc@@YGHPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__SetWindowPos@28,该符号在函数 "int __stdcall DlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DlgProc@@YGHPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__GetSystemMetrics@4,该符号在函数 "int __stdcall DlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DlgProc@@YGHPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__GetWindowRect@8,该符号在函数 "int __stdcall DlgProc(struct HWND__ *,unsigned int,unsigned int,long)" (?DlgProc@@YGHPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__DefWindowProcA@16,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__PostQuitMessage@4,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__DestroyWindow@4,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__EndPaint@8,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__BeginPaint@8,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__CreateWindowExA@48,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__GetWindowLongA@8,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__GetClientRect@8,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__InitCommonControlsEx@4,该符号在函数 "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__DispatchMessageA@4,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__TranslateMessage@4,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__TranslateAcceleratorA@12,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__GetMessageA@16,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__LoadAcceleratorsA@8,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__UpdateWindow@4,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__ShowWindow@8,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__MessageBoxA@16,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__RegisterClassA@4,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__GetStockObject@4,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__LoadCursorA@8,该符号在函数 _WinMain@16 中被引用
1>GRMA.obj : error LNK2019: 无法解析的外部符号 __imp__LoadIconA@8,该符号在函数 _WinMain@16 中被引用
1>E:\Visual Studio 2010\Projects\Guest Room Management App\Debug\Guest Room Management App.exe : fatal error LNK1120: 26 个无法解析的外部命令
1>
1>生成失败。
1>
1>已用时间 00:00:01.09
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
Gdi32.lib
user32.lib

无法解析的外部符号 __imp__InitCommonControlsEx@4
comctl32.lib
version.lib

posted @ 2011-11-27 10:53 メmarsメ 阅读(1996) | 评论 (0)编辑 收藏

不能使用库函数 不能定义其他的变量 strcpy逆序拷贝

写C语言的拷贝函数,要求复制字符串,并且将复制后的字符串逆序 比如from中是1234, 则to中是4321 void strcyp(char * to,const char * from)问题补充:   
要求: 不能使用库函数 不能定义其他的变量。

#include <stdio.h>
#include <assert.h>

void recopy2(char ** pto, char * from)
{
    if ('\0' != *from)
    {
        recopy2(pto, from + 1);
        *((*pto)++) = *from;
    }
}

void recopy1(char * to, const char * from)
{
    assert(NULL != to && NULL != from);
    recopy2(&to, (char *)(from));
    *to = '\0';
}

void main()
{
    {
        char src[5] = "1234";
        char des[6] = "abcde";

        printf("before: %s -- %s\r\n", src, des);

        recopy1(des, src);

        printf("after:  %s -- %s\r\n", src, des);
    }

    {
        char src[5] = "1234";
        char des[5] = "abcd";

        printf("before: %s -- %s\r\n", src, des);

        recopy1(des, src);

        printf("after:  %s -- %s\r\n", src, des);
    }
}

posted @ 2011-11-25 02:19 メmarsメ 阅读(185) | 评论 (0)编辑 收藏

SQL 2008: provider: 共享内存提供程序, error: 0 管道的另一端上无任何进程 AND sa登陆失败 错误:18456

第一个错误解决:
首先选中服务器(右键)->属性->安全性->服务器身份验证修改为"SQL SERVER和WINDOWS身份验证模式"
其次展开服务器上的"安全性"->登陆名->选中SA登陆帐号(右键)->状态->登陆修改为启用
第一个问题解决了可能还会出现第二个错误,解决方案:

1 windows身份登录数据库-》安全 -》登录名 双击sa 里面设置密码   点击左边菜单中的状态 登录选中“启动” 确定

2 关闭连接 用sa登录到数据库 成功
记住执行完第一步后要重启才能登陆成功

posted @ 2011-11-24 19:08 メmarsメ 阅读(3353) | 评论 (0)编辑 收藏

仅列出标题
共5页: 1 2 3 4 5 
<2024年3月>
252627282912
3456789
10111213141516
17181920212223
24252627282930
31123456

导航

统计

常用链接

留言簿

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜