简体   繁体   English

g ++编译选项

[英]g++ compiling option

What are options for compile .cpp file into .s and .o without linking it. 在不链接的情况下将.cpp文件编译为.s和.o的选项是什么?

I used g++ -s -c but it only produced .o file. 我用了g ++ -s -c,但是它只产生.o文件。

g++ -s with create undefined reference to main (because it a class implementation not a main) g ++ -s带有对main的创建未定义引用(因为它是类实现而不是main)

生成asm文件的选项是-S ,gcc上的大写字母S(您正在使用-s )。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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