LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-02-2004, 06:03 PM   #1
sfcesario
LQ Newbie
 
Registered: Jan 2004
Posts: 4

Rep: Reputation: 0
Creating/Converting Windows exe to Linux


Hi!

Im only recently a convert

Im trying to create a linux exe from my XP box. Either by creating a Windows exe and then using some converting program? Or by just writing the linux exe straight off (is it possible?)

The ultimate goal is to create linux exe's files and upload them to my linux server somewhere in the US, for CGI use. (because my linux box is not connected to the net or my LAN i cant write them directly from linux, and i'd rather not endlessly transfere exe's on floppy from linux box to XP box just to upload to server.)

im programming C/C++ using g++ (is this where im going wrong?), with Debian (woody)

Thanks
James
 
Old 02-02-2004, 08:30 PM   #2
Berng
Member
 
Registered: Dec 2003
Location: Siberia,Russia
Distribution: Basically RedHat
Posts: 34

Rep: Reputation: 15
Re: Creating/Converting Windows exe to Linux

sfcesario,
Try the following algorithm:
1) Install cygwin system on your Windows computer
2) Intsall gcc on your cygwin system with cross-compiler to linux systems
3) Compile your program under cygwin with gcc cross-compiler
4) upload resulting linux-program on linux box.
This might help...
Best Regards,
Oleg.
 
Old 02-03-2004, 08:34 AM   #3
sfcesario
LQ Newbie
 
Registered: Jan 2004
Posts: 4

Original Poster
Rep: Reputation: 0
That's been useful but im having problems getting the "cross-compile" bit sorted.

'man gcc' seems to show if i do something along the lines of
'gcc -b linux example.cpp' then it'll compile for the linux system (or do i have to know the exact computer type my server is?)

im confused as to how to actually get the cross-compile gcc.

Thanks again,
James
 
Old 02-03-2004, 10:58 AM   #4
sfcesario
LQ Newbie
 
Registered: Jan 2004
Posts: 4

Original Poster
Rep: Reputation: 0
I've just tryed taking gcc from the linux box and pasting on to XP box, using cygwin to use that gcc version.

$ ./gcc-2.95 test.cpp
Program too big to fit in memory

James
 
Old 02-03-2004, 08:57 PM   #5
Berng
Member
 
Registered: Dec 2003
Location: Siberia,Russia
Distribution: Basically RedHat
Posts: 34

Rep: Reputation: 15
Quote:
Originally posted by sfcesario
I've just tryed taking gcc from the linux box and pasting on to XP box, using cygwin to use that gcc version.

$ ./gcc-2.95 test.cpp
Program too big to fit in memory

James
sfcesario,
I am not sure, that i understand what you have done . You could not just copy gcc from linux box to Win box, they have different executable formats and it will not work. In case you want to have cross-compiler under cygwin for you linux box, you must BUILD it under cygwin from gcc sources BY HAND, using necessary header files from your linux box, see gcc's corsscompiling readme for details.

Might be it would be easier to use combination of scp/ssh to transfer sources to the linux box and execute compiler there, smth like this:
cygwin>scp mycprog.cpp linuxuser@linuxhost:mycprog.cpp
cygwin>ssh linuxuser@linuxhost 'gcc mycprog.cpp -o myscprog'

If you would want it to be runned as a batch process and do not ask for password, you should configure sshd on linux box to do not ask password and use key authorization instead.

Best Regards,
Oleg.

Last edited by Berng; 02-03-2004 at 08:59 PM.
 
Old 02-05-2004, 08:08 AM   #6
doclane
LQ Newbie
 
Registered: Feb 2004
Posts: 3

Rep: Reputation: 0
i also am a noob to linux, i don't have my linux box up and running yet.

but i would like to ask a question that may help here also.

could you program using a cd based distro such as knoppix on your windows machine?
 
Old 08-19-2006, 07:27 AM   #7
teckboy1243
LQ Newbie
 
Registered: Mar 2005
Distribution: arch linux, slackware,FreeBSD
Posts: 15

Rep: Reputation: 0
Quote:
Originally Posted by doclane
i also am a noob to linux, i don't have my linux box up and running yet.

but i would like to ask a question that may help here also.

could you program using a cd based distro such as knoppix on your windows machine?
Yes, if your distro has a compiler. You would also need a way to store your files when you are done such as a USB thumb drive.
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting .exe files?? tyranus Debian 8 09-09-2005 09:04 PM
Linux binary to windows exe bolabala Linux - Newbie 10 02-11-2005 11:31 AM
exe file linux to windows degraffenried13 Linux - General 2 04-09-2004 05:57 AM
Converting Linux to Windows... BlackEcho Linux - General 1 03-03-2004 02:54 PM
If *.exe for Windows what is for LinuX? Nukem Linux - Newbie 4 10-05-2003 05:23 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration