简体   繁体   中英

g++ compiler throwing errors with basic commands to compile

I'm currently using the g++ compiler on Mac OS X, trying to run the command

g++ rt.cpp –o rt  

For some strange reason, it throws the following errors:

clang: error: no such file or directory: '–o'
clang: error: no such file or directory: 'rt'

My gcc compiler works fine with the C projects I've written, so Xcode didn't entirely fail to download it. Any ideas what could be wrong?

I think you have a dash character (–) instead of a minus (-) before of the 'o'.

Try

g++ rt.cpp -o rt

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