I'm writing a class that contains several template member functions (but it's not a template class). I know that because of this, I cannot do what I normally do, which is to write the class declaration in the header and define the functions in a separate translation unit (".cpp" file). Instead, I include the function definitions into the bottom of the header file. (I found this out after a long time of troubleshooting and finally a series of posts.)
Now, I'm trying to make a library out of this, so that it could be more easily distributed. How is the library linked into the executable with Borland 5.5? I tried "bcc32 driver.cpp mylib.lib", but I have unresolved references to the template functions. Is this for the same reason that I can't define the class separately from the header?
If this is the case, it seems like a major limitation that you cannot create libraries with template member functions...I'm guessing there must be another way.
Strangely, when I try to compile it first ( "bcc32 -c driver.cpp" ) and link it separately ("ilink32 driver.obj, driver.exe, ,mylib.lib,,"), the resulting executable does not run. It pops up an error saying that it is not a valid Win32 application. Any idea why that happens? TIA for any help.