游戏开发论坛

 找回密码
 立即注册
搜索
查看: 6414|回复: 4

求救~运行源代码有错误

[复制链接]

1

主题

2

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2006-6-17 20:06:00 | 显示全部楼层 |阅读模式
我在运行光盘中---01.游戏演示---中的源代码时有错误.不知道是怎么回师?我什么东东都没有改动过的,怎么会有错误呢?能告诉我吗?多谢.
错误如下:
--------------------Configuration: 游戏 - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
Compiling...
webbrowser2.cpp
游戏.cpp
游戏Dlg.cpp
Generating Code...
Linking...
LIBCMT.lib(strcat.obj) : error LNK2005: _strcpy already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCRTD.dll)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)
LIBCMT.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCRTD.dll)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCMT.lib(mbctype.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library
msvcrtd.lib(cinitexe.obj) : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/游戏.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

游戏.exe - 11 error(s), 3 warning(s)
[em7] [em7]

1

主题

2

帖子

0

积分

新手上路

Rank: 1

积分
0
 楼主| 发表于 2006-6-18 07:37:00 | 显示全部楼层

Re: 求救~运行源代码有错误

多谢哦,我在工程中加了LIBCMT.LIB
但是又出现了新的问题:
错误如下:
--------------------Configuration: 游戏 - Win32 Debug--------------------
Linking...
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _rand already defined in LIBCMT.LIB(rand.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: _srand already defined in LIBCMT.LIB(rand.obj)
msvcrtd.lib(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCMT.LIB(mbctype.obj)
LINK : warning LNK4098: defaultlib "msvcrtd.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCMT.LIB(crt0init.obj) : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/游戏.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

游戏.exe - 4 error(s), 2 warning(s)

我又在工程中加了msvcrtd.lib
有错误如下:
--------------------Configuration: 游戏 - Win32 Debug--------------------
Linking...
MSVCRTD.LIB(MSVCRTD.dll) : error LNK2005: _rand already defined in LIBCMT.LIB(rand.obj)
MSVCRTD.LIB(MSVCRTD.dll) : error LNK2005: _srand already defined in LIBCMT.LIB(rand.obj)
MSVCRTD.LIB(MSVCRTD.dll) : error LNK2005: __setmbcp already defined in LIBCMT.LIB(mbctype.obj)
LIBCMT.LIB(crt0init.obj) : warning LNK4098: defaultlib "libc.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
Debug/游戏.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

游戏.exe - 4 error(s), 1 warning(s)

请问这些问题怎么解决?
[em7] [em7] [em7] [em7]

30

主题

569

帖子

569

积分

高级会员

Rank: 4

积分
569
发表于 2006-6-18 10:22:00 | 显示全部楼层

Re:求救~运行源代码有错误

在C++下的运行库里设置,联接到多线程运行库

1

主题

6

帖子

6

积分

新手上路

Rank: 1

积分
6
发表于 2008-1-5 14:56:00 | 显示全部楼层

Re:求救~运行源代码有错误

解决了吗?我也是这个问题?

0

主题

1

帖子

0

积分

新手上路

Rank: 1

积分
0
发表于 2009-5-8 11:38:00 | 显示全部楼层

Re:求救~运行源代码有错误

这是作者在程序中用了第三方的界面皮肤库 SKinMagic.lib 的问题。。
解决思路: 去掉这个界面皮肤应用(只是影响程序的界面,不影响其它)
具体做法:
1、在StdAfx.h 中 注释掉 //#include "SkinMagicLib.h" 这一句
2、在 游戏.cpp 注释掉 //        InitSkinMagicLib( AfxGetInstanceHandle(),"DMJCI",NULL,NULL );
//        LoadSkinFile( (char*)(LPCSTR)("kin/kin01.data" ));
//        LoadSkinFile( (char*)(LPCSTR)(kin));
//        SetDialogSkin( "Dialog" );
3、 在   游戏Dlg.cpp 中 注释掉 //        ExitSkinMagicLib();

再编译就可以了。。。!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-20 09:23

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表