¡@

Home 

c++ Programming Glossary: shared.h

C++ Shared Library with Templates: Undefined symbols error

http://stackoverflow.com/questions/1022623/c-shared-library-with-templates-undefined-symbols-error

I've condensed the problem to about 20 lines of code. shared.h template class Type class myclass Type x public myclass x 0.. myclass x 0 void setx Type y Type getx shared.cpp #include shared.h template class Type void myclass Type setx Type y x y template.. Type getx return x main.cpp #include iostream #include shared.h using namespace std int main int argc char argv myclass int..

problems with global variable shared between sourcefiles (I'm using include guards)

http://stackoverflow.com/questions/3485652/problems-with-global-variable-shared-between-sourcefiles-im-using-include-guar

I'm using include guards main.cpp #include cstdio #include shared.h int main shared_int 5 printVal return 0 shared.h #ifndef INCLUDE_GUARD_H.. #include shared.h int main shared_int 5 printVal return 0 shared.h #ifndef INCLUDE_GUARD_H #define INCLUDE_GUARD_H #include cstdio.. int printVal #endif shared.cpp #include cstdio #include shared.h int printVal fprintf stderr a d n shared_int return 0 I'm comping..