WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: how to compile "help.cxx" ?  (Read 3493 times)

Offline quanpin

  • Newbie
  • *
  • Posts: 28
how to compile "help.cxx" ?
« on: April 17, 2012, 09:31:55 PM »
1. I try to complie fltk_projects ,but can't compile the "help.cxx" file.

Code: [Select]
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




Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: how to compile "help.cxx" ?
« Reply #1 on: April 17, 2012, 09:41:55 PM »
Hi quanpin
Quote
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

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: how to compile "help.cxx" ?
« Reply #2 on: April 17, 2012, 09:51:38 PM »
I can't find my notes for help.xx, but does something of this form do the trick:

Code: [Select]
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

Offline quanpin

  • Newbie
  • *
  • Posts: 28
Re: how to compile "help.cxx" ?
« Reply #3 on: April 17, 2012, 11:14:21 PM »
I try to run "strip editor" , the exefile size from 375.55KB change to 291.91KB.   but the tc's 14.07KB.

Code: [Select]
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

Code: [Select]
#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 $".
//

Offline quanpin

  • Newbie
  • *
  • Posts: 28
Re: how to compile "help.cxx" ?
« Reply #4 on: April 17, 2012, 11:29:06 PM »
 :) thanks

I found fluff 1.0.3 's Makefile
and tryed all done!


Code: [Select]
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:~$






Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Re: how to compile "help.cxx" ?
« Reply #5 on: April 18, 2012, 06:46:39 PM »
Glad it was useful for you!  :D