b77 Subj : Re: Library built but Not working To : borland.public.cpp.borlandcpp From : Ed Mulroy [TeamB] Date : Thu Oct 14 2004 11:24 pm Where you declare a global variable does not really matter as long as it is declared in one source file and an extern declaration is provided that is included by all source files which use the variable. In reading what you have written I cannot find a specific statement saying that the code you pulled out worked when in that form it was not in a library. I cannot see any reason why it would change how it operates merely because the object files containing it came from a library. It sounds as if you have not made that test. Remove the library from the project, add the source files that were used for the library to the project and build the executable. My bet is that the problems will remain. What you posted is a bit too confusing for me to figure it out to the point of knowing what the problem you are having is. It is incomplete so won't compile. It appears to use unusual naming conventions where all caps is used for macros but also for an array. That means the other macros might be variables. Declarations such as the array 'timer' are made which, if it really is a pointer to a memory mapped pair of 16 bit registers would make sense but that is only a guess. I wish you luck with it but I can't find what is causing your problem. .. Ed > dkat wrote in message > news:416eb4b6$1@newsgroups.borland.com... > >I will take anything I can get but the only place float > is being used is in a little subroutine that randomizes > an index of numbers. I just stuck this in the library > because it never changes and is used in every program > that uses the DAQ. > > I took a working program and pulled out all of the routines > that had anything to do with the DAQ802 board and put > them in a separate file. So except for how things are > declared and the fact that the routines connected to the > DAQ board are now precompiled there is really no change > in the code. The program runs. I just get garbage played > out and the LCD does not display. > > I know globals are frowned upon but they really are > necessary for ISR and the buffers it uses. These must > come from the main program. I believe that this is where > things are failing when I load the routines as a separate file > with the previous global variables now being treated as > externals in the Main program.... My problem is grasping > where the scope of the variables are and how I should be > declaring them... I am pulling out all of my old books but > nothing really addresses when you are compiling routines > outside of your main code. I ended up declaring the buffer > that holds the sound file as a double pointer in main and > as a fixed array in the library. Perhaps this should be the > other way around.... . 0