Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在将我一直在开发的应用程序从 Linux 移植到 Mac,但我遇到了一个特定行的问题:
system(gnome-terminal -x sh -c \"/home/mrmartin/NetBeansProjects/Consumer/dist/Debug/GNU-Linux-x86/consumer\"");
显然这是因为 gnome-terminal 只是 gnome linux,但我似乎找不到 Mac 等价物。
您可以使用open,例如
system("open -a Terminal.app");
或者
system("open -a Terminal.app /path/to/script");