简体   繁体   English

c ++如果我的程序在eclipse上运行,它将在linux上运行吗?

[英]c++ if my program runs on eclipse will it run on linux?

I have a working program on eclipse but my professor plans on running it through linux. 我有一个关于Eclipse的工作程序,但是我的教授计划通过linux运行它。 Does that mean i have to do all the argc argv stuff? 这是否意味着我必须完成所有argc argv的工作? If so, Im ok with that. 如果是这样,我可以。 But if it can run on linux without doing so thats even better because the argc argv stuff is kinda confusing at times. 但是如果它可以在Linux上运行而不这样做的话,那就更好了,因为argc argv有时会令人困惑。

Anyone know if my program will run? 有人知道我的程序会运行吗?

these are my header files: 这些是我的头文件:

#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <cstring>
#include <iomanip>
#include <cstdlib>
#include <limits>
#include <algorithm>
#include <vector>
#include <ostream>

There's no guarantee that it will run. 无法保证它将运行。 If you are not doing anything esoteric it should be fine. 如果您不做任何深奥的事情,那应该没问题。 Depends on the complexity of the program as well as what compiler on linux is being used as well as what APIs are being used (for eg if you are using WINSOCK APIs they won't be available on Linux). 取决于程序的复杂性,使用的是Linux上的编译器以及使用的API(例如,如果您使用的是WINSOCK API,则它们在Linux上将不可用)。

The best way is to try to run it on Linux. 最好的方法是尝试在Linux上运行它。

Also, do you know what the "argc/argv stuff" is? 另外,您知道什么是“ argc / argv东西”吗? Omitting those in the main() method usually should be fine. 在main()方法中省略那些通常应该没问题。

You should compile your code on the same platform that it will be run on. 您应该在将运行代码的平台上编译代码。 You should also fully test the program on that platform you plan to run on. 您还应该在计划运行的平台上完全测试该程序。 If you don't have a unix environment you should go get one or install one on a virtual machine. 如果您没有Unix环境,则应该在虚拟机上安装一个或安装一个。

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

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