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

Post Reply
Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

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

by Isith » Post

Hello,
I have problem with build game using MS VS C++ 2010.
I got following errors :

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 ;)

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

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

jn
Member
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Post

I see three trees, some stone, and some dirt; what am I supposed to see?

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

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 ?

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

Sounds like a mod is lagging you.

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

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
Last edited by Isith on Thu Apr 05, 2012 11:31, edited 1 time in total.

jn
Member
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Post

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):

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)

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

But if i undo this chanage, VS have errors in math.h.

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 ?
Last edited by Isith on Thu Apr 05, 2012 13:33, edited 1 time in total.

jn
Member
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Post

Where can I find the source code you're trying to compile?

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

ZIP package from Github

jn
Member
Posts: 106
Joined: Tue Jan 03, 2012 19:15

by jn » Post

This problem should be fixed in a newer version, and there are pre-compiled packages on github now.

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

Ok, now all build fine, but still is so slow, any fix ?

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post


Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

You have slow PC:

Code: Select all

12:43:58: INFO[ServerThread]: WARNING: active block modifiers took 2825ms (longer than 200ms)

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

But it's only on my build, Celeron builds works very fast.
What im doing wrong ?

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

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

Isith
Member
Posts: 10
Joined: Wed Apr 04, 2012 19:14

by Isith » Post

Okay, thanks, i will try to build it with GCC on Linux.

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

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/

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests