简体   繁体   English

如何在Visual Studio中运行Linux下编写的程序

[英]how to run program written under linux in visual studio

Hi I'm trying to compile quite a big linux program on Visual Studio. 嗨,我正在尝试在Visual Studio上编译相当大的linux程序。 The source code is here http://public.fh-wolfenbuettel.de/~hoeppnef/fc.html I managed to overcome most problem however now I have no idea what to do. 源代码在这里http://public.fh-wolfenbuettel.de/~hoeppnef/fc.html我设法克服了大多数问题,但是现在我不知道该怎么办。 I got an error Cannot open include file: 'ext/functional': No such file or directory The problem is, that I can't find this header file, I've searched entire web and I could't find it. 我收到一个错误无法打开包含文件:'ext / functional':没有这样的文件或目录问题是,我找不到此头文件,我搜索了整个Web,但找不到。 Is there any way to run compile this application on visual stuio ? 有什么方法可以在visual stuio上运行该应用程序的编译吗? Or maybe You could recomend me good IDE on Linux (I've been always programming on Windows) It would be great if IDE on Linux had debugger as convinient as Visual's debugger 或者,也许您可​​以推荐给我Linux上的优秀IDE(我一直在Windows上编程)如果Linux上的IDE具有调试器像Visual的调试器一样方便,那将是很棒的

Porting this whole is going to be non-trivial. 移植整个过程并非易事。 For a start, there are portions of the code that run system commands using linux syntax. 首先,代码的某些部分使用linux语法运行系统命令。 Specifically: 特别:

if (legend)
    system("awk '/^###/  { if ($3>1) printf(\",\"); printf(\"\\\"-\\\" title \\\"%s\\\" with lines %d\",$2,$3) }' < .gsv-3.tmp >> .gsv-0.tmp");
else
    system("awk '/^###/  { if ($3>1) printf(\",\"); printf(\"\\\"-\\\" notitle with lines %d\",$3) }' < .gsv-3.tmp >> .gsv-0.tmp");

That from the gnuplot driver. 来自gnuplot驱动程序。

I suspect you are not looking for a major porting job and just want to run the code and tweak things. 我怀疑您不是在寻找主要的移植工作,而只是想运行代码并进行调整。 That being the case, the easiest in terms of work until results will be to use it on Linux and get used to gdb. 在这种情况下,最简单的工作是在Linux上使用它并习惯于gdb,直到获得结果为止。 Other options include trying msys/cygwin as these provide a linux-like environment but on Windows. 其他选项包括尝试使用msys / cygwin,因为它们提供了类似Linux的环境,但在Windows上。 However, unless you really want to start re-writing large chunks of the code, the app won't work whole. 但是,除非您真的要开始重新编写大量代码,否则该应用程序将无法正常运行。

I should add at this point cross platform portability (and I mean cross Unix/NT, not just amongst unices) needs to be designed in very carefully from the start of an application's development. 在这一点上,我应该补充说,从应用程序开发的开始就需要非常仔细地设计跨平台的可移植性(我的意思是跨Unix / NT,而不仅仅是在unices之间)。

There are two other suggestions which may take some effort to get working. 还有另外两个建议可能需要花一些精力才能开始工作。

  • Pull out the pieces you need. 拉出您需要的碎片。 This shouldn't be too difficult. 这应该不太困难。 Yes, you might need to re-write some of the logic/prune out some linux-only features, but it should be possible. 是的,您可能需要重写某些逻辑/删节一些仅适用于Linux的功能,但是应该可以实现。
  • Eclipse is a good IDE for Linux that gives you C++ support. Eclipse是Linux的优秀IDE,可为您提供C ++支持。 I've never tried it in terms of debugging as I tend to stick to gdb but for Java it is very good. 我从没有尝试过调试方面的经验,因为我倾向于坚持使用gdb,但是对于Java来说却非常好。 Might be worth a shot. 可能值得一试。

Regarding the Linux IDE request; 关于Linux IDE请求; I've always used Code::Blocks & GDB under Linux and so far no problems at all. 我一直在Linux下使用Code :: Blocks&GDB,到目前为止完全没有问题。

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

相关问题 如何在Linux下构建Visual Studio解决方案? - How to build Visual Studio Solution under Linux? 如何在其他计算机上部署Visual Studio中编写的简单boost程序 - how to deploy simple boost program written in visual studio on other computers 是否可以在Linux下的Mono中运行在Visual Studio 2013中编译的Win 32控制台C ++应用程序? - Can win 32 console C++ application compiled in Visual Studio 2013 be run in Mono under Linux? 如何使用Visual Studio从命令行运行OpenCL程序? - How to Run a OpenCL program from Command Line using Visual Studio? 如何在 Visual Studio Code 上运行程序 (C++) - How to run a program (C++) on Visual Studio Code 如何运行为旧编译器编写的程序? - How to run program written for old compiler? 如何在Windows或Linux,32或64位,Visual Studio或g ++上的静态或动态版本下编译Qt 5 - How to compile Qt 5 under Windows or Linux, 32 or 64 bit, static or dynamic on Visual Studio or g++ 无法在Visual Studio程序中运行合并排序 - could not run merge sort in Visual Studio program 程序无法在Visual Studio外部正常运行 - Program will not run properly outside of Visual Studio 无法在Visual Studio中使用指针和fstream运行程序 - cannot run program with pointer and fstream in visual studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM