簡體   English   中英

LEDA庫(C ++庫)安裝linux

[英]LEDA library(C++ library) setup linux

我想在我的系統中設置LEDA庫。

我從以下鏈接下載了LEDA庫

http://www.algorithmic-solutions.info/free/d5.php

Instruction given in read me file



       2. Preparations
    ---------------

    Unpacking the LEDA distribution file 
    LEDA---.tar.gz will create the LEDA root 
    directory "LEDA---". You might want to rename 
    it or move it to some different place. Let  denote the final 
    complete path name of the LEDA root directory. 

    To install and use the Unix object code of LEDA you have to modify 
    your environment as follows: 

    a)  LEDAROOT:
    Set the environment variable LEDAROOT to the LEDA root directory: 

    csh/tcsh: setenv LEDAROOT  

    sh/bash: LEDAROOT= 
      export LEDAROOT 

    b)  Command Search Path:
    Include $LEDAROOT/Manual/cmd into your command search path 
    (environment variable path (csh) or PATH (sh)) and call rehash (if 
    required by your system). 

    c)  Shared Library: (for solaris, linux, irix, osf1) 
    If you planning to use shared libraries include $LEDAROOT into the 
    LD_LIBRARY_PATH search path. Then go to $LEDAROOT and type 
    make shared. This will construct the shared libraries from the static
    libraries. 
    Please note: Building the shared library is not supported on each
    platform.

    d)  xlman and demos: Go to $LEDAROOT and type make xlman to compile 
    and link LEDA's interactive manual reader xlman. Now you can start 
    xlman for reading and printing manual pages, starting demo programs 
    and browsing more release notes. 


    3. Compiling and linking application programs
    ---------------------------------------------

    a) Use the -I compiler flag to tell the compiler where to find the 
    LEDA header files.

    CC (g++) -I$LEDAROOT/incl -c file.c

    b) Use the -L compiler flag to tell the compiler where to find the 
    library (libleda.a/so)

    CC (g++)  -L$LEDAROOT file.o -lleda -lX11 -lm

    If using windows on solaris systems you might have to link 
    with the system socket library and the network services library as 
    well:
    CC (g++)  ... -lleda -lX11 -lsocket -lnsl -lm

    c) Compile and link simultaneously with

    CC (g++)  -I$LEDAROOT/incl -L$LEDAROOT file.c -lleda -lX11 -lm

    You may want to ask your system adminstrator to install the header 
    files and library in the system's default directories.
    Then you no longer have to specify header and library search paths on 
    the compiler command line.

我遵循了這些指令,但我的命令錯誤

> make xlman

    error
    coredump@coredump-VPCCB15FG:~/Documents/LEDA$ make xlman 
    make -C demo/xlman 
    make: *** demo/xlman: No such file or directory.  Stop.
    make: *** [xlman] Error 2

有人請幫我設置庫。

注意:對於Leda庫的免費版本,您不必構建程序包即可使用該庫。 它根本不起作用。

要使用該庫,只需將其包含在編譯行和鏈接器中。

如果要從shell進行編譯(假設您使用的是Linux),請執行以下操作:

1. Set the env variable to the library folder e.g export LEDAROOT= /path/to/Leda
2. Set the LD_LIBRARY_PATH env variable e.g export LD_LIBRARY_PATH=$LEDAROOT

驗證是否已設置此變量,然后您可以編譯並鏈接和運行。 你可以干脆做

CC (g++)  -I$LEDAROOT/incl -L$LEDAROOT file.c -lleda -lX11 -lm

有了這個,你應該很高興。

如果您使用的是IDE,只需將include路徑(即/ path / to / leda)添加到項目設置中即可。

這就是你所要做的。 構建庫不起作用。 只需包含它

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM