LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mingw32 for linux? (https://www.linuxquestions.org/questions/linux-newbie-8/mingw32-for-linux-122017/)

StressedLemming 12-02-2003 02:21 PM

mingw32 for linux?
 
how do I use linux to compile a c++ program that relies on mingw32? Is there a linux equivalent to mingw32?

Tinkster 12-02-2003 02:42 PM

http://www.mingw.org/

Use their search, young Jedi...



Cheers,
Tink

StressedLemming 12-02-2003 02:58 PM

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.

Tinkster 12-02-2003 03:04 PM

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

StressedLemming 12-02-2003 03:07 PM

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 :)

Tinkster 12-02-2003 03:29 PM

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

StressedLemming 12-03-2003 05:49 AM

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.

guygriffiths 12-03-2003 09:39 AM

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.


All times are GMT -5. The time now is 03:26 PM.