c++ - Bypass static linking order problems in gcc -


Static linking is important for the order GCC , and it creates many issues with static versions Generally, the configure script in libgd , LibreAvive , MySql connector, C, etc. means that we use shared libraries, And even if we set up a stable build, it still ignores that fact and the static library Does not in the wrong order, so it removes find error and makefile time to manually edit.

On the other hand, competitive compilers can create static libraries in any order, for example, Microsoft Visual C ++ does not have this problem, so it seems that to fix this problem There should be a way.

Is there any way to force the GCC to automatically perform static libraries like Visual C ++?

Wrap the list of libraries with flags -Wl, - start-group and During the link, -Wl, - end-group .

This flag ensures that all the mentioned symbols are seen in all the mentioned libraries (independent of order).


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -