___mingw_vfprintf question

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

___mingw_vfprintf question

chrs7777
I am getting this error message from my Eiffel compiler:

C Compiler Error: Error LNK2019: unresolved external symbol
___mingw_vfprintf referenced in function _fprintf libgmp.a

I attempted a web search and found lots of references to this problem but no
solutions.  The Eiffel compiler uses the Microsoft compiler that comes with
the Windows 7 SDK v7.1 (I'm just including this information in case it is
helpful).  I used MSYS to build libgmp.a.

Does anyone know of a resolution for this?

Regards
Chris Saunders


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ___mingw_vfprintf question

Keith Marshall
On Friday 20 August 2010 21:01:06 Chris Saunders wrote:
> I am getting this error message from my Eiffel compiler:
>
> C Compiler Error: Error LNK2019: unresolved external symbol
> ___mingw_vfprintf referenced in function _fprintf libgmp.a

The reference requires linking with libmingwex.a; since you aren't
linking in a MinGW aware environment, this isn't automatically included
in the list of standard libraries to be deployed.

> I attempted a web search and found lots of references to this problem
> but no solutions.  The Eiffel compiler uses the Microsoft compiler
> that comes with the Windows 7 SDK v7.1 (I'm just including this
> information in case it is helpful).  I used MSYS to build libgmp.a.

I don't know for sure, but I'll offer an educated guess as to why this
might happen.  You've built your libgmp.a with a MinGW compiler, (which
*does* know to use libmingwex.a).  On its own, that doesn't induce any
reference to the MinGW extended printf subsystem, (which provides much
better ANSI C conformance than the standard Microsoft implementation).  
However, if any object module within libgmp.a is built with the -ansi
or -posix option, (or any other option which implies __STRICT_ANSI__,
or any of the other conformance states identified in _mingw.h), *and*
that module refers to any of the printf functions, then that reference
implicitly requires libmingwex.a's implementation of printf.

> Does anyone know of a resolution for this?

The simplest option is probably just to link with libmingwex.a; if you
don't like that idea, then you will need to rebuild libgmp.a, with the
references to libmingwex.a's printf subsystem explicitly suppressed.
(To achieve that, you must explicitly define __USE_MINGW_ANSI_STDIO to
have a value of zero, *before* any system header is included by the
source; adding -D__USE_MINGW_ANSI_STDIO=0 to CPPFLAGS should suffice).

--
HTH, Keith.

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ___mingw_vfprintf question

chrs7777
First, thanks for the response Keith.  What I first tried is to add
libmingwex.a to the libraries that my Eiffel compiler uses on this project.
I got  a different set of errors with this.  I thought I my try your other
option - rebuilding libgmp.a.  I should first tell you that I understand
fairly little about the build process for GMP(5.0.1) and do not really
understand what you said in the last paragraph of your message.  Could you
forgive my ignorance and give me help in understanding that paragraph.  I
use MSYS to build GMP and assume that I would need to pass some arguments to
configure.

Regards
Chris Saunders

--------------------------------------------------
From: "Keith Marshall" <[hidden email]>
Sent: Friday, August 20, 2010 5:55 PM
To: <[hidden email]>
Subject: Re: [Mingw-users] ___mingw_vfprintf question

> On Friday 20 August 2010 21:01:06 Chris Saunders wrote:
>> I am getting this error message from my Eiffel compiler:
>>
>> C Compiler Error: Error LNK2019: unresolved external symbol
>> ___mingw_vfprintf referenced in function _fprintf libgmp.a
>
> The reference requires linking with libmingwex.a; since you aren't
> linking in a MinGW aware environment, this isn't automatically included
> in the list of standard libraries to be deployed.
>
>> I attempted a web search and found lots of references to this problem
>> but no solutions.  The Eiffel compiler uses the Microsoft compiler
>> that comes with the Windows 7 SDK v7.1 (I'm just including this
>> information in case it is helpful).  I used MSYS to build libgmp.a.
>
> I don't know for sure, but I'll offer an educated guess as to why this
> might happen.  You've built your libgmp.a with a MinGW compiler, (which
> *does* know to use libmingwex.a).  On its own, that doesn't induce any
> reference to the MinGW extended printf subsystem, (which provides much
> better ANSI C conformance than the standard Microsoft implementation).
> However, if any object module within libgmp.a is built with the -ansi
> or -posix option, (or any other option which implies __STRICT_ANSI__,
> or any of the other conformance states identified in _mingw.h), *and*
> that module refers to any of the printf functions, then that reference
> implicitly requires libmingwex.a's implementation of printf.
>
>> Does anyone know of a resolution for this?
>
> The simplest option is probably just to link with libmingwex.a; if you
> don't like that idea, then you will need to rebuild libgmp.a, with the
> references to libmingwex.a's printf subsystem explicitly suppressed.
> (To achieve that, you must explicitly define __USE_MINGW_ANSI_STDIO to
> have a value of zero, *before* any system header is included by the
> source; adding -D__USE_MINGW_ANSI_STDIO=0 to CPPFLAGS should suffice).
>
> --
> HTH, Keith.
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list
> etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users 


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ___mingw_vfprintf question

Keith Marshall
On Saturday 21 August 2010 00:28:25 Chris Saunders wrote:
> I should first tell you that I understand
> fairly little about the build process for GMP(5.0.1) and do not
> really understand what you said in the last paragraph of your
> message.  Could you forgive my ignorance and give me help in
> understanding that paragraph.

Which was that, then?  I can't see it, because you top-posted.  (Do so
again, and I'm sorry, but it's end of dialogue).

> I use MSYS to build GMP and assume
> that I would need to pass some arguments to configure.

  configure CPPFLAGS='-D__USE_MINGW_ANSI_STDIO=0' ...

where the ellipsis indicates any other arguments you wish/need to pass
to configure.  If you need other defines in CPPFLAGS, add them within
the single quotes, separated by spaces

  configure CPPFLAGS='-D__USE_MINGW_ANSI_STDIO=0 ...' ...

--
Regards,
Keith.

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ___mingw_vfprintf question

chrs7777
Interesting - I almost always top post and this is the first time I have
seen an objection to this from this mailing list.  I have seen posters on
various mailing lists who don't use any capital letters.  This drives me
nuts but I never comment on this or refuse to communicate  with such a
person - I accept that others may have a different idea about what is
correct and I am not the "no capital letters police".  I personally dislike
bottom posting.

I wish to thank you anyway for your effort and I believe your response
(which appears below) gave me enough. to resolve my problem.  I hope you
don't regret this.

Regards and thank you
Chris Saunders

--------------------------------------------------
From: "Keith Marshall" <[hidden email]>
Sent: Saturday, August 21, 2010 4:47 AM
To: <[hidden email]>
Subject: Re: [Mingw-users] ___mingw_vfprintf question

> On Saturday 21 August 2010 00:28:25 Chris Saunders wrote:
>> I should first tell you that I understand
>> fairly little about the build process for GMP(5.0.1) and do not
>> really understand what you said in the last paragraph of your
>> message.  Could you forgive my ignorance and give me help in
>> understanding that paragraph.
>
> Which was that, then?  I can't see it, because you top-posted.  (Do so
> again, and I'm sorry, but it's end of dialogue).
>
>> I use MSYS to build GMP and assume
>> that I would need to pass some arguments to configure.
>
>  configure CPPFLAGS='-D__USE_MINGW_ANSI_STDIO=0' ...
>
> where the ellipsis indicates any other arguments you wish/need to pass
> to configure.  If you need other defines in CPPFLAGS, add them within
> the single quotes, separated by spaces
>
>  configure CPPFLAGS='-D__USE_MINGW_ANSI_STDIO=0 ...' ...
>
> --
> Regards,
> Keith.
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by
>
> Make an app they can't live without
> Enter the BlackBerry Developer Challenge
> http://p.sf.net/sfu/RIM-dev2dev
> _______________________________________________
> MinGW-users mailing list
> [hidden email]
>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list
> etiquette may cause your account to be moderated.
>
> _______________________________________________
> You may change your MinGW Account Options or unsubscribe at:
> https://lists.sourceforge.net/lists/listinfo/mingw-users 


------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ___mingw_vfprintf question

Keith Marshall
[Off topic]
On Saturday 21 August 2010 18:17:04 Chris Saunders wrote:
> Interesting - I almost always top post

Then you won't be seeing me participate in many of your discussions.
I will always do my best to be helpful, but I don't have the time to
waste on reading dialogue backwards to establish context.

> and this is the first time I
> have seen an objection to this from this mailing list.

You surprise me; it is generally frowned on here, (and on pretty much
every other technically oriented list in which I participate).  I'm not
going to block your posts, (as one other moderator has threatened to do
in the past), but I will not participate in a top-posted dialogue.

> I personally dislike bottom posting.

So do I, and it's every bit as inappropriate for technical discussion as
is top-posting -- the only logical format is the in-line point-by-point
rebuttal you see here.  Frankly, I consider it a sign of gross laziness,
when you can't be bothered to adopt this format.

--
Regards,
Keith

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Reply | Threaded
Open this post in threaded view
|

Re: ___mingw_vfprintf question

Earnie Boyd
In reply to this post by chrs7777
Chris Saunders wrote:
> Interesting - I almost always top post and this is the first time I have
> seen an objection to this from this mailing list.

It just so happens that we discourage it with every mail that is sent
from the list.

>
> This list observes the Etiquette found at
> http://www.mingw.org/Mailing_Lists.
> We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.
>

--
Earnie
-- http://www.for-my-kids.com

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
MinGW-users mailing list
[hidden email]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users