Creating .LIB
I am creating my own 2D/3D game/appprogramming library, but i am having trouble with making my my library into functional .LIB files(s). The problem is that when I compile an example program/game that i have created to use my lib. then the compiler just tells me that it couldn''t find the external class functions i use (and yes, i have included my .lib in the project).
My header uses class __declspec(dllexport) CMyClass when compiling the lib and class __declspec(dllimport) CMyClass when compiling my exaple games using the lib. But it doesn''t work.
By the way... I am using Borland C++ 4 or something like that to do all this (under windows 95/98).
Please help...
Yeah... well, i didn''t remember which version it was and I didn''t want to spend too much time finding the correct verison number.
Are you making a dll or a lib file? dllexport/import should be only used when making a dll. try not using any __declspec''s in a standard lib file.
Then how do I make it so my classes are acessable when I compile with my .LIB included? I have tried "external "C"" on classes but it only works with regular functions for me?
If i''m on the wrong track then how do I get it working...
If i''m on the wrong track then how do I get it working...
Don''t use extern on it. extern "C" tells the linker that the function name was implemented in C rather than C++.
Actually, Don''t do anything to it. Just declare the class normally, include the header file in the project that uses the library, and make sure to link the library properly.
Actually, Don''t do anything to it. Just declare the class normally, include the header file in the project that uses the library, and make sure to link the library properly.
Then how do I make it work with my classes. I get compilation errors when trying to use the .lib I created sepretaly. How can I make this work? I did get it to work for like half a year ago, but I don''t remember anything about HOW I got it to work, and I don''t have any code left to find out from.
If you are getting compiler errors, then it''s not because of the lib. The lib should be used with the linker, not the compiler. As far as I know, lib files are just like obj files in how you use them. You must include any headers or class/function/extern declarations within your project in header files, and then the linker links in the lib file just like it links in all the obj files in your project.
------------------------------
Jonathan Little
invader@hushmail.com
http://www.crosswinds.net/~uselessknowledge
------------------------------
Jonathan Little
invader@hushmail.com
http://www.crosswinds.net/~uselessknowledge
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement