Forums > Dev

Mingw libraries

August 8, 2006 | 3:53 am

Hi all,
I’ve been working on getting custom externals to work with Mingw. I’ve followed the instructions in the cygwinHowTo, and I get successful compilation, but I believe I’m having trouble with the cygwin1.dll. I have heard some people say that different versions of this DLL cause varying problems and crashes in Max (which I have been experiencing). Naturally, I have been trying to use -mno-cygwin to use only system libraries, and am getting successful compilations. However, I still get crashes, and using objdump on my MXE shows that some references to cygwin libraries still exist. One of you posted a link that said this is because the proper mingw libraries are not present, and that I must download these to make it work. I have looked a good deal, and I am not sure where I can get these libraries. They don’t seem to be available through the cygwin setup utility. Any ideas?

Thanks,
Mike


August 8, 2006 | 7:36 pm

On Aug 7, 2006, at 8:53 PM, Mike Sayre wrote:

> I’ve been working on getting custom externals to work with
> Mingw. I’ve followed the instructions in the cygwinHowTo, and I
> get successful compilation, but I believe I’m having trouble with
> the cygwin1.dll. I have heard some people say that different
> versions of this DLL cause varying problems and crashes in Max
> (which I have been experiencing). Naturally, I have been trying to
> use -mno-cygwin to use only system libraries, and am getting
> successful compilations. However, I still get crashes, and using
> objdump on my MXE shows that some references to cygwin libraries
> still exist. One of you posted a link that said this is because
> the proper mingw libraries are not present, and that I must
> download these to make it work. I have looked a good deal, and I
> am not sure where I can get these libraries. They don’t seem to be
> available through the cygwin setup utility. Any ideas?

Most likely the crashes are due to something else. If you’re unable
to attach gdb while loading your object under the runtime version of
Max, you’ll want to take other strategies to debug, like debug posts
(or writing to a file based log) and/or use a process of attrition to
comment ou all functionality of your code, adding bit by bit until
the problem surfaces, etc..

Not sure about eliminating the cygwin dependencies entirely, but I
believe that with the -mno-cygwin flag you will only have some static
libraries included and not find issues with cygwin DLLs present. I
had no issues at the time of writing the cygwinHowTo with using the
versions of mingw provided through the cygwin setup utility.

If you’re not requiring the use of GCC for other reasons than just
looking for a free optimizing compiler, I would suggest you take a
look at Microsoft’s Visual C express compiler package.

-Joshua


August 9, 2006 | 1:39 pm

Mike –

I was able to build a no-cygwin version of an external with a strong unix
heritage, and I ran into many of the same problems you seem to be
encountering. Here’s a couple of suggestions:

1. If you are compiling a set of objects or building your own libraries,
be sure that the "-mno-cygwin" flag is set for every step of the
compilation. This should also help in tracking down where the missing
libs might be creeping in — the cygwin compiler should report the errors
for the particular object.

2. I had to remove a lot of unix-like stuff (like printfs, perror,
ptheads, etc.) to get my code to build, replacing them with
max/msp-friendly functions or rewriting the code and including it as one
of my own compiled objects.

3. I think I had to redirect where my headers were being found at some
point, but I can’t recall if I was able to set it back to "normal". I
don’t have access to my windows machine at present, but I’ll check when I
get back home. Including the "-mno-cygwin" flag at every step helped me
to identify where the header problems were, I think.

Probably later this week I’ll do an ‘official’ release of the new
[rtcmix~], and my source code will also be on-line. My hacked-up cygwin
makefiles might be helpful (but ‘hacked-up’ is a kinder and gentler
description than they actually deserve).

[chuck~] also up later this week, OSX only at this point, though. Prelim
version here:

http://music.columbia.edu/~brad/chuck-max-beta/beta_v0.7/

brad

http://music.columbia.edu/~brad

On Mon, 7 Aug 2006, Mike Sayre wrote:

>
> Hi all,
> I’ve been working on getting custom externals to work with Mingw.
> I’ve followed the instructions in the cygwinHowTo, and I get successful
> compilation, but I believe I’m having trouble with the cygwin1.dll. I
> have heard some people say that different versions of this DLL cause
> varying problems and crashes in Max (which I have been experiencing).
> Naturally, I have been trying to use -mno-cygwin to use only system
> libraries, and am getting successful compilations. However, I still get
> crashes, and using objdump on my MXE shows that some references to cygwin
> libraries still exist. One of you posted a link that said this is
> because the proper mingw libraries are not present, and that I must
> download these to make it work. I have looked a good deal, and I am not
> sure where I can get these libraries. They don’t seem to be available
> through the cygwin setup utility. Any ideas?
>
> Thanks,
> Mike
>


August 18, 2006 | 1:41 am

What’s odd is that my projects build just fine, but crash when Max tries to load them. Max just disappears, with no errors anywhere in the syslogs. I posted my code previously, and it was thoroughly debugged and they claimed it ran fine on a Mac. It’s really bare-bones anyway. This is my first C external, and so I’m just trying to get a working environment.
I am using -mno-cygwin at every stage. If I don’t use this and purposely use the cygwin dlls (for the sake of experimentation), then I get an application hang, once again with no errors. Any more suggestions?

Thanks


August 18, 2006 | 2:28 am

I’m not sure what’s up here. It sounds like the app thinks that you’re
trying to debug the external in the CP version of the app. Does it load
okay in Max Runtime?

Regardless, if you find that the mingw projects are giving you too much
problem developing, I’d recommend Microsoft’s free Visual C Express
compiler (or the for pay Visual Studio compiler).

-Joshua

——————————————————————–
mail2web – Check your email from the web at
http://mail2web.com/ .


August 19, 2006 | 10:22 pm

To correct myself…

Max doesn’t crash when I load through the menu, but crashes when I try to instantiate the object with an object box. I’m trying to build an MSP/GUI object, which I know is about as covoluted as externals get. Anybody have experiences with such problems?

And I have downloaded VS Express, but I’m trying to resist one more MS product as long as possible. Call me stubborn.

Thanks,
Mike


Viewing 6 posts - 1 through 6 (of 6 total)