Tiny Core Linux
General TC => Programming & Scripting - Unofficial => Topic started by: quanpin on April 18, 2012, 12:31:55 AM
-
1. I try to complie fltk_projects ,but can't compile the "help.cxx" file.
tc@box:~$ fltk-config --compile help.cxx
g++ -march=i486 -mtune=i686 -Os -pipe -D_THREAD_SAFE -D_REENTRANT -o help help.cxx /usr/lib/libfltk.a -lpthread -ldl -lm -lXext -lX11
/tmp/ccNuwGGI.o: In function `main':
help.cxx:(.text.startup+0x29): undefined reference to `Fl_Help_Dialog::Fl_Help_Dialog()'
help.cxx:(.text.startup+0x43): undefined reference to `Fl_Help_Dialog::load(char const*)'
help.cxx:(.text.startup+0x4d): undefined reference to `Fl_Help_Dialog::textsize(unsigned char)'
help.cxx:(.text.startup+0x59): undefined reference to `Fl_Help_Dialog::show(int, char**)'
help.cxx:(.text.startup+0x6e): undefined reference to `Fl_Help_Dialog::~Fl_Help_Dialog()'
collect2: ld returned 1 exit status
tc@box:~$
and I compiled it in ubuntu also like this.
2 . the other cxx file can compiled , but the exefile are more bigger than tc's . like
use " fltk-config --compile editor.cxx "
the "editor" is 375.55KB , but the TC's is 14404 B , Why it's more bigger than TC.
thankx
-
Hi quanpin
the "editor" is 375.55KB , but the TC's is 14404 B , Why it's more bigger than TC.
Did you remember to run strip editor
-
I can't find my notes for help.xx, but does something of this form do the trick:
g++ -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti -fpic -L/usr/lib -lfltk -lfltk_images -lfltk_forms -lpng -o mnttool mnttool.cxx
-
I try to run "strip editor" , the exefile size from 375.55KB change to 291.91KB. but the tc's 14.07KB.
tc@box:~$ fltk-config --compile editor.cxx
g++ -march=i486 -mtune=i686 -Os -pipe -D_THREAD_SAFE -D_REENTRANT -o editor editor.cxx /usr/lib/libfltk.a -lpthread -ldl -lm -lXext -lX11
tc@box:~$ strip editor
2. And the help.cxx code
#include <FL/Fl_Help_Dialog.H>
#include <iostream>
using namespace std;
//
// 'main()' - Display the help GUI...
//
int // O - Exit status
main(int argc, // I - Number of command-line arguments
char *argv[]) // I - Command-line arguments
{
Fl_Help_Dialog *help; // Help dialog
help = new Fl_Help_Dialog;
if (argc < 2)
help->load("/usr/share/doc/tc/help.html");
else
help->load(argv[1]);
help->textsize(15);
help->show(1, argv);
Fl::run();
delete help;
return (0);
}
//
// End of "$Id: help.cxx 5519 2006-10-11 03:12:15Z mike $".
//
-
:) thanks
I found fluff 1.0.3 's Makefile
and tryed all done!
tc@box:~$ g++ -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti `fltk-
config --cxxflags` -Wall -c editor.cxx
tc@box:~$ gcc `fltk-config --use-images --ldflags` -lfltk_images -lm editor.o -o
editor
tc@box:~$ g++ -march=i486 -mtune=i686 -Os -pipe -fno-exceptions -fno-rtti `fltk-
config --cxxflags` -Wall -c help.cxx
tc@box:~$ gcc `fltk-config --use-images --ldflags` -lfltk_images -lm help.o -o h
elp
tc@box:~$
-
Glad it was useful for you! :D