简体   繁体   中英

Warning when compiling with clang++

When I compile the code:

#include <iostream>
#include <string.h>

using namespace std;

int main(void) {

    string m1;

    cout<< "enter your name: "<<endl;
    getline(cin,m1);

    cout << "Your name is: " << m1 << endl;

    return EXIT_SUCCESS;
}

It give the following warning:

type of symbol `_main' changed from 32 to 512 in >C:\\Users\\KDesktop\\AppData\\Local\\Temp\\cc7XPBuL.o

Secondly, the compiler does generate an .exe file, but whenever I run it, the program crashes immediately. Can someone help me with this issue.

Thank you

Your toolchain is outdated. Older versions of LLVM used the wrong value for the function symbol type; the bug was fixed in late 2010. Here's the bug report: http://llvm.org/bugs/show_bug.cgi?id=8320

You should upgrade your LLVM; the problem will go away.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM