Author Topic: Adding a new source file (Windows Version Specific)  (Read 1137 times)

Conzar

  • Guest
Adding a new source file (Windows Version Specific)
« on: 21 January 2011, 15:33:43 »
I have created serveral patches and some of which includes creating new source files (.cpp and .h).  I am able to compile and make a build for the GNU/Linux platform without any problems.  Since I don't run windows, ColdFusionStorm is attempting at compiling our build on Windows.  He has followed the GAE guild to compiling using the MG source from SVN and has been able to succefully create a windows build.

He then tried to compile our source (by replacing source dirs).  The compile failed at the linking stage with the following error:
Code: [Select]
5>Generating Code...
5>Compiling resources...
5>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
5>Copyright (C) Microsoft Corporation.  All rights reserved.
5>Linking...
5>jpeg.lib(jdapimin.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
5>sdl.lib(SDL_cursor.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification
5>   Creating library .\..\..\data\glest_game\glest_game.lib and object .\..\..\data\glest_game\glest_game.exp
5>metrics.obj : error LNK2001: unresolved external symbol "public: static class Glest::Game::Hud * __cdecl Glest::Game::Hud::getInstance(void)" (?getInstance@Hud@Game@Glest@@SAPAV123@XZ)
5>renderer.obj : error LNK2001: unresolved external symbol "public: static class Glest::Game::Hud * __cdecl Glest::Game::Hud::getInstance(void)" (?getInstance@Hud@Game@Glest@@SAPAV123@XZ)
5>faction_type.obj : error LNK2001: unresolved external symbol "public: static class Glest::Game::Hud * __cdecl Glest::Game::Hud::getInstance(void)" (?getInstance@Hud@Game@Glest@@SAPAV123@XZ)
5>faction_type.obj : error LNK2001: unresolved external symbol "public: void __thiscall Glest::Game::Hud::setUnitPosition(enum Glest::Game::Hud::UnitPositionType)" (?setUnitPosition@Hud@Game@Glest@@QAEXW4UnitPositionType@123@@Z)
5>faction_type.obj : error LNK2001: unresolved external symbol "public: void __thiscall Glest::Game::Hud::loadOverlay(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?loadOverlay@Hud@Game@Glest@@QAEXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
5>faction_type.obj : error LNK2001: unresolved external symbol "public: void __thiscall Glest::Game::Hud::setConsumablesPosition(enum Glest::Game::Hud::ConsumablesPositionType)" (?setConsumablesPosition@Hud@Game@Glest@@QAEXW4ConsumablesPositionType@123@@Z)
5>faction_type.obj : error LNK2001: unresolved external symbol "public: void __thiscall Glest::Game::Hud::setResourcePosition(enum Glest::Game::Hud::ResourcePositionType)" (?setResourcePosition@Hud@Game@Glest@@QAEXW4ResourcePositionType@123@@Z)
5>faction_type.obj : error LNK2001: unresolved external symbol "public: void __thiscall Glest::Game::Hud::setMinimapPosition(enum Glest::Game::Hud::MinimapPositionType)" (?setMinimapPosition@Hud@Game@Glest@@QAEXW4MinimapPositionType@123@@Z)
5>.\..\..\data\glest_game\glest_game.exe : fatal error LNK1120: 6 unresolved externals
5>Build log was saved at "file://g:\Users\Frederick\Desktop\New folder (2)\mk\windoze\Release\glest_game\BuildLog.htm"
5>glest_game - 9 error(s), 8 warning(s)
========== Build: 5 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Looks to me that the linker cannot find the new files (hud.cpp and hud.h).  Is there something that has to be done in windows for the linker to find the new files (in GNU/Linux I didn't have to do anything).

Thanks for your help.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: Adding a new source file (Windows Version Specific)
« Reply #1 on: 21 January 2011, 15:52:59 »
To clarify, i did NOT follow the GAE guide, because its used with C-make, something softcoder told me were not working with MG.

I Used the mk/windoze/mg-build.bat and commented out the SVN part of the bat file to avoid the sources being updated to newest revision (i svnupdated manually before that).

i then compiled with c++, and it gave the error conzar have shown in the codebox.

to conzar, sorry for not making myself clear enough :).

EDIT: im currently trying to add the files in the project list, under the GLobal folder

i got it to compile :).

i just looked around used my head, it only got working just now :)
« Last Edit: 21 January 2011, 16:12:25 by Coldfusionstorm »
WiP Game developer.
I do danish translations.
"i break stuff"

softcoder

  • MegaGlest Team
  • Battle Machine
  • ********
  • Posts: 2,239
    • View Profile
Re: Adding a new source file (Windows Version Specific)
« Reply #2 on: 21 January 2011, 16:37:48 »
Yes VC++ project files require you to manually add new files to the projects involved (And setup include paths etc)

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: Adding a new source file (Windows Version Specific)
« Reply #3 on: 21 January 2011, 17:07:27 »
Thanks softcoder, seeing as im the one who needs to compile for the windows platform is there anything more i should be aware of?.

what about the paths?, paths to what exactly?.

also, Conzar, where should the the files be place(hud.cpp, and hud.h).
i have serveral folders under glest_game, i can put them in, does it matter wich folder i put them in?.(other than for orginasial purposes?)
« Last Edit: 21 January 2011, 17:11:48 by Coldfusionstorm »
WiP Game developer.
I do danish translations.
"i break stuff"

Conzar

  • Guest
Re: Adding a new source file (Windows Version Specific)
« Reply #4 on: 21 January 2011, 23:26:16 »
also, Conzar, where should the the files be place(hud.cpp, and hud.h).
i have serveral folders under glest_game, i can put them in, does it matter wich folder i put them in?.(other than for orginasial purposes?)
The hud.cpp and hud.h should go in the souce/glest_game/global directory.

I'm glad you got it compiling now!