About Store Forum Documentation Contact
Donations:
364$/mo



Post Reply 
Help on shared headers
Author Message
Houge Offline
Silver Supporter

Post: #1
Help on shared headers
Hi all!

Please i need some help with shared headers in EE code editor smile
I know that i can create library, but here is the situation i have:

1. I have Client, Login Server and Game Server apps.
2. I have network code (enums etc) that needs to be shared between all apps.
3. I have database headers with custom functions that need to be shared only with 2 server apps.

If i place everything in library files, my Client won't compile without database headers and libraries (cause i don't want to include them in Client app).

What can i do?
(This post was last modified: 09-29-2014 01:02 PM by Houge.)
09-29-2014 01:02 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Help on shared headers
The compilers should always remove unused code, so you can include them in the Client either way.

If not, then you'll have to reorganize your codes somehow so they can compile without the other codes being present. It really depends on the complexity of your project wink
09-29-2014 01:23 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #3
RE: Help on shared headers
Greg, I want to ask you if you can add one thing smile
In application properties it would be great to have "Defines" editbox to make pre-defines for each application separately. In this case i could make "SERVER" define and add "#ifdef" directive in shared headers, i hope you got what i mean smile
(This post was last modified: 09-29-2014 02:50 PM by Houge.)
09-29-2014 02:49 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Help on shared headers
Hi,

You can do that already, just include a header in each app that has the #define macro.
I think this is actually used in ineisis online.
10-01-2014 01:46 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #5
RE: Help on shared headers
Ok that makes sense, just a little bit complicated to move from PC to PC smile
10-01-2014 04:56 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Houge Offline
Silver Supporter

Post: #6
RE: Help on shared headers
(10-01-2014 01:46 AM)Esenthel Wrote:  Hi,

You can do that already, just include a header in each app that has the #define macro.
I think this is actually used in ineisis online.

I figured it out smile
Including headers is too complicated for moving app from PC to PC, but i found the following at the beginning of PostgreSQL header:

Code:
#ifndef LIBPQ_FE_H
#define LIBPQ_FE_H

So this is my #ifdef for database shared headers lol
10-07-2014 06:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply