WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline quanpin

  • Newbie
  • *
  • Posts: 28
how to compile "help.cxx" ?
« on: April 18, 2012, 12:31:55 AM »
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: 11618
Re: how to compile "help.cxx" ?
« Reply #1 on: April 18, 2012, 12:41:55 AM »
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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14812
Re: how to compile "help.cxx" ?
« Reply #2 on: April 18, 2012, 12:51:38 AM »
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 18, 2012, 02:14:21 AM »
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 18, 2012, 02:29:06 AM »
 :) 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, 09:46:39 PM »
Glad it was useful for you!  :D