Latest Posts

Topic: Debugging Widelands on Windows

abtools

Topic Opener
Joined: 2010-01-08, 16:31
Posts: 31
Ranking
Pry about Widelands
Location: Munich
Posted at: 2012-06-06, 23:51

Hello,

I'm not sure if that's the right place for asking a development related question, but I didn't want to add an issue to Launchpad as I'm not sure if I perhaps just have a configuration mistake on my side.

To find the reason for a bug I needed to run Widelands in the Visual Studio 2008 debugger. After fighting with some CMake issue I finally got it to work there, but still have one problem: I constantly (especially when clicking on buttons inside the game) get messages that a debug assertion has failed.

They're always looking similar to this:

Debug Assertion Failed!
Program: C:\widelands\build\src\Debug\widelands.exe
File: f:\dd\vctools\crt_bld\self_x86\crt\src\dbgheap.c
Line: 1317
Expression: _CrtIsValidHeapPointer(pUserData)

When I click on "Ignore" and go on with debugging this message pops are 5-10 more times with similar text. After all of them are ignored the game goes on just as normal till the next time which is really bothersome.

Does anymore has an idea what the problem might be?

Best regards and thanks for any tip

Andreas


Top Quote
abtools

Topic Opener
Joined: 2010-01-08, 16:31
Posts: 31
Ranking
Pry about Widelands
Location: Munich
Posted at: 2012-06-07, 16:06

Hello again,

the problem above occurs with Visual Studio 2008. Therefore I thought I give it a try with Visual Studio 2010 now. But here I don't get it to compile at all.

I could fix 6 of the compile errors

Fehler  2   error C2039: 'inserter': Ist kein Element von 'std' C:\widelands\widelands\src\io\filesystem\filesystem.cc  251 1   widelands_all
Fehler  4   error C2039: 'inserter': Ist kein Element von 'std' C:\widelands\widelands\src\io\filesystem\filesystem.cc  259 1   widelands_all
Fehler  6   error C2039: 'inserter': Ist kein Element von 'std' C:\widelands\widelands\src\io\filesystem\filesystem.cc  264 1   widelands_all
Fehler  3   error C3861: "inserter": Bezeichner wurde nicht gefunden.   C:\widelands\widelands\src\io\filesystem\filesystem.cc  251 1   widelands_all
Fehler  5   error C3861: "inserter": Bezeichner wurde nicht gefunden.   C:\widelands\widelands\src\io\filesystem\filesystem.cc  259 1   widelands_all
Fehler  7   error C3861: "inserter": Bezeichner wurde nicht gefunden.   C:\widelands\widelands\src\io\filesystem\filesystem.cc  264 1   widelands_all

myself by adding

#include <iterator>

on the top of the file "filesystem.cs". I guess this was just missing (http://msdn.microsoft.com/en-us/library/bb531344.aspx: "The <iterator> header is no longer included automatically by many other header files. Instead, include that header explicitly if you require support for the standalone iterators defined in the <interator> header.").

But I have no idea what's the reason for the remaining 14 compile errors:

Fehler  9   error C2039: 'difference_type': Ist kein Element von 'Overlay_Manager::Registered_Overlays' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1544    1   widelands_all
Fehler  13  error C2039: 'size_type': Ist kein Element von 'Overlay_Manager::Registered_Overlays'   c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1550    1   widelands_all
Fehler  17  error C2061: Syntax    Fehler: Bezeichner '_Sizet'  c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1558    1   widelands_all
Fehler  18  error C2061: Syntax    Fehler: Bezeichner '_Sizet'  c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1565    1   widelands_all
Fehler  11  error C2065: 'difference_type': nichtdeklarierter Bezeichner    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1544    1   widelands_all
Fehler  10  error C2146: Syntax    Fehler: Fehlendes ',' vor Bezeichner 'difference_type'   c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1544    1   widelands_all
Fehler  19  error C2146: Syntax    Fehler: Fehlendes ';' vor Bezeichner '_Myoff'    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1582    1   widelands_all
Fehler  14  error C2146: Syntax    Fehler: Fehlendes ';' vor Bezeichner '_Sizet'    c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1550    1   widelands_all
Fehler  12  error C2955: "std::_Iterator012": Für die Verwendung der template-Klasse ist eine template-Argumentliste erforderlich.  c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1548    1   widelands_all
Fehler  15  error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.   c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1550    1   widelands_all
Fehler  16  error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.   c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1550    1   widelands_all
Fehler  20  error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.   c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1582    1   widelands_all
Fehler  21  error C4430: Fehlender Typspezifizierer - int wird angenommen. Hinweis: "default-int" wird von C++ nicht unterstützt.   c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\vector   1582    1   widelands_all

It would be great if someone could give me a tip on how to work around them. Or is Visual Studio 2010 not supported yet by the Widelands code at all?

Best regards and thanks in advance

Andreas


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2012-06-08, 10:12

Not supported would be a strong statement. Widelands is coded along the C++ standard and therefore should work with all C++ Compilers out there. However, C++ is notably hard to get standard conform, therefore every compiler chokes at one point or another. AFAIK none of the current developers works with Visual Studio, therefore you might be out of luck...


Top Quote
abtools

Topic Opener
Joined: 2010-01-08, 16:31
Posts: 31
Ranking
Pry about Widelands
Location: Munich
Posted at: 2012-06-08, 10:20

Hello Holger,

so there is no Widelands developer currently working on Windows? Or is there another IDE that is used on the Windows side for Widelands development?

Best regards and thanks for your reply Andreas


Top Quote
Nasenbaer
Avatar
Joined: 2009-02-21, 18:17
Posts: 828
Ranking
One Elder of Players
Location: Germany
Posted at: 2012-06-08, 12:01

I am not sure whether "no Widelands developer" would be correct, as far as I know some of the patches we get are from Windows users and it is quite likely that I forget about one of the regular developers who use Windows for development...

So those either seem to use the old MSVC++ Version or are working with mingw. Later was the only supported build environment for a long time. the MSVC++ support came only with the cmake build.

However as Holger stated, it should be compatible to all major compilers, thus it would be good to have those bugs fixed. So if you are brave enough to tackle them down and submit the patches to bzr, this would surely help a bunch of other people. face-smile.png

Cheers Peter


Top Quote
abtools

Topic Opener
Joined: 2010-01-08, 16:31
Posts: 31
Ranking
Pry about Widelands
Location: Munich
Posted at: 2012-06-08, 15:06

Hello Peter,

I've found the reasons of the compile errors now and fixed them in this branch: https://code.launchpad.net/~ab-tools/widelands/msvs2010-compileerrors

If there are any questions about them, please let me know.

I'll also add some more hints to the http://wl.widelands.org/wiki/BuildingWidelands/ document regarding building on Windows.

Best regards

Andreas

Edited: 2012-06-08, 15:06

Top Quote
jarih

Joined: 2010-02-25, 10:58
Posts: 3
Ranking
Just found this site
Posted at: 2012-06-12, 21:12

Hi Andreas, good to see visual studio 2010 working. I fixed the cmake boost flags so that correct boost libs are now found. This requires 2.8.3 boost.

I'll check how it runs with vs2008. That assertion does not look good.

Cheers, Jari


Top Quote
abtools

Topic Opener
Joined: 2010-01-08, 16:31
Posts: 31
Ranking
Pry about Widelands
Location: Munich
Posted at: 2012-06-12, 21:23

Hello Jari,

thanks for your reply!

Yes, I've fixed the assertion problem by using the static boost libs, too. Just didn't know how to tell that CMake directly.

I wanted to remove it from the Wiki again right now, but you were faster. face-wink.png

I think we can delete it completely again there as I expect every developer to use the most recent version for building.

Best regards

Andreas

Edited: 2012-06-12, 21:23

Top Quote
se5a

Joined: 2011-11-26, 11:04
Posts: 28
Ranking
Pry about Widelands
Posted at: 2013-01-22, 11:32

Trying to build on windows, but Cmake is refusing to find the boost librarys. I try to set them manualy, but it just resets right back to Boost_SIGNALS_LIBRARY_DEBUG-NOTFOUND don't know what I'm doing wrong here...


Top Quote
abtools

Topic Opener
Joined: 2010-01-08, 16:31
Posts: 31
Ranking
Pry about Widelands
Location: Munich
Posted at: 2013-01-22, 11:36

Hello se5a,

did you set the "Boost_INCLUDE_DIR" (you can find it in the advanced view only) as decribed here? http://wl.widelands.org/wiki/BuildingWidelands/

After that it should work fine normally.

Best regards Andreas


Top Quote