[nothing to do with GCC, dropping that from the list of NGs]

[EMAIL PROTECTED] wrote:
> Thus, I was thinking of using a shared object for that component.
> However, in the example below, I haven't figured out a way to modify
> commonClass.cpp (for example, the print() method) and be able to see
> the changes without rerunning  the application. I can see changes made
> directly in sharedClass.cpp, though. 

Let's see:

> commonClass.o: commonClass.cpp
>         g++ -Wall -c commonClass.cpp
> sharedClass.o: sharedClass.cpp commonClass.o
>         g++ -Wall -c sharedClass.cpp
> sharedClass.so: sharedClass.o
>         g++ sharedClass.o -shared -o sharedClass.so
> main.o: main.cpp
>         g++ -rdynamic -Wall -c main.cpp
> 
> main: main.o commonClass.o
>         g++ -rdynamic main.o commonClass.o -ldl -o main

commonClass is linked directly into the main executable, so there is no way
to change it at runtime. sharedClass is loaded dynamically, so it could be
replaced by another at runtime.

> Is there a way to see changes in commonClass.cpp without restarting 
> the application? 

No, unless you structure it like sharedClass, that is.

Uli


-- 
http://gcc.gnu.org/faq.html
http://parashift.com/c++-faq-lite/

_______________________________________________
Help-gplusplus mailing list
Help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to