LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-02-2003, 02:21 PM   #1
StressedLemming
LQ Newbie
 
Registered: Oct 2003
Posts: 26

Rep: Reputation: 15
mingw32 for linux?


how do I use linux to compile a c++ program that relies on mingw32? Is there a linux equivalent to mingw32?
 
Old 12-02-2003, 02:42 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
http://www.mingw.org/

Use their search, young Jedi...



Cheers,
Tink
 
Old 12-02-2003, 02:58 PM   #3
StressedLemming
LQ Newbie
 
Registered: Oct 2003
Posts: 26

Original Poster
Rep: Reputation: 15
I'm confused, is mingw32 only used to compile windows programs? If so I'm looking in the wrong place. I need to take code that was written in windows and compile and run it in linux.
 
Old 12-02-2003, 03:04 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Guess it depends on whether it uses windows
specific API... if it's a program that was originally
written for a posix environment and then just
ported to Windows using mingw32 you should
be able to just compile it using gcc...


Cheers,
Tink
 
Old 12-02-2003, 03:07 PM   #5
StressedLemming
LQ Newbie
 
Registered: Oct 2003
Posts: 26

Original Poster
Rep: Reputation: 15
No, it's a program my university tutor wrote in windows and wants me to get running in linux. Unfortunately I don't have the foggiest clue how to go about this
 
Old 12-02-2003, 03:29 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Well ... check the headers it includes.

grep "#include" <your files name>

and then see if they're all there :)

grep "#include" <your files name> | awk -F'[ <>"]' '{system ("find /usr -name " $3)}'


Cheers,
Tink
 
Old 12-03-2003, 05:49 AM   #7
StressedLemming
LQ Newbie
 
Registered: Oct 2003
Posts: 26

Original Poster
Rep: Reputation: 15
I believe some of the headers are windows specific, such as windows.h and io.h... so my first problem is how to replace these headers with linux equivalents so that I can compile and run the program in linux.

My second problem is that there are preprocessor directions in the code which spew out errors when I try and compile, eg:

#if !defined(__MINGW32__)
#error: MINGW32 not defined

I'm not sure if these problems are related or how I go about fixing them. I'm afraid my programming knowledge is quite limited.
 
Old 12-03-2003, 09:39 AM   #8
guygriffiths
Member
 
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524

Rep: Reputation: 37
What subject do you do at university? If it's not Computer Science or something of that ilk then your tutor is probably asking a bit too much. If it is, then is this a project or something that you are doing? I.E. is your project to port this from windows to linux? It might take a fair bit of effort, that's all. Also, what does the program do? If it doesn't use a lot of windows output, it's may be easiest to start from the ground up, and just build in the X dependence yourself.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to compile xerces-c using mingw32? hongxing Linux - Software 0 10-26-2005 07:22 AM
Cross-COmpiling with MinGW32 headers Adam15906 Linux - Software 2 09-16-2005 09:51 PM
kdevelop, mingw32, glut problem kph Programming 5 05-20-2005 03:59 AM
mingw32 liguorir Linux - Software 5 08-02-2004 10:13 PM
MingW32 2.0.0 for win32 Makefiles! sewer_monkey Programming 0 10-22-2002 11:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:13 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