Hack Forums
[C] How to test windows .cpp in codeblocks, to linux terminal - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [C] How to test windows .cpp in codeblocks, to linux terminal (/showthread.php?tid=5172246)



How to test windows .cpp in codeblocks, to linux terminal - Aus10 - Feb 15, 2016

Hi guys, so I own a windows pc and I need to test my codeblocks program on a linux server. As for my project, the professor requires it to be able to compile on a linux server.

I am a complete noob when it comes to linux.

Any help? Thanks!


* - Annabelle Lee - Feb 15, 2016

(Feb 15, 2016 08:20 PM)Aus10 Wrote:  Hi guys, so I own a windows pc and I need to test my codeblocks program on a linux server. As for my project, the professor requires it to be able to compile on a linux server.

I am a complete noob when it comes to linux.

Any help? Thanks!

  1. Get a virtual machine, install linux on it, compile it and check there.

  2. Ask your professor if he knows what computers on campus use linux and if you can test, engineering buildings usually have.

  3. Find an online IDE that uses gcc-g++ and test with that. (Not a good idea.)





* - Shoe - Feb 15, 2016

(Feb 15, 2016 08:23 PM)AnnabelleLee Wrote:  
  1. Get a virtual machine, install linux on it, compile it and check there.

  2. Ask your professor if he knows what computers on campus use linux and if you can test, engineering buildings usually have.

  3. Find an online IDE that uses gcc-g++ and test with that. (Not a good idea.)



Pardon my ignorance, but couldn't he also get a (free) Linux server and see if it runs on there? Could take some load off his machine and allow him to access the files from locations other than his desktop. I know this sounds weird. 😧


* - Annabelle Lee - Feb 15, 2016

(Feb 15, 2016 08:24 PM)Shoe Wrote:  Pardon my ignorance, but couldn't he also get a (free) Linux server and see if it runs on there? Could take some load off his machine and allow him to access the files from locations other than his desktop. I know this sounds weird. 😧

How or where would he get a free linux server at such short notice? Unless he has a pc laying around he can install linux on, doesn't seem feasible.


* - RISC - Feb 15, 2016

If it's pure C/C++ , then you don't need to worry about which machine you are compiling on. The code is by nature portable and can be compiled on both operating systems. So long as you don't rely on OS functionality. If your code works on Windows and does not involve any OS API directly then it will run the same on Linux.


* - Shoe - Feb 16, 2016

(Feb 15, 2016 08:29 PM)AnnabelleLee Wrote:  How or where would he get a free linux server at such short notice? Unless he has a pc laying around he can install linux on, doesn't seem feasible.

I didn't see any sense of urgency for OP's post so I didn't figure he needed it that quickly. AWS offers a free server for a year (I believe it's capable of Ubuntu and such), DigitalOcean gives out free credit left and right, etc etc.


* - Annabelle Lee - Feb 16, 2016

(Feb 16, 2016 06:15 AM)Shoe Wrote:  I didn't see any sense of urgency for OP's post so I didn't figure he needed it that quickly. AWS offers a free server for a year (I believe it's capable of Ubuntu and such), DigitalOcean gives out free credit left and right, etc etc.

I simply presumed since he has a school project, it's due relatively soon, but I see your point. Cheers.


* - Aus10 - Feb 16, 2016

Was able to figure it out using argc and argv stuff. Thanks guys! Tried virtual machine, confusing stuff. :P