Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. Ok, so this is a hard problem to explain.
  2.  
  3. I'm trying to create a namespace that will be accessible from 2 places.
  4. 1) A script (could be multiple scripts at once)
  5. 2) The inner workings of the actual engine
  6.  
  7. Both of these things are all c++.
  8.  
  9. My attempt at this problem is to create a .h file as follows
  10. extern.h
  11.  
  12. #ifndef EXTERN_H
  13. #define EXTERN_H
  14.  
  15. namespace MyExtern{ int testME; }
  16.  
  17. #endif
  18.  
  19. I then include my extern.h multiple times within the inner-workings of the engine and within my scripts.
  20.  
  21. I'm confused on why I'm getting a multiple definition of `MyExtern::testME' error, within the inner-workings of the engine .cc files where i include this .h file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement