| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 507 人关注过本帖
标题:编译过程中出现问题求帮助
只看楼主 加入收藏
jcg
Rank: 1
等 级:新手上路
帖 子:6
专家分:1
注 册:2015-4-16
结帖率:0
收藏
已结贴  问题点数:20 回复次数:7 
编译过程中出现问题求帮助
本人在vc++6.0上编译一个工程时出现了如下错误信息:
rom_maplist.c
csp_maplist.c
Linking...
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
demo___Win32_Debug/demo.cgi : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.

demo.cgi - 1 error(s), 0 warning(s)
 不知如何解错,请老师们指点迷津,谢谢!
搜索更多相关主题的帖子: warning 工程 如何 信息 
2015-07-24 09:46
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:10 
代码呢

DO IT YOURSELF !
2015-07-24 09:48
jcg
Rank: 1
等 级:新手上路
帖 子:6
专家分:1
注 册:2015-4-16
收藏
得分:0 
csp_maplist.c的代码:

/* NOTE: DO NOT EDIT THIS FILE,
 * this file is created by tool (csp2bin version: 1.0.2) automaticly,
 * build at: Fri Jul 24 09:31:39 2015
 */
/* NOTE: YOU MUST ADD THIS FILE TO YOUR PROJECT,
 * but the files in directory `csp_p' needn't.
 * newzy 2005-12-3 22:22
 */



#include <eblib.h>
#include "csp_p/_demo_main2_csp.c"
#include "csp_p/_demo_test_csp.c"


EB_CSP_MAPFILE csp_maplist[] = {
    {"/demo/main2.csp", _demo_main2_csp__, 0x1000, 0x10001000},
    {"/demo/test.csp", _demo_test_csp__, 0x1000, 0x10001001},
    {NULL, NULL, 0, 0},
};

rom_maplist.c的代码:
/* NOTE: DO NOT EDIT THIS FILE,
 * this file is created by tool (web2bin version: 1.0.2) automaticly,
 * build at: Fri Jul 24 09:31:40 2015
 */

#include <ebfrm.h>

static unsigned char _img_052_png[] = {
     0x5C, 0x86, 0x41, 0x83, 0xD3, 0x00, 0x00, 0x00, 0x00, 0x49,
    0x45, 0x4E, 0x44, 0xAE, 0x42, 0x60, 0x82,
};

static unsigned char _img_face_gif[] = {
    0x47, 0x49, 0x46, 0x38, 0x37, 0x61, 0x32, 0x00, 0x32, 0x00, 0xE3, 0x0D, 0x00, 0x00, 0x00, 0x00,
     
};

/*  */
EB_ROM_MAPFILE rom_maplist[] =
{
    {"/img/052.png", _img_052_png, 0x18A7, 0x53B25DF7L, 0x00001000},
    {"/img/face.gif", _img_face_gif, 0x0685, 0x451651F0L, 0x00001001},
    {(void*)0, (void*)0, 0, 0L, 0x0}
};
/* xx_rom_map */

cgimain.c的代码:
#include <stdio.h>
 #include <string.h>
 #include <stdLib.h>
 #include <ebrequest.h>
 #include <ebrespond.h>
  
 /* set debug break in VC++ */
 #define EXCEPTION_DEBUG  0
int cgimain()
    {
    extern EB_CSP_MAPLIST  csp_maplist[];
    extern EB_ROM_MAPLIST  rom_maplist[];
    #if EXCEPTION_DEBUG /* for debug */   
    int    v=0, *p1=&v, *p2=NULL;
     *p2 = 0;
     #endif

     ebSetDebug("GET", "cgi=/demo/main.csp"); /* set debug environment */


         putenv(EBENV_MAIN_PAGE "=/demo/main.csp");  /* set main-page */

          /* respond require */

          eyBuildExec(csp_maplist, rom_maplist, NULL);
     return OK;
    }
2015-07-24 10:02
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:0 
c语言只有main这一个入口函数  你咋弄出个 int cgimain()   ???

DO IT YOURSELF !
2015-07-24 10:04
jcg
Rank: 1
等 级:新手上路
帖 子:6
专家分:1
注 册:2015-4-16
收藏
得分:0 
这是一个cgi程序,入口是cgimain()
2015-07-24 10:08
jcg
Rank: 1
等 级:新手上路
帖 子:6
专家分:1
注 册:2015-4-16
收藏
得分:0 
单个程序编译都通过了,但是一加链接库就出现下面的错误:
rom_maplist.c
csp_maplist.c
Linking...
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
demo___Win32_Debug/demo.cgi : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.

demo.cgi - 1 error(s), 0 warning(s)

是不是链接库之间有冲突。我是按文档要求
“添加eyBuildLib库的搜索路径,方法是:打开Project Æ Setting ÆLink 选项卡,
在分类(Category)下拉框中选择General,并在Object/library modules:输入框最后(项与项之间用空格分隔)添加项$(EYBUILD_BASE)/lib/eybuild.lib”
做的但编译时出现错误。
2015-07-24 10:18
wp231957
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:神界
等 级:贵宾
威 望:423
帖 子:13688
专家分:53332
注 册:2012-10-18
收藏
得分:0 
cgi的没玩过  不知道和普通的一不一样

普通的main程序 则是 包含头文件和 引入链接库(lib) 同时具备 否则无法编译

DO IT YOURSELF !
2015-07-24 10:20
rjsp
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:528
帖 子:9007
专家分:53942
注 册:2011-1-18
收藏
得分:10 
这是一个cgi程序,入口是cgimain()
------ 没有这说法,而且所谓“入口函数”也只是C/C++中的一个“概念”而已。
2015-07-24 10:48
快速回复:编译过程中出现问题求帮助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014815 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved