weixin_44193103 2019-09-30 15:41 采纳率: 0%
浏览 993

错误 MSB6006 “CL.exe”已退出,代码为 2。 Project14 G:\11011\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 429 ?

编译器为VS2019
这是一个关于链表逆置的代码 ;
代码如下;

#include<stdio.h>
#include<stdlib.h>

struct node
{
    int data;
    struct node* next;
    struct node* prior;
};
void initlist(node* p);
void conversion(node* q);
void Printf(node* q);
int main()
{
     node* p;
    p = (struct  node*)malloc(sizeof(node));
    p->next = NULL;
    p->prior = NULL;
    p->data = -1;
    initlist(p);
    conversion(p);
    //Printf(p);
}
void initlist(node* q)
{
    int i;
    struct node* k,*p;
    p->data = 0;
    k= q->next;
    while (i<10)
    {
        struct node*s= (struct  node*)malloc(sizeof(node));
        s->data = p->data ++;
        s->prior = k;
        k->next = s;
        k = k->next;
        s->next = NULL;
    }
}
void conversion(node* q)
{
    int i;
    struct node* p,*s;
    s = q->next;
    while (s->data !=NULL)
    {
        if (s->next == NULL)
            p = s;
        s = s->next;
    }
    s = q->next;
    while (&s !=& p || s->prior != p)
    {
        s->data = s->data + p->data;
        p->data = s->data - p->data;
        s->data = s->data - p->data;
        p = p->prior;
        s = s->next;
    }
}

void Printf(node* q)
{
    struct node* p;
    p = q->next;
    while (p->next == NULL)
    {
        printf("%d", p->data);
        p = p->next;
    }
}

双击错误则跳转到另一个页面
显示代码如下;

                  <!-- Rest of the sources -->
   429->  <CL Condition="'%(ClCompile.PrecompiledHeader)' != 'Create' and '%(ClCompile.ExcludedFromBuild)'!='true' and '%(ClCompile.CompilerIteration)' == '' and @(ClCompile) != ''"
               BuildingInIDE                      ="$(BuildingInsideVisualStudio)"
               Sources                            ="@(ClCompile)"
  • 写回答

1条回答 默认 最新

  • threenewbee 2019-09-30 23:40
    关注

    CL是连接器错误,不是代码错误,写一个最简单的hello,看看是否有错误。写一个调用了printf和pause(分别使用了stdlib和stdio)的程序,看是否报错。

    另外,从逻辑上看
    while (s->data !=NULL)
    这里你确认是data么?data是int,!=NULL,这种写法很奇怪。

    评论

报告相同问题?

悬赏问题

  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决