You CAN share globals. That is... mutliple libraries can access these globals.
Similar to you, I have a 120K library that various applications share. It is in ONE project file. It is not multi segment, as it outputs two lib files. The applications put the lib's into seperate segments. And yes, there is global data and function sharing going back and forth between these two lib files via the includes. Try it and you will start to understand.... -----Original Message----- From: Petrus Wrangö [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 10:34 AM To: Palm Developer Forum Subject: RE: Multi segment shared libraries It seems there are allways other ways of doing things, but the way I planed my project I need to generate one big shared library of all of my 140Kb code. Maybe I'm missing something, I'm really not quite sure about the difference 'shared library'/'library'. I want to replace another shared library with my 140Kb code using a patch so that when an application try to load a specific library my library is loaded instead. This was no problem until my code reached size +64K (or whatever). I can't have multiple libraries sharing global variables, can I? -----Original Message----- From: Rick Gadbois [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 4:07 PM To: Palm Developer Forum Subject: RE: Multi segment shared libraries Are you making a library (.lib) of shared code? This is one common practice, but not an absolute. To adress your issues: 1. You can use shared globals through your include files. 2. Segments cannot be larger than 64K, so yes, you need to segment your code which takes about a minute once you've done it, as I explained earlier. 3. To go further, if you are breaking your code into lib files, each lib cannot be larger than 64K, as you will be including each lib in a seperate segment in your app file, in whch case you must create multiple targets. That should be the info you need...which part do you not understand? and I will explain if I can. Rick Gadbois PHT Corporation Boston MA 617-973-1736 [EMAIL PROTECTED] -----Original Message----- From: Petrus Wrangö [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 9:53 AM To: Palm Developer Forum Subject: RE: Multi segment shared libraries I REALLY don't think I can break it apart, since all these lovely methods share global variables. And I read somewhere in the archive that shared libraries can not be larger than 64k. I'm open to suggestion! How can I access my 'shared' code in some other clever way? Petrus -----Original Message----- From: Rick Gadbois [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 3:46 PM To: Palm Developer Forum Subject: RE: Multi segment shared libraries In that case go to segments, create the new segment (project menu) and drag the files you want there. I have ~300k programs that use a shared library. The shared library being one project file outputting two libs. It IS one large shared library, but if you're going to share 140K of code, you need to break it up somehow. -----Original Message----- From: Petrus Wrangö [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 9:33 AM To: Palm Developer Forum Subject: RE: Multi segment shared libraries hmm.. thanks, no, I need it to be ONE large shared library. BTW I estimate the size to 140Kb -----Original Message----- From: Rick Gadbois [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 3:29 PM To: Palm Developer Forum Subject: RE: Multi segment shared libraries As Eric stated before: Say your library project has 12 .c files (f1 to f12). Create 2 new targets (project menu), so you now have 3 targets: lib1, lib2 and lib3 Using the project inspector (Window menu), assign files 1 to 4 to lib1 only, files 5 to 8 to lib2 only etc... Include the 3 libs in your app project. -----Original Message----- From: Petrus Wrangö [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 29, 2000 9:23 AM To: Palm Developer Forum Subject: Multi segment shared libraries I've searched the archive, and there are some questions related to this, but I can't figure it out. My shared library has grown very large, and I can no longer compile it. I'm getting all kinds of strange link errors. I've tried to make it multi segment, And the closest I've got is by using these settings: 68K Target: Project type: Library PalmOS Library The linker then complain it cant find a tmp file: Link Error : Could not open file: D:\myprojectpath\RESOURCE.FRK\Starter.tmp I'm not sure what settings I should have when building shared libraries, nor what type it should be. Does it even matter? I've managed to make shared libraries before (just not this big) using type 'libr', and not 'shlb'. What should it be? I've also got some mighty strange messages while trying different settings. Suddenly the compiler run in to trouble in Pilot.h not being able to include some files. Link error on this line for example: #include "Pilot.h.sim.mch" Am I making ANY sense? :) I'm really not sure what to ask for, I just want my large shared library compiled! Please give me a hint! Petrus -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
