News:

Do you need help?
Simutrans Wiki Manual can help you to play and extend Simutrans. In 9 languages.

Problems with compiling makeobj with MSVS

Started by DirrrtyDirk, September 27, 2010, 08:04:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DirrrtyDirk

I only began compiling Simutrans yesterday, so maybe I'm doing something wrong here, but I can compile r3827 without problem while r3830 stops compiling just before it should be finished. (Tried with both MS VC++ 2008 and 2010).

(But I cannot even get makeobj to compile, so I guess it's me doing something wrong somehow... although... why does r3827 work then?)

EDIT:
Error message

2008(English):
1>simwerkz.obj : error LNK2001: unresolved external symbol "public: __thiscall signal_spacing_frame_t::signal_spacing_frame_t(class spieler_t *,class wkz_roadsign_t *)"
(??0signal_spacing_frame_t@@QAE@PAVspieler_t@@PAVwkz_roadsign_t@@@Z)
1>E:\Simutrans Materials\_SVN_Simutrans\simutrans\trunk\Debug\Simutrans.exe : fatal error LNK1120: 1 unresolved externals

2010(Deutsch):
1>simwerkz.obj : error LNK2001: Nicht aufgelöstes externes Symbol ""public: __thiscall signal_spacing_frame_t::signal_spacing_frame_t(class spieler_t *,class wkz_roadsign_t *)"
(??0signal_spacing_frame_t@@QAE@PAVspieler_t@@PAVwkz_roadsign_t@@@Z)".
1>E:\Simutrans Materials\_SVN_Simutrans\simutrans\trunk\Debug\Simutrans.exe : fatal error LNK1120: 1 nicht aufgelöste externe Verweise.

  
***** PAK128 Dev Team - semi-retired*****

VS

Wild guess: If you are using MSVC, perhaps you forgot to add the new file to project? Then it doesn't get compiled... while the headers are included per path in actual sources & present... so problems will appear only once linking.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

DirrrtyDirk

#2
Hehe ;D, didn't even realise that I had to do that - but you were right: it works now. Thanks!

EDIT:
I guess the makeobj problem might be caused by the same thing, right? The MSVC project file in trunk seems to be from May (probably is out of date compared to the source files?)

EDIT2:
Yes, when I threw everything out that was no longer in the makefile for makeobj, that one also compiled! So for now all is well again!  :D
  
***** PAK128 Dev Team - semi-retired*****

Dwachs

Updated the project files right now (rev 3831).
Parsley, sage, rosemary, and maggikraut.

DirrrtyDirk

Sorry, but this simutrans project file only produces errors and cannot be converted (neither in 2008 or 2010). The makeobj project can be converted... and it compiles a makeobj.exe - although one that only produces 69 Byte pak-files (same happened with my own version from yesterday BTW).
  
***** PAK128 Dev Team - semi-retired*****

Dwachs

#5
Sorry for this. Will correct it this evening.

Edit: should be correct now (rev 3832). Makeobj works for me.
Parsley, sage, rosemary, and maggikraut.

DirrrtyDirk

Yes, the project files work again - thanks!

But the makeobj I compiled only produces 69 Byte pak files where makeobj v50 works just fine. Is there aynthing special that needs to be done for it to work? Some more libraries or include files maybe? But OTOH... if there's anything vital missing, shouldn't it fail to compile?
  
***** PAK128 Dev Team - semi-retired*****

Dwachs

Are there error messages from makeobj? Did the linking of the program work?

Could you upload your Makeobj.vcproj file?
Parsley, sage, rosemary, and maggikraut.

VS

(Thanks for splitting, I wondered about that...)

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

DirrrtyDirk

#9
Yes, I was going to suggest splitting this off, too... as this "off-topic" (=meanwhile topic of its own) seems to grow bigger and bigger  ;)

Ok now, where to begin...

Makeobj does not give any errors, it just stops:
(Identical setup)
v51:

Makeobj version 51 for simutrans 102.3 Nightly and higher
(c) 2002-2006 V. Meyer , Hj. Malthaner, M. Pristovsek (markus@pristovsek.de)

Image size is set to 128x128
writing file ./building.Depot_Train.pak


v50:

Makeobj version 50 for simutrans 102.1 Nightly and higher
(c) 2002-2006 V. Meyer , Hj. Malthaner, M. Pristovsek (markus@pristovsek.de)

Image size is set to 128x128
writing file ./building.Depot_Train.pak
  reading file ./TRAIN_depot-STATION.dat
     packing building.Train_DEPOT-station_A
     packing building.Train_DEPOT-station_B
  reading file ./TRAIN_depot.dat
     packing building.TRAIN_Depot


But I found out that I can compile makeobj successfully only with MSVC2010.
(Ok there's a warning at the end, too:)
1>LINK : warning LNK4098: Standardbibliothek "LIBCMT" steht in Konflikt mit anderen Bibliotheken; /NODEFAULTLIB:Bibliothek verwenden.
1>  Makeobj_VC2010.vcxproj -> E:\Simutrans Materials\_SVN_Simutrans\simutrans\trunk\Debug\Makeobj.exe
========== Erstellen: 1 erfolgreich, Fehler bei 0, 0 aktuell, 0 übersprungen ==========




Under MSVC2008 (the project file seems to convert ok there, too), I get more warnings and some errors during compiling and it fails:

1>------ Build started: Project: Makeobj_VC2008, Configuration: Debug Win32 ------
1>Compiling...
1>way_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>way_obj_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>vehicle_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>tunnel_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>tree_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>text_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>tabfile.cc
1>sound_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>skin_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>simtools.cc
1>simstring.cc
1>simmem.cc
1>simdebug.cc
1>sim_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>searchfolder.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>root_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>roadsign_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>pedestrian_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>obj_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>obj_node.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>Generating Code...
1>Compiling...
1>makeobj.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>log.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>imagelist_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>imagelist2d_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>image_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>groundobj_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>ground_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>good_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>get_waytype.cc
1>get_climate.cc
1>freelist.cc
1>factory_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>debug_helper.cc
1>crossing_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>citycar_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>building_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>bridge_writer.cc
1>D:\Microsoft Visual Studio 9.0\VC\include\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>Generating Code...
1>vehicle_writer.obj : error LNK2019: unresolved external symbol "public: void __thiscall xref_writer_t::write_obj(struct _iobuf *,class obj_node_t &,enum obj_type,char const *,bool)" (?write_obj@xref_writer_t@@QAEXPAU_iobuf@@AAVobj_node_t@@W4obj_type@@PBD_N@Z) referenced in function "public: virtual void __thiscall vehicle_writer_t::write_obj(struct _iobuf *,class obj_node_t &,class tabfileobj_t &)" (?write_obj@vehicle_writer_t@@UAEXPAU_iobuf@@AAVobj_node_t@@AAVtabfileobj_t@@@Z)
1>tunnel_writer.obj : error LNK2001: unresolved external symbol "public: void __thiscall xref_writer_t::write_obj(struct _iobuf *,class obj_node_t &,enum obj_type,char const *,bool)" (?write_obj@xref_writer_t@@QAEXPAU_iobuf@@AAVobj_node_t@@W4obj_type@@PBD_N@Z)
1>factory_writer.obj : error LNK2001: unresolved external symbol "public: void __thiscall xref_writer_t::write_obj(struct _iobuf *,class obj_node_t &,enum obj_type,char const *,bool)" (?write_obj@xref_writer_t@@QAEXPAU_iobuf@@AAVobj_node_t@@W4obj_type@@PBD_N@Z)
1>crossing_writer.obj : error LNK2001: unresolved external symbol "public: void __thiscall xref_writer_t::write_obj(struct _iobuf *,class obj_node_t &,enum obj_type,char const *,bool)" (?write_obj@xref_writer_t@@QAEXPAU_iobuf@@AAVobj_node_t@@W4obj_type@@PBD_N@Z)
1>sim_writer.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall xref_writer_t::dump_node(struct _iobuf *,struct obj_node_info_t const &)" (?dump_node@xref_writer_t@@UAEXPAU_iobuf@@ABUobj_node_info_t@@@Z)
1>log.obj : error LNK2019: unresolved external symbol "public: static unsigned char umgebung_t::verbose_debug" (?verbose_debug@umgebung_t@@2EA) referenced in function "public: void __cdecl log_t::debug(char const *,char const *,...)" (?debug@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "bool __cdecl dr_fatal_notify(char const *,int)" (?dr_fatal_notify@@YA_NPBDH@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "bool __cdecl check_pos_win(struct event_t *)" (?check_pos_win@@YA_NPAUevent_t@@@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "void __cdecl display_poll_event(struct event_t *)" (?display_poll_event@@YAXPAUevent_t@@@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "void __cdecl dr_flush(void)" (?dr_flush@@YAXXZ) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "void __cdecl dr_prepare_flush(void)" (?dr_prepare_flush@@YAXXZ) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "void __cdecl dr_sleep(unsigned int)" (?dr_sleep@@YAXI@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "bool __cdecl win_is_top(class gui_frame_t const *)" (?win_is_top@@YA_NPBVgui_frame_t@@@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "int __cdecl create_win(int,int,class gui_frame_t *,enum wintype,long)" (?create_win@@YAHHHPAVgui_frame_t@@W4wintype@@J@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "short __cdecl display_get_width(void)" (?display_get_width@@YAFXZ) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "short __cdecl display_get_height(void)" (?display_get_height@@YAFXZ) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "public: __thiscall news_img::news_img(char const *,unsigned short,unsigned short)" (??0news_img@@QAE@PBDGG@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "void __cdecl destroy_all_win(bool)" (?destroy_all_win@@YAX_N@Z) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>log.obj : error LNK2019: unresolved external symbol "int __cdecl is_display_init(void)" (?is_display_init@@YAHXZ) referenced in function "public: void __cdecl log_t::fatal(char const *,char const *,...)" (?fatal@log_t@@QAAXPBD0ZZ)
1>image_writer.obj : error LNK2019: unresolved external symbol _load_block referenced in function "private: bool __thiscall image_writer_t::block_laden(char const *)" (?block_laden@image_writer_t@@AAE_NPBD@Z)
1>way_writer.exe : fatal error LNK1120: 17 unresolved externals
1>Build log was saved at "file://e:\Simutrans Materials\_SVN_Simutrans\simutrans\trunk\Debug-makeobj\BuildLog.htm"
1>Makeobj_VC2008 - 21 error(s), 28 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


But Simutrans compiles on both versions (and both versions seem to work as well).

Oh to make the information (hopefully) complete, I use the precompiled libraries for OpenTTD (v3.2) plus the libbz2 stuff you posted here. But so far nothing more than that. Actually I merely followed VS' instructions from here. Anything missing/wrong/outdated on my part there?

I hope I attached the correct files...
  
***** PAK128 Dev Team - semi-retired*****

Dwachs

#10
Can you post your dat/pngs? In case there is a bug in the new makeobj.


1>vehicle_writer.obj : error LNK2019: unresolved external symbol "public: void __thiscall xref_writer_t::write_obj(struct _iobuf *,class obj_node_t &,enum obj_type,char const *,bool)"
(?write_obj@xref_writer_t@@QAEXPAU_iobuf@@AAVobj_node_t@@W4obj_type@@PBD_N@Z) referenced in function "public: virtual void __thiscall vehicle_writer_t::write_obj(struct _iobuf *,class obj_node_t &,class tabfileobj_t &)" (?write_obj@vehicle_writer_t@@UAEXPAU_iobuf@@AAVobj_node_t@@AAVtabfileobj_t@@@Z)

seems like you somehow excluded \besch\writer\xref_writer.cc

To compile makeobj one has to set the preprocessor flag MAKEOBJ, otherwise log.cc will give linking errors (as in your error messages). Compiler -> PreprocessorDefinitions.

However, the project file you posted includes xref_writer.cc and defines MAKEOBJ. So I have no idea, where this errors come from ??? Maybe a fresh, complete build helps?

Did you compile the 'debug' configuration?

In the project, the directories to include and library files were not changed. Maybe you need to add these?
Compiler -> AdditionalIncludeDirectories and Linker -> AdditionalLibraryDirectories (both as properties of the makeobj project)

Hope this helps.
Parsley, sage, rosemary, and maggikraut.

DirrrtyDirk

#11
Ok, I got it running in MSVC2008 without errors, and just a few warnings. So basically it works now just as well / bad as in MSVC2010.
(Just took VS' project file for makeobj for 2008 and only replaced the source file list with all the .h and .cc entries from the new one you made. 'Cause to be honest: I don't know / couldn't find the things you just asked.)

But the results were... you guessed it: the same as with the MSVC2010 compiled version - 69 bytes.

However, just for the fun of it (and to see wether it might be a problem with the dat/pngs) I used it to pak the whole pak128 instead of only one or two files by myself. And... from all the 1533 pak files created, exactly 32 came up with 69 bytes file size. So I guessed, that yes, there is a bug in the new makeobj somewhere, but one that probably is not easy to trigger.
So I checked some more... for example, I coud create a bunch of RES-Buildings (from my own sources, not the same as in pak128) just fine. Merging these files however, resulted in a 69 Byte file... So I tested some more...

Right now (after a quick and not yet thorough test) I'd say it works when you use
makeobj pak128 ./
and it also works when you specify a pak-file name
makeobj pak128 ./pakname.pak
but it does not work when you give specific files for both pak and dat (which I usually do).
makeobj pak128 ./pakname.pak ./datname.dat

But I attached a .png & .dat combination that happens to show the described behaviour.


PS: Oh and yes, I tried both, the "debug" and "release" configuration. But usually I let the default there (=debug). I don't want to fiddle around there too much, I just want to be able to compile both simutrans and makeobj by myself once in a while.

EDIT: removed attachment file again (it served its purpose after all)
  
***** PAK128 Dev Team - semi-retired*****

Dwachs

Thank you for this detailed report. There was indeed a bug. Should be working again in rev 3839.
Parsley, sage, rosemary, and maggikraut.

DirrrtyDirk

As far as I can tell... everything works now!  :D Thanks!
  
***** PAK128 Dev Team - semi-retired*****

Dwachs

Parsley, sage, rosemary, and maggikraut.