.dll Max nightmare...

Archives Forums/Win32 Discussion/.dll Max nightmare...

Brucey(Posted 2007) [#1]
I wonder if there's anyone out there who might be able to help?

I have a DLL (libapr.dll) with functions declared like _apr_array_make@12

For Max, I can simply create a extern like
Extern
  Function apr_array_make( ......) = "apr_array_make@12"
End Extern

However, I also have some C code that needs to call into the DLL, but when I compile an application, it complains that it can't find "apr_array_make":
(svn_c_stuff.c.debug.win32.x86.o)(.text+0x28e):svn_c_stuff.c: undefined reference to `apr_array_make'


Not sure what to do now...

I kind of need some C code, as I can't get parts working in Max-only, but the C can't seem to "find" the correct method in the .dll

As a side note, I created a .a of the dll using pexports and dlltool.

Anyone got any bright ideas please?

:o)


Azathoth(Posted 2007) [#2]
How are you calling the Dll function? Are you using a lib, GetProcAddress or something else?


skidracer(Posted 2007) [#3]
I wouldn't imagine C code could ever call c++, I would rename svn_c_stuff.c to .cpp and use extern "C" qualifiers for any declarations that do need to cross the divide.

If the dll in question is compiled vs c++ you unfortunately have the added problem of a large and solid brick wall.

Hmm, google suggests perhaps in this case more of a wooden fence?.


Brucey(Posted 2007) [#4]
Yeah, I've been down the wooden fence route, but that doesn't seem to make much of a difference.

I've now taken another route....

I have managed to compile the APR lib from source, but still have a couple of linking issues with it.

Strangely, it complains about CommandLineToArgvW, which I've found in libshell32. However, linking that into my app doesn't help.
Anyhoo, so I commented out the section in question, and it actually compiles the exe okay.

The app is able to start ok, but it nukes when I call "svn_config_get_config".... ho hum.

How might I go about tracing the run? gdb's backtrace isn't very helpful.

:-(


.. at least I'm persistent ;-)