LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 03: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, 03:42 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

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

Use their search, young Jedi...



Cheers,
Tink
 
Old 12-02-2003, 03: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, 04:04 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 04: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, 04:29 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 06: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, 10:39 AM   #8
guygriffiths
Member
 
Registered: Jun 2003
Location: Reading, UK
Distribution: Debian 3.0, LFS
Posts: 524

Rep: Reputation: 36
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 08:22 AM
Cross-COmpiling with MinGW32 headers Adam15906 Linux - Software 2 09-16-2005 10:51 PM
kdevelop, mingw32, glut problem kph Programming 5 05-20-2005 04:59 AM
mingw32 liguorir Linux - Software 5 08-02-2004 11:13 PM
MingW32 2.0.0 for win32 Makefiles! sewer_monkey Programming 0 10-23-2002 12:25 AM


All times are GMT -5. The time now is 03:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration