Improving the structural modularity of MiniMo on Linux ...

Antonio Gomes <[email protected]> Wed, 06 Apr 2005 18:25:54 -0400
Newsgroups gmane.comp.mozilla.devel.small-devices
Message-ID <[email protected]>
Hi all,


I'am developing few  features into MiniMo for Linux-based systems.=20
Currently, in the source code available at CVS, there is only a CPP file=20
(Minimo.cpp) and the rest are reader files (.h). But the .h files are=20
not just headers, as expected. They  contain the headers and the=20
implementation of each fuctions, and there isn't a CPP file=20
corresponding to each .H (it's not a good practice) :S.

To solve it, and improving the modularity of MiniMo's source code on=20
Linux, I'm working on it . Nowadays, I have the following files in the=20
"app" directory (this version is not in CVS yet because it's still=20
uninstable)

"in my computer: "
programmer@Linus:~/MozillaDevel/sources/mozilla/embedding/minimo/app$ ls

bookmark.cpp  history.cpp  Makefile.in           minimo_context.h  =20
minimo_types.h   preference.cpp  run_minimo.sh
bookmark.h    history.h    minimo_callbacks.cpp  Minimo.cpp        =20
mozilla_api.cpp  preference.h
CVS           icons.h      minimo_callbacks.h    minimo-link-comps =20
mozilla_api.h    Repository
Entries       Makefile     minimo_context.cpp           =20
package.sh       Root

Disrespecting the the non relevant files and directories (like CVS,=20
Root, package.sh minimo-link-comps run_minimo.sh, etc), here are just=20
the CPP and header files (.h):

    "in my computer: "
    =20
programmer@Linus:~/MozillaDevel/sources/mozilla/embedding/minimo/app$ ls

     bookmark.cpp  history.cpp  Makefile.in           minimo_context.h  =20
minimo_types.h   preference.cpp   =20
     bookmark.h    history.h    minimo_callbacks.cpp  Minimo.cpp      =20
     mozilla_api.cpp  preference.h  minimo_callbacks.h   mozilla_api.h =20
Makefile minimo_context.cpp         =20
     package.sh     =20

When just existed one CPP file, the piece of code that handlers it in=20
the Makefile sounds like this:

"cat in Makefile:"
    CPPSRCS        =3D Minimo.cpp
       =20
    SIMPLE_PROGRAMS =3D $(CPPSRCS:.cpp=3D)

After my changes, this piece looks like:

    "cat in Makefile:"
    CPPSRCS        =3D Minimo.cpp \
            mozilla_api.cpp \
            bookmark.cpp \
            history.cpp  \
            minimo_callbacks.cpp \
            minimo_context.cpp \
            preference.cpp
        =20
    SIMPLE_PROGRAMS =3D $(CPPSRCS:.cpp=3D)

( it's similar with the Makefile of the TestGtkEmbed application=20
->/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=20
`new_gtk_browser(unsigned)':
: undefined reference to `open_new_tab_cb(_GtkMenuItem*, _MinimoBrowser*)=
'
Minimo.o(.text._Z23open_bookmark_window_cbP12_GtkMenuItemP14_MinimoBrowse=
r+0x7):=20
In function `open_bookmark_window_cb(_GtkMenuItem*, _MinimoBrowser*)':
: undefined reference to `open_bookmark()'
Minimo.o(.text._Z15pref_clicked_cbP10_GtkButtonP14_MinimoBrowser+0xf):=20
In function `pref_clicked_cb(_GtkButton*, _MinimoBrowser*)':
: undefined reference to `build_pref_window(_GtkWidget*)'
Minimo.o(.text._Z20populate_menu_buttonP14_MinimoBrowser+0xe7): In=20
function `populate_menu_button(_MinimoBrowser*)':
: undefined reference to `open_new_tab_cb(_GtkMenuItem*, _MinimoBrowser*)=
'
Minimo.o(.text._Z20populate_menu_buttonP14_MinimoBrowser+0x282): In=20
function `populate_menu_button(_MinimoBrowser*)':
: undefined reference to `add_bookmark_cb(_GtkWidget*, _GtkWidget*)'
Minimo.o(.text._Z22create_minimo_progressP14_MinimoBrowser+0x332): In=20
function `create_minimo_progress(_MinimoBrowser*)':
: undefined reference to `location_changed_cb(_GtkMozEmbed*, _GtkLabel*)'
Minimo.o(.text._Z21increase_font_size_cbP12_GtkMenuItemP14_MinimoBrowser+=
0x47):=20
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):=20
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):=20
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):=20
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=
):=20
In function `open_history_window(_GtkButton*, _MinimoBrowser*)':
: undefined reference to `view_history(_GtkWidget*)'
Minimo.o(.text._Z14switch_page_cbP12_GtkNotebookP16_GtkNotebookPagejP14_M=
inimoBrowser+0x44):=20
In function `switch_page_cb(_GtkNotebook*, _GtkNotebookPage*, unsigned,=20
_MinimoBrowser*)':
: undefined reference to `initialize_bookmark(_GtkWidget*)'
Minimo.o(.text._Z13on_save_ok_cbP10_GtkWidgetS0_+0x7c): In function=20
`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=20
`find_dialog_ok_cb(_GtkWidget*, _GtkWidget*)':
: undefined reference to `mozilla_find(_GtkMozEmbed*, char const*, int,=20
int, int, int, int, int)'
collect2: ld returned 1 exit status
make[1]: ** [Minimo] Erro 1
make[1]: Leaving directory=20
`/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=20
... I think the problem could be solved woth some modification on the=20
Makefile file ... Any suggestion !?

Sorry for the long email and for my bad english :S

Best Regards

--=20

---------------------------
 .''`.     Ant=F4nio Gomes de A. Netto
 : :'  :   Embedded Linux Developer
  . `'`    <[email protected]>
   `- Debian - when you have better things to do than fixing a system

Embedded Linux Lab (10LE)
Instituto Nokia de Tecnologia (INdT)
Nokia Technology Institute
Manaus / Brazil