I used cl command to compile a cpp file:
cl test.cpp //the generated test.exe can work well
then I used another way:
cl /Fa /c test.cpp //generate a test.asm assembly file
ml test.asm // there failed!!!
why? How to solve it?
source code:
//:test.cpp
#include<iostream>
using namespace std;
int main()
{
cout<<"hello
";
}
wrong information:
Assembling: test.asm
test.asm(1669) : fatal error A1010: unmatched block nesting
: ??$?6U?$char_trait
s@D@std@@@std@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@0@AAV10@PBD@Z
today I write another code in c
//test.cpp
#include<stdio.h>
void main()
{
printf("hello");
}
then I compile the code
cl /Fa /c test.cpp
ml test.asm //ok!
It may be the difference in C and C++. This confuses me a few days. :(
how to solve it? please help me.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…