News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Need some help with compilation

Started by killwater, January 23, 2016, 04:55:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

killwater

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?

jamespetts

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?
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

killwater

Hello James
Thank you for your response.
I have this file in the exact location as you.

DrSuperGood

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.

killwater

Well I think I could give it a try if someone would be so nice to point me to a trustworthy sourcecode source :) 

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ves

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.

killwater

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.

DrSuperGood

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.

jamespetts

I have fixed this particular warning, but there will be many others, many from Standard code.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

killwater

Nope just this one... I hope to try it this weekend :)

Rollmaterial

DrSuperGood is right about warnings, last time I compiled I had over 1000, mainly variable conversions with possible data loss. :)