C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 13th, 2002, 01:01 PM
hardseeker hardseeker is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 64 hardseeker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
can a webhost run C programs ?

can a webhost run C programs ?

if my home computer is a windows, and my host is a unix,

can i have a compiled C program in windows run on unix ?
__________________
perl / cgi newbie

Reply With Quote
  #2  
Old November 13th, 2002, 01:13 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,163 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 6 Days 1 h 34 m 20 sec
Reputation Power: 791
in most cases no.
It is possible, through some tinkering, but you first have to get something like the cygwin environment and use gcc to compile the application. Then move the source to the webserver and compile it there. This may require some tweaking to make it compile properly.

The reason why I say get gcc is because you only want to use headers and a compiler that will work on a unix box. You definately can't do this with MS.
Now, there are ways of running (some) windows applications on *nix types through wine (windows emulation) but not all programs will run in this and I am not sure you can use this in conjunction with the webserver. Another consideration is if the webhost will allow you to use an application on thier server.

Basically, in 9 out of 10 cases you will have to compile the program on the unix machine.

Reply With Quote
  #3  
Old November 22nd, 2002, 10:47 AM
ClayDowling ClayDowling is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Flint, MI
Posts: 328 ClayDowling User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 19 m 25 sec
Reputation Power: 11
Many webhosts allow system executables (i.e. compiled programs) as CGI scripts. I am using this now (see http://www.toyboxtoys.com/catalog.cgi for an example), and I really like the speed and the stability of it.

It's an interesting experience that will test your development capabilities though. The following tactics seem to work best:

1. Develop on the same platform that you will deploy on. If you're deploying on Solaris, develop on Solaris. If you're deploying on FreeBSD, develop on FreeBSD. You have some flexibility here. I develop on OpenBSD and depoy on FreeBSD, but I can only do this because both systems are very similar (the operating systems share a lot of code in common) and I am familiar with development on both of them. I wouldn't try this if the deploy system was Solaris or Linux, for example, and I wouldn't dream of developing on Windows and deploying on a UNIX system.

2. Expect to supply most external libraries that you'll be using, and link to them statically. Even if your web host has the libraries you need, they may be the wrong version, and they will upgrade on a different schedule than you will. In the example I provided above, I'm using three external libraries: libcgic and libgd from www.boutell.com, and libmysqlclient. Because of size and compatibility, I had to use the system libmysqlclient, but I needed to supply the other two and link statically, even though one of them was provided by the system.

3. Learn your build tools well, because you'll be changing parameters to accomodate the differences in the development and deployment environments. For example, on my development system libcgic and libgd are both in /usr/local/lib, with necessary includes in /usr/local/include. On my deployment server, they're in ../cgic and ../gd. Since I don't want to change my code, I need to change linking and include paths passed to my compiler based on where I'm developing.

4. You need shell access to the deploy server, unless you can miraculously duplicate the deployment environment on your development system (including indentical versions and locations for all files). There are always subtle little differences between machines that will eventually trip you up.
__________________
Clay Dowling
Lazarus Notes
Articles and commentary on web development
http://www.lazarusid.com/notes/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > can a webhost run C programs ?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap