| |
| Posted by Denis R | PermalinkReply |
|
Denis R
| Hey, I have to ask again. This is in connection to my previous post on compiling and linking. I'm still not convinced about me making errors in my makefile setup.
So please check this:
If you check in my previous post, the method 2 of compiling modules (which I would like) doest work, but method 1 does. However, they seem to produce different symbol tables, which to me is surprising, and explains why i get linking error.
Below is the output of the nm on the util/dutil.o module after its been compiled with method 1, followed after its been compiled with
(not-working) method2:
method 1
-----------------------------------------
00000000 D _Class_4util5dutil9ListError
U _Class_6object5Error
00000000 T _D4util5dutil12newListErrorFAaZv
00000000 T _D4util5dutil5htonlFkZk
00000000 T _D4util5dutil5htonsFtZt
00000000 T _D4util5dutil5ntohlFkZk
00000000 T _D4util5dutil5ntohsFtZt
00000000 T _D4util5dutil9ListError5_ctorFAaZC4util5dutil9ListError
U _D6object5Error5_ctorFAaZC6object5Error
U _D6object6Object5opCmpFC6ObjectZi
U _D6object6Object6toHashFZk
U _D6object6Object8opEqualsFC6ObjectZi
U _D6object9Exception5printFZv
U _D6object9Exception8toStringFZAa
U _Dmodule_ref
0000003c D _ModuleInfo_4util5dutil <---- Not defined on method 2
00000010 r _TMP246
00000000 T _array_4util5dutil
00000000 T _assert_4util5dutil
U _d_array_bounds
U _d_arraycat
U _d_assert
U _d_newclass
U _d_throw@4
00000018 R _init_4util5dutil9ListError
00000038 R _vtbl_4util5dutil9ListError
U _vtbl_9ClassInfo
00000000 t gcc2_compiled.
------------------------------------------
method 2
------------------------------------------
00000000 D _Class_4util5dutil9ListError
U _Class_6object5Error
00000000 T _D4util5dutil12newListErrorFAaZv
00000000 T _D4util5dutil5htonlFkZk
00000000 T _D4util5dutil5htonsFtZt
00000000 T _D4util5dutil5ntohlFkZk
00000000 T _D4util5dutil5ntohsFtZt
00000000 T _D4util5dutil9ListError5_ctorFAaZC4util5dutil9ListError
U _D6object5Error5_ctorFAaZC6object5Error
U _D6object6Object5opCmpFC6ObjectZi
U _D6object6Object6toHashFZk
U _D6object6Object8opEqualsFC6ObjectZi
U _D6object9Exception5printFZv
U _D6object9Exception8toStringFZAa
00000010 r _TMP0
00000060 r _TMP2
00000000 T _array_4util5dutil
00000000 T _assert_4util5dutil
U _d_array_bounds
U _d_arraycat
U _d_assert
U _d_newclass
U _d_throw@4
00000018 R _init_4util5dutil9ListError
00000038 R _vtbl_4util5dutil9ListError
U _vtbl_9ClassInfo
00000000 t gcc2_compiled.
------------------------------------------
So you can see, D _ModuleInfo_4util5dutil is not defined for method2, and so i get my linker error. So, err, since the src files are exactly same in both methods of compilation, why is that ?
Anyone explain this to me, please :)
|