+ Reply to Thread
Results 1 to 7 of 7

Thread: help with cgi c++

  1. #1
    shk0dran is offline x10Hosting Member shk0dran is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    3

    help with cgi c++

    i made a simple program in c++ called m.exe i puted it in the cgi-bin folder when i try to open it it does not generate anything it just says me to download the m.exe
    when i try the same thing in my apache sever in my computer it works
    can any one tall me whats the problem

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: help with cgi c++

    The X10 servers run Linux, which is not binary compatible with any version of Windows. It's only possible to run Windows binaries on Linux using the WINE compatibility suite, but (as far as I know) it's not installed on any X10 server.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    shk0dran is offline x10Hosting Member shk0dran is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    3

    Re: help with cgi c++

    thank you very much misson
    Is there any program which allows me to compile my c++ program in windows that would be binary compatible with Linux servers
    Last edited by shk0dran; 11-28-2009 at 03:45 AM.

  4. #4
    Gouri's Avatar
    Gouri is offline Community Paragon Gouri has a brilliant futureGouri has a brilliant futureGouri has a brilliant future
    Join Date
    Oct 2007
    Location
    India
    Posts
    4,502

    Re: help with cgi c++

    If you are talking generally then to run any c code you have to compile the code using gcc compiler on linux.

    As per hosting concern they don't allow any such kind.

    What exactly this code does? Can't you code the same in PHP or ASP.net?
    If you feel my post is useful then click to give Reputation (bottom left corner of this post)

    X10 Hosting | News and Announcements | Premium Hosting | VPS Hosting | Prime Membership

    Tech Community | Gouri

  5. #5
    shk0dran is offline x10Hosting Member shk0dran is an unknown quantity at this point
    Join Date
    Nov 2009
    Posts
    3

    Re: help with cgi c++

    thanks for response i'll try it with php

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: help with cgi c++

    Perl and Python are also options, if you want to stick with CGI scripts. There's ASP.Net, but not all of the .Net framework is supported since Linux must use a platform like Mono to support .Net, and there are differences between Mono and Microsoft's .Net frameworks.

    While it is possible to cross-compile, it's very tricky because the compiler has to support the target processor and have dynamic libraries for the target system in the correct locations so the binary can be linked properly. Even compiling on a Linux distro may not work; sometimes programs compiled on one Linux distro won't work on another. If you manage to get a working binary, remote debugging isn't allowed. All things considered, it's much easier to use a scripting language.
    Last edited by misson; 11-28-2009 at 04:54 AM.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  7. #7
    eliasr's Avatar
    eliasr is offline x10 Lieutenant eliasr is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Mexico
    Posts
    345

    Re: help with cgi c++

    Another problem are the system functions, while Linux use read() write() as system calls, windows use other system, and a compiler needs all this information to create binaries that works with the SO.

    Today many Linux distros (mixin wine mingw and expand gcc) can cross compile very complicated aplications for Windows.

    If you want use cgi and you program use pure Standard C++ Libraries, shortly only Standard C++ (no plataform specific, like windows.h), you can test, debug and run over Windows, then get a Live CD (or USB distro), launch Linux, compile with gcc and upload the binaries.
    Last edited by eliasr; 11-28-2009 at 01:52 PM. Reason: try hide my "stupidly"
    Programacion en estado de ebriedad
    --
    elias.exofire.net------------------Desktop--------------------Ellen Page
    ||

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers