Linking to C .LIB library files. - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: Linking to C .LIB library files. (/thread-7114.html) Pages:
1
2
|
Linking to C .LIB library files. - Dean - 04-29-2005 If you haven't already guessed by now, I'm C illiterate. My C co-workers have made me a C library that I want to link to in FB to try some functions that they wrote for me in C. They have generated .LIB files. All the examples I see of including libraries in FB are with .BI file extensions. They don't recognize those, and I'm not sure if I need to do something special to link to a .LIB file. So if they made a library called File64.LIB, what do I have to do to link to that library from FB? Dean Linking to C .LIB library files. - Antoni Gual - 04-29-2005 You have to name the lib as libmylib.a You have to translate the .h header file to a .bi FB. Then you must include the .bi file in your source and call fbc with the Code: -l mylib Linking to C .LIB library files. - Dean - 04-30-2005 So, this is what you're saying all that I have to do is?: 1. Rename FILE64.LIB as FILE64.a 2. Rename FILE64.h as FILE64.bi 3. Put an include line in the .bas program as: '$include: "FILE64.bi" 4. Then call FBC as FBC -l FILE64 Right? Linking to C .LIB library files. - DrV - 04-30-2005 libFILE64.a, not just FILE64.a. It's ancient UNIX ugliness. Linking to C .LIB library files. - fsw - 04-30-2005 Quote:2. Rename FILE64.h as FILE64.biWrong! Renaming the file will not help you. Quote:You have to translate the .h header file to a .bi FB.Translate means convert the c code to basic... struct -> type etc. Linking to C .LIB library files. - ShadowWolf - 04-30-2005 yo upload the lib package some ware and give a link somone here can translate the .h for ya most likely won't be all that complex. Linking to C .LIB library files. - v3cz0r - 04-30-2005 Post the header, i can translate it if it's simple enough.. not by hand, course.. i should release the .h to .bi translator, i didn't finish it yet though, there are some bugs.. Linking to C .LIB library files. - Dean - 04-30-2005 I will be posting a link in about an hour. This is what I've asked my guy here to do: Create 64bit functions for the following: OPEN64 CLOSE64 SEEK64 GET64 PUT64 For now, I've asked him just to deal with binary access. You guys can test this better than me, so I'll include the source, which is not very much -- this is as I understand it, just calling windows API calls and giving me functions that are Basic-like syntax. Dean Linking to C .LIB library files. - Dean - 04-30-2005 Here's the link to the files. http://www.cct.com/lib/file64.h http://www.cct.com/lib/file64.cpp http://www.cct.com/lib/file64.lib Hope this works. Dean Linking to C .LIB library files. - v3cz0r - 04-30-2005 There: Code: '' |