|
[
Permlink
| « Hide
]
Farid Zaripov added a comment - 29/Nov/07 06:12 PM
Perhaps the another compilers may has the similar feature.
I don't know of any UNIX compiler that has a feature like this.
It seems like it might be worth looking into at least on Windows. ChangeLog:
The _autolink.h file is intended to be #included in _config.h, but since this feature is supported by only MSVC and ICC/Windows, it #included in _config-msvcrt.h. Is this change forward compatible?
Yes. This change doesn't affect the exported symbols or anything else. It's only add's the record in object files, compiled with using this change, to link these object files with libstdxx.lib.
If the new user takes advantage of the autolinking feature, they will have to modify their build system to get it to work with a previous version of the library. i.e. they will need to explicitly link the library file when they go back to 4.2.0.
Will this ever be useful for any compiler other than MSVC and ICC/Windows? Is there a way that we can ensure the user links the right library on all platforms? This wouldn't avoid the need to explicitly link the library, but it would eliminate issues with linking the wrong library. This issue is potentially forward incompatible. Since the priority of this issue is low, deferring to 4.3 release.
There is also the issue that we don't always know what the name of the library is going to be. The user may select a different name for the library (by changing the project file or possibly renaming the file directly). If this happens, then the autolink will cause the linker to look for a library file with the wrong name. In order to get it working again, they would need to #define _RWSTD_NO_EXT_AUTOLINK or modify _autolink.h. The problem is that they may spend hours trying to figure out where the reference to the library is coming from.
What real utility does this provide? The user still needs to set the library path so that the given library is found. Perhaps a better idea would be to add a blurb to the documentation telling the user about the option to use the #pragma in their code? The STLport and boost both are using this feature. This feature is useful when you make the library files for all build modes in the same directory (like STLport and boost does). Then you have to specify this path to the linker and linker itself select the proper library file.
Of course when you have library files for different build modes in their distinct directories and you have to specify the path of the concrete library for some build mode this feature is looking as redundant. I agree. I don't see this as useful for our users.
If we are really worried about them using libraries and headers from different configurations, we could generate a symbol name based on the configuration. The library would export the symbol and one of the library headers would import it. That way the executable won't link if the library and headers are from different configurations. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||