Thread: Sharing an object between separate modules

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User sonnichs's Avatar
    Join Date
    Jul 2011
    Posts
    30

    Sharing an object between separate modules

    I have compiled (with g++) and run the code "combined.cpp". It consists of the class LIBS, main and funct_correlation. A LIBS object is created as "L". Then main invokes L.getHABlib. funct_correlation then does the same.

    Now I want to separate the code into the 2 pieces shown.(separate1.cpp,separate2.cpp) This does not compile-the function "correlation" cannot "see" the "L" object. Functionally I would think this code is the same as the above but I clearly am missing something to tie them together (the gnu linker does not).

    Any help appreciated
    Fritz
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. modules help
    By Krista Koeplin in forum C++ Programming
    Replies: 5
    Last Post: 02-20-2016, 03:00 PM
  2. Modules
    By qwes3r in forum C Programming
    Replies: 9
    Last Post: 03-27-2015, 09:51 PM
  3. Help with modules
    By Jacob Boyd in forum C++ Programming
    Replies: 3
    Last Post: 10-23-2012, 10:08 AM
  4. Replies: 3
    Last Post: 11-22-2011, 04:06 AM
  5. Modules
    By Hakim in forum C++ Programming
    Replies: 2
    Last Post: 04-22-2006, 04:53 PM

Tags for this Thread