Compiling spring (mingw and visual studio 7/8) - Page 8

Compiling spring (mingw and visual studio 7/8)

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Tim-the-maniac
Posts: 250
Joined: 22 Jul 2006, 19:58

Post by Tim-the-maniac »

Ok renaming some files worked, and now i get the same kind of errors which Acidd reported a few posts back:
VFSHandler.obj : error LNK2001: unresolved external symbol...
and loads of others all concerning .obj stuff.

So Acidd you said you solved it by adding some source files to the project.
How did you find which files were'nt compiling/fix it?
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

Ok, there's two possibilities.

Here's my solution to the first - for each of the unresolved symbol errors, what I did was search the Spring trunk for files containing the relevant class name. E.g.

Code: Select all

Game.obj : error LNK2001: unresolved external symbol "class CIconHandler * iconHandler" (?iconHandler@@3PAVCIconHandler@@A) 
UnitDrawer.obj : error LNK2001: unresolved external symbol "class CIconHandler * iconHandler" (?iconHandler@@3PAVCIconHandler@@A)"
so here, it's looking for a class called CIconHandler, but can't find it. So search through your spring source dir for a file containing that class's name (in this case it's the file rts/Rendering/IconHandler.cpp and the header). Then just drag the file into the 'solution explorer' in the right place. VS should then compile the class at build and not complain about unresolved external symbol.

Secondly, there were a few functions that come from libraries that not in the spring source. These are libraries from the Windows platform SDK and the DirectX SDK. For example,

Code: Select all

Game.obj : error LNK2019: unresolved external symbol "wchar_t * __stdcall _com_util::ConvertStringToBSTR(char const *)" (?ConvertStringToBSTR@_com_util@@YGPA_WPBD@Z) referenced in function "public: __thiscall _bstr_t::Data_t::Data_t(char const *)" (??0Data_t@_bstr_t@@QAE@PBD@Z)
Here, I searched google for "ConvertStringToBSTR" and found other people on other projects had the same problem. For some reason, I needed to explicitly add comsuppw.lib to the library files in project properties->configuration->linker->input files->additional dependancies

You will probably have to do the same with dsound.lib.

----

Other things I had to do get rid of other errors:

You'll also need to add the paths for the DirectX and win platform SDK headers and libraries into the project configuration if you havent already:

project properties->configuration->c++->general->additional inc dirs
project properties->configuration->linker->general->additional lib dirs

Finally, for some reason it tries to find libc.lib as a default libray but cannot find it, so you need to force it to ignore libc.lib:

properties->configuration->linker->input files->ignore specific lib

Hope that helps!
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I wonder why it needs the directX sdk if we dont use directX? Afterall we use OpenGl and OpenAL for our sound/graphics and have done since the linux port was merged into the trunk code.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

No we still use directsound. 0.70b1 used OpenAL iirc, but it was buggy as hell so I switched it back.
Tim-the-maniac
Posts: 250
Joined: 22 Jul 2006, 19:58

Post by Tim-the-maniac »

Thanks to acidd who helped me kill loads of errors when he was in the lobby
But now im getting stuff like this: (7 in all)

Code: Select all

WinPBuffer.obj : error LNK2019: unresolved external symbol __imp__GetPixelFormat@4 referenced in function "public: __thiscall WinPBuffer::WinPBuffer(int)" (??0WinPBuffer@@QAE@H@Z)
BeamLaser.obj : error LNK2019: unresolved external symbol "public: __thiscall CLargeBeamLaserProjectile::CLargeBeamLaserProjectile(class float3 const &,class float3 const &,class float3 const &,class float3 const &,class CUnit *,float,float,float,float,float,float,struct AtlasedTexture *,struct AtlasedTexture *)" (??0CLargeBeamLaserProjectile@@QAE@ABVfloat3@@000PAVCUnit@@MMMMMMPAUAtlasedTexture@@2@Z) referenced in function "public: virtual void __thiscall CBeamLaser::Fire(void)" (?Fire@CBeamLaser@@UAEXXZ)
RegHandler.obj : error LNK2019: unresolved external symbol __imp__RegCloseKey@4 referenced in function "public: virtual __thiscall RegHandler::~RegHandler(void)" (??1RegHandler@@UAE@XZ)
I found where all the classes involed were declered and made sure all the files were getting compiled so im clueless.
Any ideas?
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

What could be the reason for me getting an "error 400:bad request" when trying to update from repository?
patmo98
Posts: 188
Joined: 09 Jan 2006, 17:51

Post by patmo98 »

Sean Mirrsen wrote:What could be the reason for me getting an "error 400:bad request" when trying to update from repository?
Tobi said this on the mailing list.
Tobi wrote:Hi,

For your information, the berlios svn server is full, ie. no one can commit
currently. I've sent an e-mail to berlios staff already, so no need to do
that again.

Hopefully they install a new disk soon.

Tobi
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

update should work fine tho (and does so here), you just can't commit anymore (unless you're lucky like JC a moment ago that theres a few 100K free :-))
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

Well, I told JC to commit whatever I had uploaded so I could painlessly nuke my working copy and re-checkout, it looks like it got fudged up somehow. Then again, it might be just my PC, and/or the SmartSVN thingy, but I'll reinstall the OS as soon as it crashes again, so I hope to solve those problems eventually.. :P
am0kk
Posts: 14
Joined: 11 Jul 2006, 07:51

Post by am0kk »

For Tim-E- :D


the largebeamlaser.cpp and .h arent included in the project file, all you need to do is drag and drop those two files from the sim/projectiles folder to the sim/projectiles folder in VS :D


As for the other errors :|
Tim-the-maniac
Posts: 250
Joined: 22 Jul 2006, 19:58

Post by Tim-the-maniac »

I've fixed all the errors now thanks :-)
Stupid me forgot to do that alteration needed when using the platform SDK :oops:
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

Glad you've got it working Ray :-)
am0kk
Posts: 14
Joined: 11 Jul 2006, 07:51

Post by am0kk »

Not sure if I've done anything wrong... I have successfully built spring from the latest svn, however when I play a game with the built executable, either using random enemies script, air combat test or with an ai ( kai/ntai) I get a hard crash and reboot....

Map is small divide.


Anyone have any ideas?
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

Rebuild in debug mode and see if ti still happens - if so, then use breakpoints / stepthrough to try to work out where it's crashing...
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

why are there so many external dependancies in this project... can't these be narrowed down... at all?
User avatar
Acidd_UK
Posts: 963
Joined: 23 Apr 2006, 02:15

Post by Acidd_UK »

For example?
am0kk
Posts: 14
Joined: 11 Jul 2006, 07:51

Post by am0kk »

Perhaps, if it is possible by putting the directx and platform sdk libs and headers in the vclibs folder as well...
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

The platform SDK alone can reach upto 2GB And For me the DirectX 9 SDK was at least 900MB.

Considering the spring svn main trunk si 15MB............
am0kk
Posts: 14
Joined: 11 Jul 2006, 07:51

Post by am0kk »

But of all the content in those SDKs, how many libraries are actually used?
User avatar
Michilus_nimbus
Posts: 634
Joined: 19 Nov 2004, 20:38

Post by Michilus_nimbus »

scons + mingw returns this for me at what I think is the end of the compilation process:

Code: Select all

build\rts\lib\minizip\minizip.o(.text+0xc9):minizip.c: multiple definition of `d
o_banner'
build\rts\lib\minizip\miniunz.o(.text+0x1e8):miniunz.c: first defined here
build\rts\lib\minizip\minizip.o(.text+0xe9):minizip.c: multiple definition of `d
o_help'
build\rts\lib\minizip\miniunz.o(.text+0x208):miniunz.c: first defined here
build\rts\lib\minizip\minizip.o(.text+0x1e0):minizip.c: multiple definition of `
main'
build\rts\lib\minizip\miniunz.o(.text+0x967):miniunz.c: first defined here
collect2: ld returned 1 exit status
scons: *** [game\spring.exe] Error 1
scons: building terminated because of errors.
I'm quite new to this, so I'm not sure how to solve the problem. Any tips would be appreciated.

EDIT: The problem seems to have solved itself.
Post Reply

Return to “Engine”