Page 1 of 1

Make errors.

Posted: Thu Nov 29, 2012 9:32 am
by Clint_Thomas
Not sure what is going on here, any help would be greatly appreciated. Thanks (linuxmint64)

mv -f $depbase.Tpo $depbase.Po
src/gfx/cockpit_xml.cpp:194:37: error: ‘WARP_READY’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:195:37: error: ‘WARP_UNREADY’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:196:37: error: ‘WARP_ENGAGED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:197:37: error: ‘WARP_DISENGAGED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:198:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:199:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:200:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:201:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:202:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:203:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:204:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:205:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:206:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:207:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:208:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:209:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:210:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:211:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:212:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:213:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:214:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:215:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:216:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:217:37: error: ‘WARP_LOOP0’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:219:37: error: ‘ASAP_ENGAGED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:220:37: error: ‘ASAP_DISENGAGED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:221:46: error: ‘ASAP_DOCKING_AVAILABLE’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:222:46: error: ‘ASAP_DOCKING_ENGAGED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:223:46: error: ‘ASAP_DOCKING_DISENGAGED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:224:46: error: ‘FLIGHT_COMPUTER_ENABLED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:225:46: error: ‘FLIGHT_COMPUTER_DISABLED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:227:41: error: ‘DOCK_AVAILABLE’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:228:41: error: ‘DOCK_UNAVAILABLE’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:229:41: error: ‘DOCK_FAILED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:230:41: error: ‘JUMP_AVAILABLE’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:231:41: error: ‘JUMP_UNAVAILABLE’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:232:41: error: ‘JUMP_FAILED’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:234:41: error: ‘LOCK_WARNING’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:235:41: error: ‘MISSILELOCK_WARNING’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:236:41: error: ‘EJECT_WARNING’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp: In member function ‘virtual void GameCockpit::beginElement(const string&, const XMLSupport::AttributeList&)’:
src/gfx/cockpit_xml.cpp:372:32: warning: converting ‘false’ to pointer type ‘VSSprite*’ [-Wconversion-null]
src/gfx/cockpit_xml.cpp:633:13: error: ‘EVENTID’ was not declared in this scope
src/gfx/cockpit_xml.cpp:633:21: error: expected ‘;’ before ‘event’
src/gfx/cockpit_xml.cpp:645:21: error: ‘event’ was not declared in this scope
src/gfx/cockpit_xml.cpp:645:30: error: ‘EVENTID’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:645:48: error: expected ‘;’ before ‘attribute_map’
src/gfx/cockpit_xml.cpp:655:40: error: ‘event’ was not declared in this scope
src/gfx/cockpit_xml.cpp:655:63: error: ‘NUM_EVENTS’ is not a member of ‘Cockpit’
src/gfx/cockpit_xml.cpp:656:81: error: ‘SetSoundForEvent’ was not declared in this scope
make[1]: *** [src/gfx/cockpit_xml.o] Error 1
make[1]: Leaving directory `/home/svartalf/VegaStrike/vegastrike'
make: *** [all] Error 2

Re: Make errors.

Posted: Thu Nov 29, 2012 3:19 pm
by klauss
Seems like a mixed-state working directory.

Did you try a fresh checkout?

Re: Make errors.

Posted: Thu Nov 29, 2012 3:51 pm
by Clint_Thomas
Just finished restoring my system and did a fresh checkout prior to getting the above errors. I will try to start from scratch again and see how it goes.

Thanks Klauss

Re: Make errors.

Posted: Thu Nov 29, 2012 4:14 pm
by klauss
I just checked svn log and it could also be rev 13452. If it still fails, try reverting to 13451.

Re: Make errors.

Posted: Thu Nov 29, 2012 4:38 pm
by log0
phoenixstorm introduced CLIENT and SERVER defines some time ago, linux build scripts need to be updated.

Re: Make errors.

Posted: Thu Nov 29, 2012 5:37 pm
by klauss
log0 wrote:phoenixstorm introduced CLIENT and SERVER defines some time ago, linux build scripts need to be updated.
I'm not sure it's that advisable, there are some files that are shared between client and server, and if they conditionally build some code depending on those defines it could be troublesome.

Re: Make errors.

Posted: Thu Nov 29, 2012 5:50 pm
by pheonixstorm
Actually just CLIENT, SERVER seems to introduce bugs in the server compile so have to figure something else out on that side.. but yeah, CLIENT is a must to keep some things out of the server code such as the new sound code klauss introduced. It was originally supposed to be windows only but now it will need to be for all OSes

Re: Make errors.

Posted: Thu Nov 29, 2012 6:12 pm
by klauss
The new sound code is divided into AL-agnostic code (that can sit on server code rather safely, and is in fact necessary to be able to parse some xml files too), and AL-specific code (that is only linked with the client).

So you shouldn't need to do that. If I messed up somewhere, we can fix it within the current design without resorting to defines.

Note, though, that I always build both client and server (to make sure I don't break the server). So it's probably a build environment thing, not a code thing.

Re: Make errors.

Posted: Thu Nov 29, 2012 6:15 pm
by log0
pheonixstorm wrote:Actually just CLIENT, SERVER seems to introduce bugs in the server compile so have to figure something else out on that side.. but yeah, CLIENT is a must to keep some things out of the server code such as the new sound code klauss introduced. It was originally supposed to be windows only but now it will need to be for all OSes
Ah, thanks for the correction. Got it confused with the char SERVER = 0; global. Whatever it is meant to achieve. It has got a rather unfortunate name.

Re: Make errors.

Posted: Thu Nov 29, 2012 6:21 pm
by pheonixstorm
It wasn't much code and only from cockpit_generic.cpp

Code: Select all

--- trunk/vegastrike/src/gfx/cockpit_generic.cpp	2012/07/16 03:50:55	13388
+++ trunk/vegastrike/src/gfx/cockpit_generic.cpp	2012/11/28 03:28:34	13452
@@ -957,6 +957,7 @@
     return name;
 }
 
+#ifdef CLIENT
 SoundContainer* Cockpit::GetSoundForEvent(Cockpit::EVENTID eventId) const
 {
     if (eventId < sounds.size())
@@ -976,3 +977,4 @@
 {
     return new SoundContainer(specs);
 }
+#endif
and cockpit_generic.h

Code: Select all

--- trunk/vegastrike/src/gfx/cockpit_generic.h	2012/07/16 03:50:55	13388
+++ trunk/vegastrike/src/gfx/cockpit_generic.h	2012/11/28 03:28:34	13452
@@ -35,7 +35,8 @@
 class Cockpit
 {
 public:
-    ///cockpit events
+    ///cockpit events. Not needed in server
+#ifdef CLIENT
     enum EVENTID {
         EVENTID_FIRST, 
         
@@ -114,7 +115,8 @@
         /// Just after all valid values
         NUM_EVENTS
     };
-    
+#endif
+
 protected:
     ///style of current view (chase cam, inside)
     enum VIEWSTYLE view;
@@ -336,6 +338,7 @@
     virtual void SetCommAnimation( Animation *ani, Unit *un ) {}
     virtual void SetStaticAnimation() {}
     
+#ifdef CLIENT
     /**
      * Retrieves the sound associated to the given event.
      * Returns NULL if no sound has been associated
@@ -347,7 +350,8 @@
      * (the actual container will be a different, implementation-specific one)
      */
     void SetSoundForEvent(EVENTID eventId, const SoundContainer &soundSpecs);
-    
+#endif
+
     class SaveGame*savegame;
 
     ///Accesses the current navigationsystem
@@ -400,10 +404,12 @@
     virtual void OnDockEnd(Unit *, Unit *) {}
     virtual void OnJumpBegin(Unit *) {}
     virtual void OnJumpEnd(Unit *) {}
-    
+
+#ifdef CLIENT
 protected:
     /// Override to use a specific kind of sound implementation
     virtual SoundContainer* soundImpl(const SoundContainer &specs);
+#endif
 };
 #endif
This is why i recompile both vegastrike and vegaserver after code changes. Change one and it might break the other.

Re: Make errors.

Posted: Thu Nov 29, 2012 6:24 pm
by pheonixstorm
Before my defines I was getting linker errors over soundcontainer if that helps.

Re: Make errors.

Posted: Thu Nov 29, 2012 6:50 pm
by klauss
pheonixstorm wrote:Before my defines I was getting linker errors over soundcontainer if that helps.
You may be missing soundcontainer_generic.cpp on the project file.

Re: Make errors.

Posted: Thu Nov 29, 2012 8:10 pm
by pheonixstorm
Do we really need that for the server though?

Re: Make errors.

Posted: Thu Nov 29, 2012 8:21 pm
by klauss
You need to maintain binary compatibility between the _generic compilation units.

If you remove soundcontainer stuff, cockpit_generic is no longer binary compatible between client and server.

Windows will probably build separately for server and client (ie: build _generic units twice), but linux does share them.

Re: Make errors.

Posted: Thu Nov 29, 2012 9:14 pm
by pheonixstorm
Thats why I decided to use the ifdef. The server code doesn't need sound event while the client does. Though I wrongly assumed that the CLIENT define from my earlier win32 code would have also been used for all OSes. I can add the required files into the win32 build but I don't see any real need for it to be there on any build since the server does use sound events. Same for a lot of things. Doesn't need to render anything or use any shaders.. no need for sound, though it may need mesh code if it does any collision testing (and it has access to a collision mesh).

Re: Make errors.

Posted: Thu Nov 29, 2012 9:51 pm
by klauss
pheonixstorm wrote:Thats why I decided to use the ifdef. The server code doesn't need sound event while the client does. Though I wrongly assumed that the CLIENT define from my earlier win32 code would have also been used for all OSes. I can add the required files into the win32 build but I don't see any real need for it to be there on any build since the server does use sound events. Same for a lot of things. Doesn't need to render anything or use any shaders.. no need for sound, though it may need mesh code if it does any collision testing (and it has access to a collision mesh).
The vtables need to match. The "add blabla" you ifdeffed out is virtual.

Re: Make errors.

Posted: Thu Nov 29, 2012 10:27 pm
by pheonixstorm
Soo what will be the best solution? sound container isn't needed for server so how should we keep it out then?

Re: Make errors.

Posted: Thu Nov 29, 2012 10:39 pm
by klauss
I think the way it is now.

I tried other ways, and this is the best one for linux, because XML stuff happens on generic units, and generic ones don't get special treatment in linux (they're built without CLIENT define and can't be built with it because they're used by both client and server).

If you really really want to avoid populating sound event structures, that whole part could be factored out into a generic/server/client triplet, including data, and the server part made into a no-op. But it's quite some work for nothing, there's only a couple of those ever (cockpits are only instanced for players).

Re: Make errors.

Posted: Fri Nov 30, 2012 1:01 am
by pheonixstorm
So no real easy fix unless we wrap it up in a win32 ifdef followed by client to keep linux/osx safe, but whats the point... Well, time to find what out of that file is actually used or needed for the server in those files.

Re: Make errors.

Posted: Fri Nov 30, 2012 1:45 am
by klauss
pheonixstorm wrote:So no real easy fix unless we wrap it up in a win32 ifdef followed by client to keep linux/osx safe, but whats the point... Well, time to find what out of that file is actually used or needed for the server in those files.
Do notice, though, that SoundContainer (soundcontainer_generic.cpp) is quite light already. It implements the basic interface without any play/stop stuff, only wrapping all the information on the XML. It really is low-overhead, except for being there.

The only benefit in the refactor I mentioned would be to save up a few bytes (probably not even a few kb) of memory in the sounds vector.

Re: Make errors.

Posted: Fri Nov 30, 2012 2:03 am
by pheonixstorm
Not really worried about saving a few kb, at least in file size. I'm more concerned with the code being bloated by a lot of stuff that isn't needed or used and becoming even more confusing. Its great they share a lot of common code, I just think we need to watch what is common and what is exclusive.

Re: Make errors.

Posted: Fri Nov 30, 2012 2:24 am
by klauss
Then really really add soundcontainer_generic.cpp to the project and avoid the humongus complication of ifdeffing stuf. Really.

It wouldn't hurt to add a ticket somewhere noting that we need to refactor things a bit to make the client/server separation cleaner. All this generic/client/server stuff is neat, except it's sprinkled in random places.

Generic should be really generic and contain no client or server-specific code or interfaces. In this sound case, a builder for reading xml would have solved these issues (server builder ignores sound xml, creates server subclasses, client builder doesn't, creates client classes).

Re: Make errors.

Posted: Sat Dec 01, 2012 8:39 am
by Clint_Thomas
Did a fresh svn update this morning. The build went flawlessly. Thank you so much Pheonixstorm and Klauss