Fwd: Fw: Compilation on Windows

66 views
Skip to first unread message

Bill Hart

unread,
Dec 29, 2015, 7:59:43 AM12/29/15
to mpir-devel

---------- Forwarded message ----------


--- On Mon, 12/28/15, Rafael Guglielmetti <rafael.gu...@unifr.ch> wrote:

> From: Rafael Guglielmetti <rafael.gu...@unifr.ch>
> Subject: Compilation on Windows
> To: har...@yahoo.com
> Date: Monday, December 28, 2015, 10:22 AM
> Dear MPIR team,
> First, thank you four the project, it will be of great help
> since using
> gmplib on Windows is quite complicated.
>
> I successfully built the lib_mpir_cxx, dll_mpir_gc projects
> on Windows
> with the files you give (MPIR 2.7.2). My configuration is
> the following:
> * Visual Studio 2013 Community
> * Windows 7 x64
> * Solution file used: build.vc12\
>
> However, when I tried to add the files to another project
> (either my
> working project or a blank project), I get a few errors
> during the
> compilation with the file "mpirxx.h".
> The error is the following:
> Error    1    error C4146: unary minus
> operator applied to unsigned
> type, result still unsigned (main.cpp)   
> C:\mpir\mpirxx.h    121
>
> There is the same errors in the lines:
> 167, 218, 291, 335, 343, 380, 427, 434, 462, 547, 595, 631,
> 699, 744,
> 786, 796
>
> I don't know if some configuration in the MSVC file you give
> prevent
> these errors?
>
> Finally, I found this old build:
> https://www.dropbox.com/s/dl5eufzws9govns/mpfr_mpir_x86_x64_msvc2010_001.zip
> With this one, I have no error during the compilation.
>
> Do you have any idea where the problem comes from?
> If you need any more information, please let me know.
>
> Thanks.
>
> Best,
>
> Rafaeel
>

Brian Gladman

unread,
Dec 29, 2015, 9:31:53 AM12/29/15
to mpir-...@googlegroups.com
On 29/12/2015 12:59, 'Bill Hart' via mpir-devel wrote:
>
> ---------- Forwarded message ----------
>
>
> --- On Mon, 12/28/15, Rafael Guglielmetti <rafael.gu...@unifr.ch
I would expect these to be treated as warnings rather than errors - have
you enabled the 'treat warnings as errors' compiler option in your projects?

Brian

Rafael Guglielmetti

unread,
Dec 30, 2015, 5:54:21 AM12/30/15
to mpir-devel
Nop, it is disabled. I also tried to disable all warnings but it does not solve the problem.

Brian Gladman

unread,
Dec 30, 2015, 6:41:59 AM12/30/15
to mpir-...@googlegroups.com
On 30/12/2015 09:29, Rafael Guglielmetti wrote:

[snip]>>>> There is the same errors in the lines:
>>>> 167, 218, 291, 335, 343, 380, 427, 434, 462, 547, 595, 631,
>>>> 699, 744,
>>>> 786, 796
>>
>> I would expect these to be treated as warnings rather than errors - have
>> you enabled the 'treat warnings as errors' compiler option in your projects?
>>
>> Brian
>
> Nop, it is disabled. I also tried to disable all warnings but it does not solve the problem.

Thanks for checking this. All the errors are the result of this bit of
code:

-static_cast<mpir_ui>(l)

giving:

error C4146: unary minus operator applied to unsigned type, result
still unsigned (main.cpp)

I am no expert on C++ so I am hoping that someone on this list might be
able to see why this fails.

Brian

Jean-Pierre Flori

unread,
Dec 30, 2015, 7:41:26 AM12/30/15
to mpir-devel
Not clear why this is treated as an error...
Should be a warning as here:
https://msdn.microsoft.com/fr-fr/library/4kh09110.aspx
(in French sorry!)

Jean-Pierre Flori

unread,
Dec 30, 2015, 7:44:16 AM12/30/15
to mpir-devel
Workarounds might be:
* keep "-" and use mpir_si if possible;
* change "- l" by "(~ l) + 1"

Rafael Guglielmetti

unread,
Dec 30, 2015, 7:44:31 AM12/30/15
to mpir-...@googlegroups.com
Not a problem, my French is better than my English :)
I will have a look and try to compare the properties of the two solutions in MVC++. I will come back if I will find something.

Le 30. 12. 15 13:41, Jean-Pierre Flori a écrit :
--
You received this message because you are subscribed to a topic in the Google Groups "mpir-devel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mpir-devel/CRC2YvqV1xc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mpir-devel+...@googlegroups.com.
To post to this group, send email to mpir-...@googlegroups.com.
Visit this group at https://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Rafael Guglielmetti

unread,
Dec 30, 2015, 11:38:20 AM12/30/15
to mpir-...@googlegroups.com
I found the error.
In the properties: Configuration Properties > C/C++ > General
Set "SDL checks" to "No".
Reply all
Reply to author
Forward
0 new messages