How do you access Definitions in precompiled .lids

BlitzMax Forums/BlitzMax Programming/How do you access Definitions in precompiled .lids

H&K(Posted 2007) [#1]
(Yes it should be libs)

I have all the declerations, but the definitions are inside precomplied .libs

When I follow Skids tutorial Bmax cannot find the definitions. Ive tried putting them (the libs), in the program folder and in Bmax lib folder. With no joy.

I have noticed that in the lid dir they are all(ish) .a files. Do I need to convert the libs to .a? if so How. If not is there any other way.

Thanks


skidracer(Posted 2007) [#2]
Apparently in some situations you can rename .lib files as .a and MingW/BlitzMax will be able to link. There is also a tool in mingw/bin that will so some sort of conversion from lib to a. I wouldn't advise either myself.

Do I need to make the tutorial a little more clear - the .cpp file is meant to be created in same folder as the .bmx. From maxide go new file, save as .cpp, paste code from tutorial, save again, go to .bmx file, build and run...


Gabriel(Posted 2007) [#3]
Depends if they're exporting plain functions or some kind of class hierarchy. If it's the former, you can generate your own .a with the GCC utils or usually manage without too.

If it's a class hierarchy, you probably can't do it.


H&K(Posted 2007) [#4]
Do I need to make the tutorial a little more clear - the .cpp file is meant to be created in same folder as the .bmx. From maxide go new file, save as .cpp, paste code from tutorial, save again, go to .bmx file, build and run
No, your tutorial is working on the assumtion that you have access to/are writting both the decleration and definition of the functions.
What I was trying to use it for was a situation were I had the declerations, but the actual definitions were precompiled. So if I follow your tut, I get the "Unable to find definition" error
Apart from the fact I was tring to use your example to do a different thing, its a good tutorial.
(The .c or .cpp problem, was just cos I was being lazy, and didnt think Bmax that clever)

@Gab,
I dont think That there is any class hierarchy, as the presenation is only fucntions.
or "usually manage without too" how?


H&K(Posted 2007) [#5]
I have a commertial product that works in VC8 Express.
The product is the declerations of "Functions"
The definitions of these functions are precompiled and no sorce is available


Gabriel(Posted 2007) [#6]
usually manage without would be with GetProcAddress or whatever it's called. Check Halo's Newton wrapper for an example.


Brucey(Posted 2007) [#7]
There is also a tool in mingw/bin that will so some sort of conversion from lib to a. I wouldn't advise either myself.

Works well for me.
If you have a .lib to begin with, you run it through a program to get a .def
With a .def, you run it through another program to get a .a, to which you can link to in Max.

Depending on how the definitions are described (with @num for MSVC), you might have to Extern "win32".

In my notes for my MySQL database driver, I include this:
reimp -d libmysql.lib
dlltool -k -d libmysql.def -l libmysql.a

so I don't for get how to get from one to the other. :-)


No idea what all that GetProcAddress is all about. Seems messy to me. What's it for? Why do you need it?