Re: Improving the structural modularity of MiniMo on Linux ...
Doug Turner <[email protected]> Wed, 06 Apr 2005 16:13:27 -0700
| Newsgroups | gmane.comp.mozilla.devel.small-devices |
|---|---|
| Organization | Another Netscape Collabra Server User |
| Message-ID | <[email protected]> |
Looks like well needed changes. Just a guess here, but it appears that you are building each .cpp as its own application starting with Minimo.cpp. I think you want to drop the SIMPLE_PROGRAMS line since yours isn't a simple program any longer. List all of the code as you are doing under the CPPSRCS. Then do something like: PROGRAM = minimo-bin Let me know if that works. Doug Antonio Gomes wrote: > Hi all, > > > I'am developing few features into MiniMo for Linux-based systems. > Currently, in the source code available at CVS, there is only a CPP file > (Minimo.cpp) and the rest are reader files (.h). But the .h files are > not just headers, as expected. They contain the headers and the > implementation of each fuctions, and there isn't a CPP file > corresponding to each .H (it's not a good practice) :S. > > To solve it, and improving the modularity of MiniMo's source code on > Linux, I'm working on it . Nowadays, I have the following files in the > "app" directory (this version is not in CVS yet because it's still > uninstable) > > "in my computer: " > programmer@Linus:~/MozillaDevel/sources/mozilla/embedding/minimo/app$ ls > > bookmark.cpp history.cpp Makefile.in minimo_context.h > minimo_types.h preference.cpp run_minimo.sh > bookmark.h history.h minimo_callbacks.cpp Minimo.cpp > mozilla_api.cpp preference.h > CVS icons.h minimo_callbacks.h minimo-link-comps > mozilla_api.h Repository > Entries Makefile minimo_context.cpp > package.sh Root > > Disrespecting the the non relevant files and directories (like CVS, > Root, package.sh minimo-link-comps run_minimo.sh, etc), here are just > the CPP and header files (.h): > > "in my computer: " > > programmer@Linus:~/MozillaDevel/sources/mozilla/embedding/minimo/app$ ls > > bookmark.cpp history.cpp Makefile.in minimo_context.h > minimo_types.h preference.cpp bookmark.h history.h > minimo_callbacks.cpp Minimo.cpp mozilla_api.cpp > preference.h minimo_callbacks.h mozilla_api.h Makefile > minimo_context.cpp package.sh > When just existed one CPP file, the piece of code that handlers it in > the Makefile sounds like this: > > "cat in Makefile:" > CPPSRCS = Minimo.cpp > SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=) > > After my changes, this piece looks like: > > "cat in Makefile:" > CPPSRCS = Minimo.cpp \ > mozilla_api.cpp \ > bookmark.cpp \ > history.cpp \ > minimo_callbacks.cpp \ > minimo_context.cpp \ > preference.cpp > SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=) > > ( it's similar with the Makefile of the TestGtkEmbed application > ->/mozilla/embedding/browser/gtk/tests ) > > When I try to compile MiniMo (typing 'make'), the following errors return: > > > (...) > Minimo.o(.text._Z13handle_remotei+0x148): In function `handle_remote(int)': > : undefined reference to `set_browser_visibility(_MinimoBrowser*, int)' > Minimo.o(.text.main+0xd9): In function `main': > : undefined reference to `read_minimo_config()' > Minimo.o(.text.main+0xee): In function `main': > : undefined reference to `set_browser_visibility(_MinimoBrowser*, int)' > Minimo.o(.text.main+0xfe): In function `main': > : undefined reference to `initialize_bookmark(_GtkWidget*)' > Minimo.o(.text._Z15new_gtk_browserj+0x1aa): In function > `new_gtk_browser(unsigned)': > : undefined reference to `open_new_tab_cb(_GtkMenuItem*, _MinimoBrowser*)' > Minimo.o(.text._Z23open_bookmark_window_cbP12_GtkMenuItemP14_MinimoBrowser+0x7): > In function `open_bookmark_window_cb(_GtkMenuItem*, _MinimoBrowser*)': > : undefined reference to `open_bookmark()' > Minimo.o(.text._Z15pref_clicked_cbP10_GtkButtonP14_MinimoBrowser+0xf): > In function `pref_clicked_cb(_GtkButton*, _MinimoBrowser*)': > : undefined reference to `build_pref_window(_GtkWidget*)' > Minimo.o(.text._Z20populate_menu_buttonP14_MinimoBrowser+0xe7): In > function `populate_menu_button(_MinimoBrowser*)': > : undefined reference to `open_new_tab_cb(_GtkMenuItem*, _MinimoBrowser*)' > Minimo.o(.text._Z20populate_menu_buttonP14_MinimoBrowser+0x282): In > function `populate_menu_button(_MinimoBrowser*)': > : undefined reference to `add_bookmark_cb(_GtkWidget*, _GtkWidget*)' > Minimo.o(.text._Z22create_minimo_progressP14_MinimoBrowser+0x332): In > function `create_minimo_progress(_MinimoBrowser*)': > : undefined reference to `location_changed_cb(_GtkMozEmbed*, _GtkLabel*)' > Minimo.o(.text._Z21increase_font_size_cbP12_GtkMenuItemP14_MinimoBrowser+0x47): > In function `increase_font_size_cb(_GtkMenuItem*, _MinimoBrowser*)': > : undefined reference to `mozilla_preference_set_int(char const*, int)' > Minimo.o(.text._Z21increase_font_size_cbP12_GtkMenuItemP14_MinimoBrowser+0x79): > In function `increase_font_size_cb(_GtkMenuItem*, _MinimoBrowser*)': > : undefined reference to `mozilla_preference_set_int(char const*, int)' > Minimo.o(.text._Z21decrease_font_size_cbP12_GtkMenuItemP14_MinimoBrowser+0x47): > In function `decrease_font_size_cb(_GtkMenuItem*, _MinimoBrowser*)': > : undefined reference to `mozilla_preference_set_int(char const*, int)' > Minimo.o(.text._Z21decrease_font_size_cbP12_GtkMenuItemP14_MinimoBrowser+0x79): > In function `decrease_font_size_cb(_GtkMenuItem*, _MinimoBrowser*)': > : undefined reference to `mozilla_preference_set_int(char const*, int)' > Minimo.o(.text._Z19open_history_windowP10_GtkButtonP14_MinimoBrowser+0x10): > In function `open_history_window(_GtkButton*, _MinimoBrowser*)': > : undefined reference to `view_history(_GtkWidget*)' > Minimo.o(.text._Z14switch_page_cbP12_GtkNotebookP16_GtkNotebookPagejP14_MinimoBrowser+0x44): > In function `switch_page_cb(_GtkNotebook*, _GtkNotebookPage*, unsigned, > _MinimoBrowser*)': > : undefined reference to `initialize_bookmark(_GtkWidget*)' > Minimo.o(.text._Z13on_save_ok_cbP10_GtkWidgetS0_+0x7c): In function > `on_save_ok_cb(_GtkWidget*, _GtkWidget*)': > : undefined reference to `mozilla_save(_GtkMozEmbed*, char*, int)' > Minimo.o(.text._Z17find_dialog_ok_cbP10_GtkWidgetS0_+0xf7): In function > `find_dialog_ok_cb(_GtkWidget*, _GtkWidget*)': > : undefined reference to `mozilla_find(_GtkMozEmbed*, char const*, int, > int, int, int, int, int)' > collect2: ld returned 1 exit status > make[1]: ** [Minimo] Erro 1 > make[1]: Leaving directory > `/home/agomes/MozillaDevel/sources/mozilla/embedding/minimo/app' > make: ** [all] Erro 2 > > So, Minimo.cpp can't link with others files although it's including then > ... I think the problem could be solved woth some modification on the > Makefile file ... Any suggestion !? > > Sorry for the long email and for my bad english :S > > Best Regards >