LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-10-2010, 01:22 AM   #1
Udhayakrishnan
LQ Newbie
 
Registered: Feb 2009
Posts: 19

Rep: Reputation: 0
Unhappy Compiling C program


I have a c program and its related libraries for Linux. But, I need a EXE file to run in windows.

please let me know how to compile the program for windows
 
Old 02-10-2010, 02:24 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Um, you want to port a program from Linux to Windows? This is is not easy. Can you tell us what the program is?

Evo2.
 
Old 02-10-2010, 04:50 AM   #3
Udhayakrishnan
LQ Newbie
 
Registered: Feb 2009
Posts: 19

Original Poster
Rep: Reputation: 0
Lightbulb

Zap is a wireless throughput test tool which can be used to fully characterise the statistical performance of a wireless link.

http://zapwireless.googlecode.com/svn/trunk/
 
Old 02-10-2010, 06:12 AM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
I just had a look at the source. Given the "#ifdef WIN32"s sprinkled through the code it looks like it is supposed to compile on windows. I guess you'll just need to first install gcc and make.

Evo2.
 
Old 02-10-2010, 06:31 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Moved to programming (not a Linux question)
 
Old 02-10-2010, 08:08 AM   #6
Udhayakrishnan
LQ Newbie
 
Registered: Feb 2009
Posts: 19

Original Poster
Rep: Reputation: 0
Question

U mean, I have to install gcc & make on linux, if so, I already did it and have a binary file runs on linux.

Can U please be specific about porting a program from Linux to windows. I am new on porting programs
 
Old 02-10-2010, 08:17 AM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Run "./configure --help". Can you produce a windows target? If it doesn't have a configure file, you will need to read the Makefile or code to see if you can produce win32 code.

Usually you need to use the MingGW or Cygwin's gcc compiler to produce Windows code. There are some libraries that exist in both windows and Linux. You may need to install them as well if needed.

Most importantly, read the README and INSTALL files carefully.
 
Old 02-10-2010, 08:19 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I think evo meant that you have to set up a development environment on Windows. More generally, your devolopment environment needs to include the headers, libraries, etc. for Windows

eg. if your source code specifies "include stdio.h", then stdio.h needs to be a Windows version.

Disclaimer: I am not a programmer.
 
Old 02-10-2010, 08:21 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
You, not U
 
  


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
compiling a netfilter program rooky Programming 2 06-04-2009 08:57 AM
help compiling a program minm Linux - Newbie 3 10-10-2005 01:14 AM
Compiling a Program? dbzw Linux - Software 4 10-09-2005 01:31 PM
Compiling a program lintho Linux - Software 2 08-24-2004 07:41 AM
Compiling Program Star3132 Linux - General 8 06-29-2004 05:35 AM

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

All times are GMT -5. The time now is 09:17 PM.

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