templated functions & libraries

Home Forums C Programming templated functions & libraries

This topic contains 0 replies, has 1 voice, and was last updated by  nikunj2512 10 years, 11 months ago.

  • Author
    Posts
  • #1957

    nikunj2512
    Member

    I created a templated func that works just fine when placed in a .H file or .CPP file, but when I place it in a .LIB file (and include the function prototype in the file using it) it won’t work.
    For example:

    and  template void f(T var);  for the prototype.
    But I get an error saying that the external function is undefined, or something like that (basically that it can’t access the function in the library).

    I am using Borland C++BuilderX, which is a suite (not sure which version compiler) and I have gotten other functions to work w/ .libs and templated funcs to work while not in a .lib. How might I fix this problem?

    Matthew Todd

You must be logged in to reply to this topic.

0 Shares
Share
+1
Tweet
Share
Stumble