The International Simutrans Forum

Simutrans Extended => Simutrans-Extended development => Topic started by: killwater on January 23, 2016, 04:55:07 PM

Title: Need some help with compilation
Post by: killwater on January 23, 2016, 04:55:07 PM
Hello
I am again trying to compile experimental in accordance with the guide in the sticky. Unfortunately I get three errors:
Error    115    error LNK2001: unresolved external symbol ___stdio_common_vsprintf    \simutrans-experimental-devel-new\zlibstat.lib(gzlib.obj)    Simutrans-Experimental
Error    116    error LNK2001: unresolved external symbol ___stdio_common_vsprintf    \simutrans-experimental-devel-new\zlibstat.lib(gzwrite.obj)    Simutrans-Experimental
Error    117    error LNK1120: 1 unresolved externals    \simutrans-experimental-devel-new\simutrans\Simutrans-Experimental.exe    Simutrans-Experimental


Any hints what am I doing wrong?
Title: Re: Need some help with compilation
Post by: jamespetts on January 23, 2016, 05:28:11 PM
Hmm - that's odd. These symbols should be defined in c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdio.h. Do you not have this file?
Title: Re: Need some help with compilation
Post by: killwater on January 23, 2016, 06:22:41 PM
Hello James
Thank you for your response.
I have this file in the exact location as you.
Title: Re: Need some help with compilation
Post by: DrSuperGood on January 23, 2016, 07:28:57 PM
Quote
Hmm - that's odd. These symbols should be defined in c:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\stdio.h. Do you not have this file?
Yes they are defined there, but this is a linker error. It cannot find the associated object code for the function to link with.

As a rough guess it will be because the way "zlibstat.lib" has been built is not compatible with the way you are trying to build simutrans experimental. Specifically the standard libraries it linked to (stdio) are different from the ones you are trying to link to so the declarations are incompatible. This is usually the case if you change character set since different implementations for stdio are used to support the different character size.

I would advise rebuilding "zlibstat.lib" with your MSVC version and compatible settings. I did this for all dependant libraries (except PThread) for building Simutrans standard in MSVC.
Title: Re: Need some help with compilation
Post by: killwater on January 24, 2016, 10:04:42 AM
Well I think I could give it a try if someone would be so nice to point me to a trustworthy sourcecode source :) 
Title: Re: Need some help with compilation
Post by: jamespetts on January 24, 2016, 12:05:17 PM
Are these files not available in the OpenTTD libraries, or are those just the compiled ones? Either way, thee sources should be findable from the projects' homepages, for which I should have to search just as much as anyone else for want of having dealt with downloading them for a very long time.
Title: Re: Need some help with compilation
Post by: Ves on January 24, 2016, 01:32:03 PM
I had a problem with the latest builds from openTTD libraries (version 6 or something). I went back in the line and found version 3.1(I think it was) which could compile both experimental and the makeobj.
Title: Re: Need some help with compilation
Post by: killwater on January 27, 2016, 09:12:54 PM
Thank you Ves it worked. Unfortunately i got a warning:
Warning   1   warning C4715: 'process_city_street' : not all control paths return a value \simutrans-experimental-devel-new\simcity.cc   3621   1   Simutrans-Experimental

I hope it will not be a problem.
Title: Re: Need some help with compilation
Post by: DrSuperGood on January 28, 2016, 03:05:59 AM
Warnings are not errors. It will still build successfully with warnings, but it will fail to build with errors. If the warnings should be ignored or not is at the discretion of a programmer though.
Title: Re: Need some help with compilation
Post by: jamespetts on January 28, 2016, 10:38:55 AM
I have fixed this particular warning, but there will be many others, many from Standard code.
Title: Re: Need some help with compilation
Post by: killwater on January 29, 2016, 07:19:24 PM
Nope just this one... I hope to try it this weekend :)
Title: Re: Need some help with compilation
Post by: Rollmaterial on January 29, 2016, 08:59:12 PM
DrSuperGood is right about warnings, last time I compiled I had over 1000, mainly variable conversions with possible data loss. :)