Page 1 of 1

Visual Studio C++ 2010, problem build new version.

PostPosted: Wed Apr 04, 2012 19:17
by Isith
Hello,
I have problem with build game using MS VS C++ 2010.
I got following errors :
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
content_cao.cpp(1089): error C2668: 'fabs' : ambiguous call to overloaded function
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(565): could be 'long double fabs(long double)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(517): or       'float fabs(float)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(118): or       'double fabs(double)'
          while trying to match the argument list '(bool)'
content_cao.cpp(937): error C2668: 'fabs' : ambiguous call to overloaded function
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(565): could be 'long double fabs(long double)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(517): or       'float fabs(float)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(118): or       'double fabs(double)'
          while trying to match the argument list '(bool)'

I building without openal, gettext.
Thanks for help ;)

PostPosted: Wed Apr 04, 2012 19:34
by Isith
Okay, i've fixied it to chanage to "double", but i have new problem, my compiled game does not loading chunks.
Can anyone help me to fix it ?
Image

PostPosted: Thu Apr 05, 2012 01:56
by jn
I see three trees, some stone, and some dirt; what am I supposed to see?

PostPosted: Thu Apr 05, 2012 07:23
by Isith
Game loading chunks but it are very slow like one chunk 5 minutes, digging block shows in debug after 2-3 min, is there any way to make it faster like Celeron builds ?

PostPosted: Thu Apr 05, 2012 09:55
by bgsmithjr
Sounds like a mod is lagging you.

PostPosted: Thu Apr 05, 2012 11:31
by Isith
I downloaded VS Proffesional and compiled in it, can lagging this ? "if(double(m_prop.automatic_rotate > 0.001)){" I ve chanaged fabs to double but i cant build. Here is my recompiled with sound in VS Pro 2010, still lags.
DL : http://www.sendspace.com/file/8e83ep

PostPosted: Thu Apr 05, 2012 13:15
by jn
fabs is function, double is a type, please undo this change it doesn't make sense (sorry). And fabs(m_prop.automatic_rotate > 0.001) doesn't make much sense either: You check if m_prop.automatic_rotate is greater than 0.001, the result is a bool (a truth value, true or false), and then you try to cast this bool back into a floating point type, which should not make sense. You probably meant to write something like this (note the parentheses):
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if(fabs(m_prop.automatic_rotate) > 0.001)

This line now checks whether m_prop.automatic_rotate is less than -0.001 or greater than 0.001.

(In this post "you" can refer to either you, Isith; the programmer who wrote the code we're taking about; or anyone else who's interested in this discussion. C++ is hard, it took me quite some time and at least one book to learn it)

PostPosted: Thu Apr 05, 2012 13:33
by Isith
But if i undo this chanage, VS have errors in math.h.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
content_cao.cpp(937): error C2668: 'fabs' : ambiguous call to overloaded function
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(565): could be 'long double fabs(long double)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(517): or       'float fabs(float)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(118): or       'double fabs(double)'
          while trying to match the argument list '(bool)'
content_cao.cpp(1089): error C2668: 'fabs' : ambiguous call to overloaded function
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(565): could be 'long double fabs(long double)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(517): or       'float fabs(float)'
          C:\Program Files\Microsoft Visual Studio 10.0\VC\include\math.h(118): or       'double fabs(double)'
          while trying to match the argument list '(bool)'

And i can't fix it, only double helped to compile code.
Any fix for fabs in VS ?

PostPosted: Thu Apr 05, 2012 13:59
by jn
Where can I find the source code you're trying to compile?

PostPosted: Thu Apr 05, 2012 14:02
by Isith
ZIP package from Github

PostPosted: Thu Apr 05, 2012 14:08
by jn
This problem should be fixed in a newer version, and there are pre-compiled packages on github now.

PostPosted: Sun Apr 08, 2012 08:49
by Isith
Ok, now all build fine, but still is so slow, any fix ?

PostPosted: Mon Apr 09, 2012 10:45
by Isith

PostPosted: Mon Apr 09, 2012 11:25
by Jordach
You have slow PC:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
12:43:58: INFO[ServerThread]: WARNING: active block modifiers took 2825ms (longer than 200ms)

PostPosted: Mon Apr 09, 2012 11:35
by Isith
But it's only on my build, Celeron builds works very fast.
What im doing wrong ?

PostPosted: Mon Apr 09, 2012 11:40
by Jordach
Nothing, it just could be something else, maybe a configuration with CMAKE, I've tried compiling and it is really slow, I just think celeron does his builds right, and, if you need latest Windows builds, ask Sfan5: http://minetest.net/forum/viewtopic.php?id=1523

PostPosted: Mon Apr 09, 2012 11:54
by Isith
Okay, thanks, i will try to build it with GCC on Linux.

PostPosted: Mon Apr 09, 2012 11:59
by Jordach
Use buildbot.sh remember to have these two files in the buildbot.sh directory openal_stripped.zip and mingwm.dll

Download them here: http://c55.me/~celeron55/random/2012-04/