执行devc+失败+;程序

执行devc+失败+;程序,c,codeblocks,dev-c++,C,Codeblocks,Dev C++,我已经在devc++上编译了它,它返回了以下消息 错误193:它不是win32有效的应用程序 我想不出问题出在哪里 对于C语言中的程序,代码块是否比devc++更好?因为我发现devc++有很多问题,所以请告诉我问题出在哪里,为什么我不能用devc++编译这个 /* Doubly Linked List implementation */ #include<stdio.h> #include<stdlib.h> struct Node { int data;

我已经在devc++上编译了它,它返回了以下消息

错误193:它不是win32有效的应用程序

我想不出问题出在哪里

对于C语言中的程序,代码块是否比devc++更好?因为我发现devc++有很多问题,所以请告诉我问题出在哪里,为什么我不能用devc++编译这个

/* Doubly Linked List implementation */
#include<stdio.h>
#include<stdlib.h>

struct Node  {
    int data;
    struct Node* next;
    struct Node* prev;
};

struct Node* head; // global variable - pointer to head node.

//Creates a new Node and returns pointer to it. 
struct Node* GetNewNode(int x) {
    struct Node* newNode
        = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = x;
    newNode->prev = NULL;
    newNode->next = NULL;
    return newNode;
}

//Inserts a Node at head of doubly linked list
void InsertAtHead(int x) {
    struct Node* newNode = GetNewNode(x);
    if(head == NULL) {
        head = newNode;
        return;
    }
    head->prev = newNode;
    newNode->next = head; 
    head = newNode;
}

//Inserts a Node at tail of Doubly linked list
void InsertAtTail(int x) {
    struct Node* temp = head;
    struct Node* newNode = GetNewNode(x);
    if(head == NULL) {
        head = newNode;
        return;
    }
    while(temp->next != NULL) temp = temp->next; // Go To last Node
    temp->next = newNode;
    newNode->prev = temp;
}

//Prints all the elements in linked list in forward traversal order
void Print() {
    struct Node* temp = head;
    printf("Forward: ");
    while(temp != NULL) {
        printf("%d ",temp->data);
        temp = temp->next;
    }
    printf("\n");
}

//Prints all elements in linked list in reverse traversal order. 
void ReversePrint() {
    struct Node* temp = head;
    if(temp == NULL) return; // empty list, exit
    // Going to last Node
    while(temp->next != NULL) {
        temp = temp->next;
    }
    // Traversing backward using prev pointer
    printf("Reverse: ");
    while(temp != NULL) {
        printf("%d ",temp->data);
        temp = temp->prev;
    }
    printf("\n");
}

int main() {

    /*Driver code to test the implementation*/
    head = NULL; // empty list. set head as NULL. 

    // Calling an Insert and printing list both in forward as well as reverse direction. 
    InsertAtTail(2); Print(); ReversePrint();
    InsertAtTail(4); Print(); ReversePrint();
    InsertAtHead(6); Print(); ReversePrint();
    InsertAtTail(8); Print(); ReversePrint();

}
/*双链表实现*/
#包括
#包括
结构节点{
int数据;
结构节点*下一步;
结构节点*prev;
};
结构节点*head;//全局变量-指向头节点的指针。
//创建新节点并返回指向该节点的指针。
结构节点*GetNewNode(int x){
结构节点*newNode
=(结构节点*)malloc(sizeof(结构节点));
newNode->data=x;
newNode->prev=NULL;
newNode->next=NULL;
返回newNode;
}
//在双链接列表的开头插入节点
void insertatead(int x){
结构节点*newNode=GetNewNode(x);
if(head==NULL){
头=新节点;
返回;
}
head->prev=newNode;
新建节点->下一步=头部;
头=新节点;
}
//在双链接列表的尾部插入节点
无效插入附件(int x){
结构节点*温度=头部;
结构节点*newNode=GetNewNode(x);
if(head==NULL){
头=新节点;
返回;
}
while(temp->next!=NULL)temp=temp->next;//转到最后一个节点
temp->next=newNode;
newNode->prev=temp;
}
//按正向遍历顺序打印链表中的所有元素
作废打印(){
结构节点*温度=头部;
printf(“转发:”);
while(temp!=NULL){
printf(“%d”,临时->数据);
温度=温度->下一步;
}
printf(“\n”);
}
//按反向遍历顺序打印链表中的所有元素。
void ReversePrint(){
结构节点*温度=头部;
如果(temp==NULL)返回;//空列表,退出
//转到最后一个节点
while(临时->下一步!=NULL){
温度=温度->下一步;
}
//使用prev指针向后遍历
printf(“反向:”);
while(temp!=NULL){
printf(“%d”,临时->数据);
温度=温度->上一个;
}
printf(“\n”);
}
int main(){
/*用于测试实现的驱动程序代码*/
head=NULL;//空列表。将head设置为NULL。
//正向和反向调用插入和打印列表。
插入附件(2);打印();反向打印();
插入附件(4);打印();反向打印();
insertatead(6);Print();ReversePrint();
插入附件(8);打印();反向打印();
}

如果我懂法语,您遇到的问题是编译的程序不是有效的Win32应用程序。这可能只是因为您选择了Windows项目,但提供了
int main()
而不是
WinMain
。这应该是一个控制台应用程序项目

如果这不是原因,我会怀疑一些与编程无关的原因,比如链接时运行可执行文件、导致破坏的反病毒程序、用户访问权限等


DevC++不再维护,因此它包含较旧版本的gcc/g++编译器。因此,我强烈建议改为使用代码块,因为它可以使用最新版本的编译器。总体而言,它还是一个功能强大得多的IDE,而且还可以干净地编译代码,因此没有理由坚持使用DevC++。

dev-c++中的编译参数是什么?如果您不喜欢dev-c++,可以下载并使用。这是一个关于如何纯C编程的小文章VS@SimoVS不是符合标准的C编译器。我不推荐它。@Simo,因为它直接来自微软。他们不在乎遵守标准。此外,MS关注C++,并且大部分支持C编译器的模式,尽管尝试了几次更新,但仍然非常过时。Simo不是一个观点,而是事实。一个合格的C程序不能在VS上编译。它可以在gcc、clang、icc等上编译。