Bassmod wrapper.

Member
Posts: 20
Joined: 2010.09
Post: #1
Hey all,

I'm trying to write a bassmod wrapper. Challenges include passing arguments to it, as GM only passes real (I'm guessing it's double) and string arguments.

My 'test' bassmod app works perfectly, but the exact same code in a dylib doesn't... why?

Source attached.

http://www.filedropper.com/slimemod

Thanks. Rasp
Quote this message in a reply
⌘-R in Chief
Posts: 1,248
Joined: 2002.05
Post: #2
Could you explain what the actual problem is? Full errors etc
Quote this message in a reply
Member
Posts: 20
Joined: 2010.09
Post: #3
Mainly... that when I actually try and test within Game Maker... nothing happens. No errors, but no activity either. Rasp

EDIT: Did you download the source? I'm still quite the newb when it comes to C, so something that I may have no clue about may be spotted by someone like you (with more experience) in a flash.
Quote this message in a reply
Member
Posts: 20
Joined: 2010.09
Post: #4
I know it's a bit of an odd question, but I've been trying to write a bassmod wrapper. A dylib that acts as an interface between bassmod (another dylib) and Game Maker.

I tested bassmod by writing a simple executable. I then proceeded to write my bridge dylib, but I found out the code didn't work. My original plea for help may be found here.

Therefore, I need to hunt for that bug. My idea is that the dylib is failing to start bassmod due to some functionality I'm not aware of, or something. The question is: how do I call a dylib from another dylib? I know that in executables it's simply a matter of dragging the library to XCode and it's linked automagically, but it doesn't seem to be the case with dylibs.

Any help is appreciated. Smile
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #5
Quite seriously, I'm guessing that most people that know how to help you saw that you posted the code on a file hosting site. I got as far as the captcha when you posted it originally.

I did download it now, but it builds just fine. Attempting to run it requires GameMaker. You are the first Mac developer I've ever heard of that has used it. Finding people who know how to extend GameMaker is going to be very difficult.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #6
dylibs can call other dylibs just fine. If there was a problem with loading it it should have had a nasty crash.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 20
Joined: 2010.09
Post: #7
(Jun 7, 2011 11:55 PM)Skorche Wrote:  dylibs can call other dylibs just fine. If there was a problem with loading it it should have had a nasty crash.

That's really odd. Then why is not loading? Directory conflict?


Ugh.


EDIT: I've built other extensions for Mac, this is the first time I attempt the two-dylib combo, however.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #8
From what I remember from writting Ruby extensions, when dynamically loading an extension it would either work or get a nasty crash because the freshly loaded lib couldn't find other dynamic symbols that it needed.

Presumably both that and GameMaker are using the dlopen API. Does your code not even run at all? Have you tried putting in logging statements?

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Member
Posts: 20
Joined: 2010.09
Post: #9
Yes, the code doesn't run at all. There should be console output... the problem is nothing happens. Sad
Quote this message in a reply
Post Reply