News:

SimuTranslator
Make Simutrans speak your language.

Compiling ST:Exp

Started by Carl, November 14, 2010, 11:11:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carl

I've been trying to compile ST:Exp from source for the first time in order to test inkelyad's waiting times post, but I just can't get it to work. I think I've followed all of the instructions on how to compile using MSVC, but I keep getting the following errors:

Quotecolors.obj : error LNK2001: unresolved external symbol "private: static unsigned int path_explorer_t::compartment_t::limit_rebuild_connexions" (?limit_rebuild_connexions@compartment_t@path_explorer_t@@0IA)
colors.obj : error LNK2001: unresolved external symbol "private: static unsigned int path_explorer_t::compartment_t::limit_reroute_goods" (?limit_reroute_goods@compartment_t@path_explorer_t@@0IA)
colors.obj : error LNK2001: unresolved external symbol "public: static void __cdecl path_explorer_t::full_instant_refresh(void)" (?full_instant_refresh@path_explorer_t@@SAXXZ)
colors.obj : error LNK2001: unresolved external symbol "private: static bool path_explorer_t::processing" (?processing@path_explorer_t@@0_NA)
colors.obj : error LNK2001: unresolved external symbol "private: static unsigned __int64 path_explorer_t::compartment_t::limit_explore_paths" (?limit_explore_paths@compartment_t@path_explorer_t@@0_KA)
colors.obj : error LNK2001: unresolved external symbol "private: static unsigned int path_explorer_t::compartment_t::limit_filter_eligible" (?limit_filter_eligible@compartment_t@path_explorer_t@@0IA)
colors.obj : error LNK2001: unresolved external symbol "private: static unsigned int path_explorer_t::compartment_t::limit_fill_matrix" (?limit_fill_matrix@compartment_t@path_explorer_t@@0IA)
colors.obj : error LNK2001: unresolved external symbol "private: static char const * const * const path_explorer_t::compartment_t::phase_name" (?phase_name@compartment_t@path_explorer_t@@0QBQBDB)
colors.obj : error LNK2001: unresolved external symbol "private: static unsigned char path_explorer_t::current_compartment" (?current_compartment@path_explorer_t@@0EA)
colors.obj : error LNK2001: unresolved external symbol "private: static class path_explorer_t::compartment_t * path_explorer_t::goods_compartment" (?goods_compartment@path_explorer_t@@0PAVcompartment_t@1@A)
convoi_info_t.obj : error LNK2001: unresolved external symbol "public: virtual short __thiscall existing_convoy_t::get_current_friction(void)" (?get_current_friction@existing_convoy_t@@UAEFXZ)
convoi_
...

etc, etc, down to...
Quote
C:\Users\Carl\Documents\My Games\SimutransExp SOURCE\Debug\Simutrans.exe : fatal error LNK1120: 76 unresolved externals

I get the same error for both the current release and the 9.0 sources. What am I likely doing wrong?

I also wasn't sure which of the projects I was supposed to build (Simutrans/Simutrans Experimental/Simutrans Experimental BG/Simutrans Experimental BG 7.2) -- I went for Simutrans Experimental but I guess it's possible this could be part of my problem.


Thanks in advance for any help you can give on this -- sorry for posting such a n00b-ish question.

jamespetts

I am not quite sure why you are having this problem, as you seem to be using the correct MSVC file. However, it appears that a number of the additional .cc files necessary to compile Simutrans-Experimental have not been added to the project. You will need to add the corresponding .cc files that contain the classes to which the LNK2001 errors refer to your MSVC project. You are using the 2010 version and not the 2008 version of MSVC, aren't you?
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.

Carl

Thanks for the quick reply!

I'm using the 2008 version -- I guess I should have specified that. I take it from your comment that if I were to use the 2010 version I wouldn't come up against these errors?

Carl

I'm getting the same variety of error in VS2010 -- though not the same specific errors. Now the stages it fails on involve the likes of roadsign_reader.obj, good_reader.obj and bruecke_besch.obj.

inkelyad

MSVC projects files is not transfer-frendly.

MSVC build environmend uses different configuration for debug/debug-sdl/etc.. binaries. And there is absolute library paths somewhere in linker/compiler options( F:\My Documents\Development\libbz2 or something like this). You need to change all that.

prissi

There is no need to have absolute paths in a project. The absolute path should go into the IDE settings, not the properties of a projects. If done properly, absolute path should not be an issue. (OpenTTD and Standard does it this way.)

Carl

So will I need to modify the project file or perhaps create a new one in order to be able to compile the source as is?

jamespetts

The current version of the project file is indeed in the 2010 version of MSVC, so you will not be able to load an up-to-date version with the 2008 version. Either install the 2010 version, or update the 2008 project file manually. You may also need to respecify the locations of the library files has been stated above.
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.

Carl

Sorry to persist on this. What exactly are the steps I'd need to perform in order to compile in MSVC 2010 Express (which I've now updated to)? I've followed the instructions here with respect to referencing the include and library files, but this doesn't seem to be sufficient---what else is needed?

jamespetts

I wouldn't know the answer off the top of my head, because I don't know exactly which paths are relative and which I have specified to be specific to my file-system, so I cannot take you through it step by step. However, once you have installed MSVC 2010 and used the latest project file, the only things left to do should be to get the relevant include directories right: have a look at the project properties. Probably the best thing to do is see how far that you can get with that approach, and then post here what errors that you have left and we can see if we can solve them between us.
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.

Carl

Ok, many thanks. I'll give that a try in due course and come back with the results.