For now, just to make it as simple as possible and to remove any =
extraneous decls that might be throwing things awry, what I'd suggest is =
removing any reference to your global songCounter from the header files =
and then, in the source files only:
- In exactly 1 (one) source file, somewhere near the top, in global =
scope (i.e. not inside any function or class or struct...) make the =
formal declaration for songCounter, like...
int songCounter =3D 0;
Then, in every other file that needs to access that global, near the =
top, in global scope, put...
extern int songCounter;
And you *should* be good to go - then every file will be explicitly =
referencing the one formally declared songCounter.
If that still does not work, then show us some code.
HTH,
--=20
Ian
__________________________________________________________
Thanks for the responses.
I only have one source file, and I have the declaration at the top as you said.
I'm a bit confused about your suggestion about the formal declaration being
int songCounter =3D 0;
What does the 3D mean? Sorry if this should be obvious, I'm somewhat new to
programming.
Here's a rough outline of my program:
(include libraries here)
int songCounter = 0;
void getTitle(songCounter); //This contains code on how to get the title of the
song by comparing the songCounter to an array for a built in playlist
OutputStreamPtr sound(getTitle(songCounter));
void play_sound(); //Uses the audiere library to start playing the song by
using the sound object.
int main()
Double Window
Button "Play" //Callback function calls play_sound
Button "Back" //Callback function decrements songCounter
Button "Fwd" //Callback function increments songCounter
I uploaded my .fl file as a .txt file so you could see it on Google Docs:
https://docs.google.com/file/d/0B0u4PyzMbkf-ZDF0cnVudEpvTzA/edit
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk