• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

Q for SmallGod - g++ and templates

I need to know how to compile templates using g++ under UNIX.  The program compiles ok using cxx, but when using g++, results in "Unresolved" errors for all the template classes. Is there some precompile directive or command line switches I can use to get past this?

                  Thanks in advance
1 Solution
Place the template declaration and definition in a .h file.
Include the template's .h file in any file that uses the template.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now