The International Simutrans Forum

 

Author Topic: Compiling ST:Exp  (Read 2336 times)

0 Members and 1 Guest are viewing this topic.

Offline Carl

  • Devotee
  • *
  • Posts: 1614
    • Website
  • Languages: EN
Compiling ST:Exp
« on: November 14, 2010, 11:11:07 PM »
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:

Quote
colors.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.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Compiling ST:Exp
« Reply #1 on: November 14, 2010, 11:13:49 PM »
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?

Offline Carl

  • Devotee
  • *
  • Posts: 1614
    • Website
  • Languages: EN
Re: Compiling ST:Exp
« Reply #2 on: November 14, 2010, 11:15:21 PM »
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?

Offline Carl

  • Devotee
  • *
  • Posts: 1614
    • Website
  • Languages: EN
Re: Compiling ST:Exp
« Reply #3 on: November 15, 2010, 12:33:45 AM »
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.

Offline inkelyad

  • Devotees (Inactive)
  • *
  • Posts: 482
  • Languages: EN, RU
Re: Compiling ST:Exp
« Reply #4 on: November 15, 2010, 04:30:22 AM »
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9584
  • Languages: De,EN,JP
Re: Compiling ST:Exp
« Reply #5 on: November 15, 2010, 02:05:02 PM »
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.)

Offline Carl

  • Devotee
  • *
  • Posts: 1614
    • Website
  • Languages: EN
Re: Compiling ST:Exp
« Reply #6 on: November 15, 2010, 02:06:38 PM »
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?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Compiling ST:Exp
« Reply #7 on: November 15, 2010, 09:09:39 PM »
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.

Offline Carl

  • Devotee
  • *
  • Posts: 1614
    • Website
  • Languages: EN
Re: Compiling ST:Exp
« Reply #8 on: November 16, 2010, 04:42:08 PM »
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?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18753
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Compiling ST:Exp
« Reply #9 on: November 16, 2010, 11:27:34 PM »
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.

Offline Carl

  • Devotee
  • *
  • Posts: 1614
    • Website
  • Languages: EN
Re: Compiling ST:Exp
« Reply #10 on: November 16, 2010, 11:34:20 PM »
Ok, many thanks. I'll give that a try in due course and come back with the results.