FLTK logo

Re: [fltk.general] How to build/install fltk 1.3.5 on Ubuntu 20.04

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: How to build/install fltk 1.3.5 on Ubuntu 20.04 "nghui... Oct 15, 2020  
  Hi Albrecht

Thank you for the hints. The build works. I follow hint #1 to compile hello.cxx from listing 1 of the FLTK 1.3.5 Programming Manual by running the shell script provided by the build :

alan@alan-Aspire-E1-422:~/reference/fltk-1.3.5$ ./fltk-config --compile hello.cxx

g++ -I. -I./jpeg -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -fvisibility-inlines-hidden -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT -o 'hello' 'hello.cxx' ./lib/libfltk.a -lXrender -lXft -lfontconfig -lpthread -ldl -lm -lX11

alan@alan-Aspire-E1-422:~/reference/fltk-1.3.5$

The Hello, World! window appears when I run the executable file. Great that it works, but I notice it has a file size of 2.5 MB. Seems exceedingly large. What could be the possible causes or remedies? Thank you

On Thursday, 15 October 2020 at 01:49:54 UTC+8 Albrecht Schlosser wrote:
On 10/14/20 7:07 PM Hui Peng, Alan Ng wrote:
> Greetings
>
> I am trying to install fltk 1.3.5 on Ubuntu 20.04 without success. I
> have used the following 3 bash shell commands, including results from
> the last command -
>
> alan@alan-Aspire-E1-422:~/reference/fltk-1.3.5$ ./configure
> --enable-debug --disable-gl --enable-shared --enable-threads
> --enable-xdbe --enable-xft
> --includedir=/home/alan/reference/fltk-1.3.5/include
> --bindir=/home/alan/reference/fltk-1.3.5/bin
> --libdir=/home/alan/reference/fltk-1.3.5/lib
> --prefix=/home/alan/reference/fltk-1.3.5
>
> alan@alan-Aspire-E1-422:~/reference/fltk-1.3.5$ make
>
> alan@alan-Aspire-E1-422:~/reference/fltk-1.3.5$ sudo make install
> === installing FL ===
> Installing include files in /home/alan/reference/fltk-1.3.5/include...
> === installing jpeg ===
> Installing ../lib/libfltk_jpeg.a in /home/alan/reference/fltk-1.3.5/lib...
> /usr/bin/install: '../lib/libfltk_jpeg.a' and
> '/home/alan/reference/fltk-1.3.5/lib/libfltk_jpeg.a' are the same file
> make[1]: *** [Makefile:103: install] Error 1
> make: *** [Makefile:33: install] Error 1
>
> config.log is attached for reference.

You are trying to install (with `sudo make install`) to the same
directory you're building FLTK in (error: "'../lib/libfltk_jpeg.a' and
'/home/alan/reference/fltk-1.3.5/lib/libfltk_jpeg.a' are the same file").

There are some issues with your commands:

(1) You do not need to "install" FLTK to use it. If your build (2nd
command: 'make') worked w/o errors you're ready to use FLTK in another
project and you can run the example programs in the test/ folder.

(2) Several of your ./configure command switches are default so you
don't need them, for instance "--enable-threads --enable-xdbe
--enable-xft". You can safely remove these commandline switches.

(3) The following switches are (AFAICT) redundant or even wrong. You
should remove those.

> --includedir=/home/alan/reference/fltk-1.3.5/include
> --bindir=/home/alan/reference/fltk-1.3.5/bin
> --libdir=/home/alan/reference/fltk-1.3.5/lib

(4) You don't need `sudo' if you (really) want to "install" the FLTK
libs to a subdirectory of your home folder (if that's what you did). You
need `sudo' only if you install to a system directory.

(5) If you really want to "install" FLTK (that's fine although not
necessary) and want to use a subdirectory of your home folder I suggest
to use something where you'll maybe install other software as well, e.g.
'/home/alan/dev' or another appropriate directory (not the source
directory of FLTK).

That all said, your configure, build, and install commands might look
like this:

$ ./configure --enable-debug --disable-gl --enable-shared
--prefix=/home/alan/dev

$ make

$ make install

Note that --prefix is used for the install target folder, change this as
required.

One last hint: I'd try to use the defaults when building new software
and amend the commands only when needed. The default values are usually
(and in the FLTK case definitely) a good starting point.

Welcome to the FLTK community, have fun!

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/a19b6e98-a762-45eb-a7ac-34bceb5293d9n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.