This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/6665: Import library order does matter



>Number:         6665
>Category:       c
>Synopsis:       Import library order does matter
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed May 15 11:36:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     chorns@users.sourceforge.net
>Release:        Current CVS
>Organization:
>Environment:
Cross compile i386-mingw32msv from linux
>Description:
This has troubled me a couble of times before so I decided to make an example that illustrates the problem. If gcc builds an executable from a static library (or just a regular object file) that imports functions from a dynamic library, then gcc cannot resolve the imports from the import library if the import library is specified before the static library on the command line. E.g.

gcc -o myprogram.exe myprogram.o mydlibrary.a myslibrary.o

will not work, but 

gcc -o myprogram.exe myprogram.o myslibrary.o mydlibrary.a

will work.
>How-To-Repeat:
Run the attached example.
>Fix:
Put the import library last on the command line to gcc.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/gzip; name="libtest.tar.gz"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="libtest.tar.gz"

H4sIANWn4jwAA+1X32/aMBDmdf4rLHUPFDXF+T2t2sNWpqkSExOrtE3TNGWJYVGTuHIMpZr6v+8c
EjAQ4IXApvoTqu3c+c715bvcJfEvQXPRbTUIQhziuy6MBdbH+dx3fOJatk/MFjFNy7Zb2G3yUBUm
uQg4xi3OmNilt0/+nyIp458+5jDlAX+8DA/tg5iEeI6zNf6WZZfxN+GvB/q2R6wWJoc+SB2eefy7
HayGHhtY3ofAnS5CdCYoz/CUxREoRaXSz9EkC0XMsvb5FUKlMN8Uoj8Ib9v2hNCmY5pFhdtTX8mz
woL/wR0dxQltwsce/puW/DbM8z/8QM+0fJn/Nf+bxxmuIl9RH6Fev387GPTxGxzbrzwjjbPxg22l
+dSIkkQwlqAP19c10nEYIhQkyWv04mW7NHKODbkrC1KqJINLeCQFdLTyEJaGwSbifiIMeKjKAmkT
3IK9tNjMVCnDRqiuw6U2U9NMqZfX6OW/A06jNbvSk+pm1ew9Z2MepJXVahnWa9EZXdmj/nMrZ0To
DPcYzXHGBH5g/A7W2w2uGFGtKwZ37VfuZpsxeaAvcI58p6F636sxRGFCgwzeD57ijoxpMbJyhNsu
Z2BROlVeTfg46C9DA1jWf4vX9+A+9tZ/UlbWf+68/nMsT+f/Y6Aowxah31H+1VR4UP7FmQCWxllb
TgI+Di9wCIkUd+Ri+v1HVQXW7saYUzEBF2RZEapH0QVh81jyP/on+j/PJZL/LpSEmv9HQEG6qL7/
2974Aauf5uTvJcnHiv8z8wIXo1WOdjk68zSwyfZI938nRg3/oQw/rI99/Dcdf8l/X/Z/jkkczf9j
4GqjAau6wP7Nu+Hb4be1dgih918/DYa3n1FNYkCoxpyu3DU0NDQ0NDQ0NDQ0NDQ0NDROib8SJz9C
ACgAAA==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]