![]() |
|
|
#1 |
|
Oct 2003
58 Posts |
Hi,
I'm trying to build the source code for Prime95, and get the following build errors, repeatedly, but it's all caused by the same thing: c:\Documents and Settings\Jim\My Documents\GIMPS mersenne prime source code\source23\source\giants.c(1706): error C2668: 'sqrt' : ambiguous call to overloaded function c:\Documents and Settings\Jim\My Documents\GIMPS mersenne prime source code\source23\source\commonb.c(1056): error C2668: 'pow' : ambiguous call to overloaded function c:\Documents and Settings\Jim\My Documents\GIMPS mersenne prime source code\source23\source\commonb.c(1604): error C2668: 'log' : ambiguous call to overloaded function ... and so forth. These calls seem to be conflicting with functions in math.h I tried doing a #define sqrt std::sqrt but that didn't work. Can anyone help me out here, please? |
|
|
|
|
|
#2 |
|
Sep 2002
12268 Posts |
What compiler are you using ?
|
|
|
|
|
|
#3 |
|
Oct 2003
5 Posts |
I'm using M$ Visual Studio .NET 2003
If I knew from where these functions should be defined, I would add a namespace here_they_are { } but I don't
|
|
|
|
|
|
#4 |
|
Sep 2002
10112 Posts |
The errors have nothing to do with namespaces. Where did you get that idea?
VS.NET 2003 adds "int" and "float" specific math routines to the CRT (previous releases only had "double" versions). As a result, the compiler can't figure out which one you want. Resolution: build with VS.NET 2002 or fix the code yourself by casting the return values. Last fiddled with by Nebob on 2003-11-02 at 01:38 |
|
|
|
|
|
#5 |
|
Oct 2003
5 Posts |
I was able to get past that problem by adding some float casts.
But now I get a pile of errors like: Prime95 error LNK2005: "void __cdecl cdft(int,int,double *,int *,double *)" (?cdft@@YAXHHPANPAH0@Z) already defined in giants.obj Were you able to get the version that downloads from this site to compile in MS VS .NET 2002? |
|
|
|
|
|
#6 |
|
Oct 2003
5 Posts |
Any1? Any1? Can anybody build in VS .NET 2002? Prime95 said something about needing to compile the giants.c off by itself, and then linking to the .obj file. Has any1 been able to build this?
|
|
|
|
|
|
#7 |
|
Oct 2003
5 Posts |
Nebob: you had my problem pegged.
![]() I think that my link error was due to the fact that I didn't start over from an early enough point. I deleted my unzipped directory, and did these things: In stdafx.h, I added: #define SECURITY_WIN32 What should I have defined this as, and if it depends, on what does it depend? I added a ton of "double" casts, to sqrt, pow, and ceil. Am I correct in inferring that this should run correctly in version 23 from your earlier post? |
|
|
|
|
|
#8 |
|
Sep 2002
1110 Posts |
The security setting doesn't really make a difference, since the security code isn't in the public source distribution. You'll notice your build always comes up with a residue of 0. (I think? Been a while)
The server still accepts these results, so yeah, it should run fine. |
|
|
|
![]() |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| build with MSVC 2010 problem | Geek2600 | Msieve | 0 | 2018-02-12 13:37 |
| [Patch] CPU affinity prompt problem in mprime Linux / OS X build | Explorer09 | Software | 1 | 2017-03-01 02:34 |
| New build with ECC ram | PageFault | Hardware | 1 | 2012-08-23 03:44 |
| New build | PageFault | Hardware | 28 | 2011-09-19 07:15 |
| build problem on x86_64 | Prime95 | GMP-ECM | 21 | 2007-04-20 09:39 |