For any two ends, it's hard to tell if they are connected.Īlso, if you have a class that has some notion of its parent, you can keep a pointer as a member variable for internal use in the class. IIRC, having many global variables and using them in too many places is called spaghetti design. A global variable is easy to use from anywhere in your program. That's true, but it's a disadvantage as well. Mikecoon wrote:Besides, they are easier to use then using Getparent pointers when you have classes within classes etc. So anyone have any idea what is going on here? Semaphore m_tags *this is where error occurs the actual spreadsheet inside the spreadsheet page of the notebook SCA_spreadsheet_page *m_SCA_spreadsheet_page SongCollection m_filtered_song_collection file with extern keywords for all the other. want all classes to access these variables. declared my global variable here to make sure memory is allocated for it Here is the first few lines of the SCA_Main_Frame.cpp file that contains the error: This tag is used when insert song button or add song button is clicked
#Compiling semaphor c update
this tag activates the use previous buttons and update the total time. same as is file is open tag except for the filtered database This prevents the program from crashing
![compiling semaphor c compiling semaphor c](https://i.stack.imgur.com/MakjR.png)
If file is not open, functions are disabled. GUI_classes/SCA_Main_Frame.cpp:33: error: `Semaphore' does not name a type
![compiling semaphor c compiling semaphor c](https://i.stack.imgur.com/bYtxw.jpg)
G++.exe -c GUI_classes/SCA_Main_Frame.cpp -o GUI_classes/SCA_Main_Frame.o -I"F:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"F:/Dev-Cpp/include/c++/3.4.2/backward" -I"F:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"F:/Dev-Cpp/include/c++/3.4.2" -I"F:/Dev-Cpp/include" -I"F:/Dev-Cpp/include/wx/msw" -I"F:/Dev-Cpp/include/wx/generic" -I"F:/Dev-Cpp/include/wx/animate" -I"F:/Dev-Cpp/include/wx/fl" -I"F:/Dev-Cpp/include/wx/gizmos" -I"F:/Dev-Cpp/include/wx/html" -I"F:/Dev-Cpp/include/wx/mmedia" -I"F:/Dev-Cpp/include/wx/net" -I"F:/Dev-Cpp/include/wx/ogl" -I"F:/Dev-Cpp/include/wx/plot" -I"F:/Dev-Cpp/include/wx/protocol" -I"F:/Dev-Cpp/include/wx/stc" -I"F:/Dev-Cpp/include/wx/svg" -I"F:/Dev-Cpp/include/wx/xml" -I"F:/Dev-Cpp/include/wx/xrc" -I"F:/Dev-Cpp/include/wx" -I"F:/C++Programs/SCA_V4/GUI_classes" -I"F:/C++Programs/SCA_V4/Song_related_classes" -I"F:/C++Programs/SCA_V4" -I"F:/C++Programs/SCA_V4/Miscellaneous_Classes" -fno-rtti -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall -D_WXMSW_ -D_GNUWIN32_ -D_WIN95_ -fexpensive-optimizations -O3 G++.exe -c GUI_classes/SCA_dialog_page.cpp -o GUI_classes/SCA_dialog_page.o -I"F:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"F:/Dev-Cpp/include/c++/3.4.2/backward" -I"F:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"F:/Dev-Cpp/include/c++/3.4.2" -I"F:/Dev-Cpp/include" -I"F:/Dev-Cpp/include/wx/msw" -I"F:/Dev-Cpp/include/wx/generic" -I"F:/Dev-Cpp/include/wx/animate" -I"F:/Dev-Cpp/include/wx/fl" -I"F:/Dev-Cpp/include/wx/gizmos" -I"F:/Dev-Cpp/include/wx/html" -I"F:/Dev-Cpp/include/wx/mmedia" -I"F:/Dev-Cpp/include/wx/net" -I"F:/Dev-Cpp/include/wx/ogl" -I"F:/Dev-Cpp/include/wx/plot" -I"F:/Dev-Cpp/include/wx/protocol" -I"F:/Dev-Cpp/include/wx/stc" -I"F:/Dev-Cpp/include/wx/svg" -I"F:/Dev-Cpp/include/wx/xml" -I"F:/Dev-Cpp/include/wx/xrc" -I"F:/Dev-Cpp/include/wx" -I"F:/C++Programs/SCA_V4/GUI_classes" -I"F:/C++Programs/SCA_V4/Song_related_classes" -I"F:/C++Programs/SCA_V4" -I"F:/C++Programs/SCA_V4/Miscellaneous_Classes" -fno-rtti -fno-exceptions -fno-pcc-struct-return -fstrict-aliasing -Wall -D_WXMSW_ -D_GNUWIN32_ -D_WIN95_ -fexpensive-optimizations -O3 Rm -f GUI_classes/SCA_dialog_page.o GUI_classes/SCA_Main_Frame.o GUI_classes/SCA_notebook.o GUI_classes/SCA_spreadsheet_page.o Song_related_classes/Song.o Song_related_classes/SongCollection.o Miscellaneous_Classes/InputChecker.o Miscellaneous_Classes/Semaphore.o Miscellaneous_Classes/TimeL.o Song_Collection_Analyzer_V4_private.res Song_Collection_Analyzer_V4.exe Okay I added a Semaphore class to my project and when I compile, I get the following error : 'Semaphore' does not name a type'īuilding Makefile: "F:\C++Programs\SCA_V4\Makefile.win"