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



All times are UTC + 1 hour


Post new topic Reply to topic  [ 582 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 30  Next
Author Message
 Post subject:
PostPosted: 28 Jun 2006, 15:44 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
wasn't that fixed already by your patch AF? or is this the other VS version?


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Jun 2006, 15:46 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
That was fixed in the final release mode of the VS7 project.

the other 2 modes, and the 3 modes in the VS8 build still have the issue.

Opening the VSProjects in a texteditor and searching for SDL-1.2.8 and replacing the 8 with a 9 should fix it.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Jun 2006, 17:55 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Sean Mirrsen wrote:
Perhaps the fact you have to extract vclibs to a "vclibs" folder just like I forgot to?


Nah, got that..

AF wrote:
Opening the VSProjects in a texteditor and searching for SDL-1.2.8 and replacing the 8 with a 9 should fix it.


I opened it in a text editor but did not find the refference.. are you talking about the .vcproj or another file?

*edit* I did not find it because the file already has .9 in it.

So, um what else could I have fucked up?


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Jun 2006, 18:08 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
there should be 6 references not 1, 2 for each mode, debug, release, and final releae.

Check them in VS too in project settings, additional include directories and additional library directories.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Jun 2006, 19:18 
Content Developer
User avatar

Joined: 13 Jan 2005, 00:46
Location: ModalitÃ
Compiled, but I have these warnnings... do I need to worry?

Quote:
LINK : warning LNK4098: defaultlib 'LIBC' conflicts with use of other libs; use /NODEFAULTLIB:library
FBO.obj : warning LNK4217: locally defined symbol ___glewDeleteFramebuffersEXT imported in function "public: virtual __thiscall FBO::~FBO(void)" (??1FBO@@UAE@XZ)
FBO.obj : warning LNK4217: locally defined symbol ___glewBindFramebufferEXT imported in function "public: virtual __thiscall FBO::~FBO(void)" (??1FBO@@UAE@XZ)
FBO.obj : warning LNK4217: locally defined symbol ___glewCheckFramebufferStatusEXT imported in function "public: virtual void __thiscall FBO::checkFBOStatus(void)" (?checkFBOStatus@FBO@@UAEXXZ)
FBO.obj : warning LNK4217: locally defined symbol ___glewFramebufferTexture2DEXT imported in function "public: virtual void __thiscall FBO::attachTexture(unsigned int,unsigned int,enum FramebufferAttachType)" (?attachTexture@FBO@@UAEXIIW4FramebufferAttachType@@@Z)
FBO.obj : warning LNK4217: locally defined symbol ___glewGenFramebuffersEXT imported in function "public: __thiscall FBO::FBO(void)" (??0FBO@@QAE@XZ)
FBO.obj : warning LNK4217: locally defined symbol ___GLEW_EXT_framebuffer_object imported in function "public: __thiscall FBO::FBO(void)" (??0FBO@@QAE@XZ)
WinPBuffer.obj : warning LNK4217: locally defined symbol ___wglewDestroyPbufferARB imported in function "public: virtual __thiscall WinPBuffer::~WinPBuffer(void)" (??1WinPBuffer@@UAE@XZ)
WinPBuffer.obj : warning LNK4217: locally defined symbol ___wglewReleasePbufferDCARB imported in function "public: virtual __thiscall WinPBuffer::~WinPBuffer(void)" (??1WinPBuffer@@UAE@XZ)
WinPBuffer.obj : warning LNK4217: locally defined symbol ___wglewReleaseTexImageARB imported in function "public: virtual void __thiscall WinPBuffer::select(void)" (?select@WinPBuffer@@UAEXXZ)
WinPBuffer.obj : warning LNK4217: locally defined symbol ___wglewBindTexImageARB imported in function "public: virtual void __thiscall WinPBuffer::deselect(void)" (?deselect@WinPBuffer@@UAEXXZ)
WinPBuffer.obj : warning LNK4217: locally defined symbol ___wglewGetPbufferDCARB imported in function "public: __thiscall WinPBuffer::WinPBuffer(int)" (??0WinPBuffer@@QAE@H@Z)
WinPBuffer.obj : warning LNK4217: locally defined symbol ___wglewCreatePbufferARB imported in function "public: __thiscall WinPBuffer::WinPBuffer(int)" (??0WinPBuffer@@QAE@H@Z)
WinPBuffer.obj : warning LNK4217: locally defined symbol ___WGLEW_NV_render_depth_texture imported in function "public: __thiscall WinPBuffer::WinPBuffer(int)" (??0WinPBuffer@@QAE@H@Z)


Top
 Offline Profile  
 
 Post subject:
PostPosted: 28 Jun 2006, 21:03 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
No need to worry I think, MinGW spews out those errors too on linking here and everything seemed to work fine...


Top
 Offline Profile  
 
 Post subject:
PostPosted: 29 Jun 2006, 04:08 
Spring Developer
User avatar

Joined: 13 Nov 2004, 08:35
Location: Central Time Zone, USA
As of revision 1544 I get 6 compile errors in VC03, plus 6 of new warnings complaining about inconsistent dll linkage in the AI interface class destructors.

Code:
rts error LNK2019: unresolved external symbol "__declspec(dllimport) const IAICallback::`vftable'" (__imp_??_7IAICallback@@6B@) referenced in function "public: virtual __thiscall IAICallback::~IAICallback(void)" (??1IAICallback@@UAE@XZ)

rts error LNK2019: unresolved external symbol "__declspec(dllimport) const IAICheats::`vftable'" (__imp_??_7IAICheats@@6B@) referenced in function "public: virtual __thiscall IAICheats::~IAICheats(void)" (??1IAICheats@@UAE@XZ)

rts error LNK2019: unresolved external symbol "__declspec(dllimport) const IGlobalAI::`vftable'" (__imp_??_7IGlobalAI@@6B@) referenced in function "public: virtual __thiscall IGlobalAI::~IGlobalAI(void)" (??1IGlobalAI@@UAE@XZ)

rts error LNK2019: unresolved external symbol "__declspec(dllimport) const IGlobalAICallback::`vftable'" (__imp_??_7IGlobalAICallback@@6B@) referenced in function "public: virtual __thiscall IGlobalAICallback::~IGlobalAICallback(void)" (??1IGlobalAICallback@@UAE@XZ)

rts error LNK2019: unresolved external symbol "__declspec(dllimport) const IGroupAI::`vftable'" (__imp_??_7IGroupAI@@6B@) referenced in function "public: virtual __thiscall IGroupAI::~IGroupAI(void)" (??1IGroupAI@@UAE@XZ)

rts error LNK2019: unresolved external symbol "__declspec(dllimport) const IGroupAICallback::`vftable'" (__imp_??_7IGroupAICallback@@6B@) referenced in function "public: virtual __thiscall IGroupAICallback::~IGroupAICallback(void)" (??1IGroupAICallback@@UAE@XZ)


Top
 Offline Profile  
 
 Post subject:
PostPosted: 29 Jun 2006, 08:53 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
Add BUILDING_SPRING to preprocessor #defines in build options. It's needed to fix up vtables and AIs and stuff.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 30 Jun 2006, 01:39 
Spring Developer
User avatar

Joined: 13 Nov 2004, 08:35
Location: Central Time Zone, USA
That took care of the warnings, but not the errors.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 30 Jun 2006, 14:15 
User avatar

Joined: 05 Jun 2005, 18:13
Location: NL
I seriously think this whole vtable issue needs to be solved on GCC/scons only. There are no problems on VStudio with vtables anyway.
(Why should vs need extra defines when gcc messes it up?)


Top
 Offline Profile  
 
 Post subject:
PostPosted: 30 Jun 2006, 19:32 

Joined: 31 May 2005, 17:06
Location: Manchester
Hi, I've tried compling the source under VS2005 and i get an error about resources.h being missing

It's not there :p

heres the error:

Code:
Compiling resources...
.\rts.rc(3) : fatal error RC1015: cannot open include file 'resource.h'.
Build log was saved at "file://c:\taspring_0.72b1\rts\build\vstudio7\Release\BuildLog.htm"
rts - 1 error(s), 17 warning(s)


if i do a search for "resources" in the source folder, i only get...
\game\gamedata\resources.tdf
\AI\Global\NTAI\resources\
\AI\Global\JCAI\profiles\xta_core_resources.cfg


Top
 Offline Profile  
 
 Post subject:
PostPosted: 30 Jun 2006, 19:55 

Joined: 09 Jan 2006, 17:51
Jonny C wrote:
Hi, I've tried compling the source under VS2005 and i get an error about resources.h being missing

It's not there :p

heres the error:

Code:
Compiling resources...
.\rts.rc(3) : fatal error RC1015: cannot open include file 'resource.h'.
Build log was saved at "file://c:\taspring_0.72b1\rts\build\vstudio7\Release\BuildLog.htm"
rts - 1 error(s), 17 warning(s)


You should be looking for resource.h not resources.h
I would try replacing the path with ../vstudio8/resource.h

I won't have access to internet until Monday. Good luck.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 30 Jun 2006, 20:02 

Joined: 31 May 2005, 17:06
Location: Manchester
t h a n k y o u ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !

8)


Top
 Offline Profile  
 
 Post subject:
PostPosted: 01 Jul 2006, 18:47 

Joined: 19 Aug 2004, 16:38
Location: Togliatti, Russia
I get linker errors with current SVN code, with IAICallback, IAICheats, IGroupAICallback, and IGlobalAICallback seeming to have missing virtual destructors - whatever the "DECLARE_PURE_VIRTUAL" is supposed to be, it doesn't work.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 01 Jul 2006, 19:01 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
which revision? (to make sure you tried the last one)


Top
 Offline Profile  
 
 Post subject:
PostPosted: 01 Jul 2006, 19:04 

Joined: 19 Aug 2004, 16:38
Location: Togliatti, Russia
Just updated, and tried to compile. Should be the latest. Does number 1558 mean anything? :?:


Top
 Offline Profile  
 
 Post subject:
PostPosted: 01 Jul 2006, 19:24 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
yes, thats latest.

Guess MSVC doesn't support (pure) virtual destructors across DLL boundaries at all...

I'll just disable them and reintroduce all potential bugs related to them on MSVC (and MinGW as I couldn't get it to link destructors...). Disabling it is easy now I got it all macrofied anyway.

So try again and it should work.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 01 Jul 2006, 19:31 

Joined: 19 Aug 2004, 16:38
Location: Togliatti, Russia
It might be just VC 2003 that doesn't support them, maybe 2005 does.

In any case, it compiled now, thanks.


Top
 Offline Profile  
 
 Post subject:
PostPosted: 01 Jul 2006, 20:42 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
I thought interface classes shouldnt have destructors, only the classes based on them


Top
 Offline Profile  
 
 Post subject:
PostPosted: 01 Jul 2006, 21:51 
Spring Developer

Joined: 01 Jun 2005, 10:36
Location: The Netherlands
No.

If you don't give a class with any virtual methods no destructor, the compiler will generate a non-virtual empty default one.

This means that if you have an interface class 'Interface' and a pointer to an object which derives from Interface, deleting the pointer will NOT call the destructor of your derived class (possible memory leaks), ie.
Code:
class Interface {
  virtual void foo();
}
class Object:public Interface {
  ~Object() { delete[] data; }
  unsigned char* data;
}
// in a function:
Interface* p = new Object;
delete p; // <-- memory leak ~Object is not called, so data is not deleted


I now (or since a while actually) realise spring was working around this by C style casting the pointer p back to Object*, and then deleting it (in AIs).

This happened to work, but it would silently break and crash hard in case you'd ever use multiple or virtual inheritance.

It'd also leak memory/crash in case you'd set up your AI in certain ways, like having a common CMyAI class (implementing the core of your AI) deriving from IGlobalAI and separate derivatives of CMyAI that specialize it for e.g. metal maps, water maps and normal maps, or different mods.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 582 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8, 9 ... 30  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: Google Feedfetcher and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.