Paket kompilieren und einbinden BDS 2005



  • Hallo,

    ich bin absoluter Anfänger was C++ und Borland Developer Studio betrifft.

    Ich versuche nun schon seit Tagen ein Paket zu kompilieren um es dann mit Include einbinden zu koennen.

    Das Verzeichnis enthält ganz viele Dateien mit Endung ".h" und auch ein makefile. Einfach in Shell make /f makefile bringt nur Errors, msbuild.exe auch und csc makefile ebenfalls.

    Kann mir jemand einen Tip geben ?

    Danke,
    Sputnik

    PS: hier noch der Anfang des Makefile-Textes

    .SUFFIXES: .o .cxx .exe .exeP .exeS .h.gch

    OPTFLAGS = -g -DABKDEBUG
    #OPTFLAGS= -O3 # use this for optimization instead of the above
    CCFLAGS = -G -PIC +p
    # +w2
    # comment +w/+w2 when compiling with optimization
    DEPENDOPT= -xM1
    CC = CC $(OPTFLAGS) $(CCFLAGS)
    LD = CC -G
    LDFINAL = CC
    AR = ar cr
    SODIRKEY = -R
    SONAMEKEY= -R # change to -h if you need "immobile"dynamic libraries.
    # LD_LIBRARY_PATH overrides -h
    # Make sure there is no conflict



  • Dieser Thread wurde von Moderator/in evilissimo aus dem Forum C++ in das Forum VCL (C++ Builder) verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.



  • Was genau willst du da machen? Eine statisch lib oder eine dll erstellen?
    Lass das Makefile mal sein, und erstell dir ein passendes Projekt in der IDE, füge dann die erforderlichen cpps dazu und compiliere das Ganze.
    Hast du das BDS 2006? Eine Version 2005 gibt es nämlich nicht. 🙂



  • Hi,

    erstmal danke für die schnelle Antwort.
    Meine Version Borland Developer Studio 2006
    Borland® C++Builder® for Microsoft® Windows™ Version 10.0.2288.42451 Update 2 Copyright © 2005 Borland® Software
    TurboC++

    Ich moechte ein C++ ".h" file zum laufen bringen das folgende Funktionen einbindet am Programmstart:

    #include "mapping.h"
    #include "permut.h"
    #include <ABKCommon/sgi_stl_compat.h>
    #include "ABKCommon/abkassert.h"

    Dazu erstelle ich ein "Console Application" Projekt und kopiere den Text aus dem ".h" file einfach da rein.

    Jetzt läuft das ganze nicht, weil die Dateieen mapping.h und das Verzeichnis ABCommon dem Compiler natürlich unbekannt sind. Also habe ich mir das Paket "ABKCOMMON" runtergeladen. In dem Verzeichnis ist wie gesagt ein makefile und viele Dateien mit Endung ".h" also auch mapping.h und abkassert.h.

    Das ist das README file im Verzeichnis ABCOMMON:
    OS and compilers supported : CC 4.2+ for Solaris 2.5+,
    MSVC++5.0 for Windows NT4.0
    (probably for Windows '95 as well)
    compilers not supported : MSVC++4.x, g++ 2.7.2, CC 4.1

    Libraries/packages used: STL 2.01 or higher (see STL note below)

    Formal interface : abkcommon.h (other filed included)

    Linking interface: one static (libcommon.a) or shared (libcommon.so) library

    This package contains header files to be included by all projects in
    ABKgroup

    Test : produce executable solvTest with "make test", then use
    script "regression"; correct output contains

    Differences from precomputed results
    0 0 0 someofdiffs

    Installation notes : customize Makefile to your filesystem,
    Type make. This will build the libraries.
    The shared library can not be
    moved from its initial location.

    Purify note : you may want to put

    suppress umr ...; Timer*

    into your ~/.purify file because purify reports
    uninitialized memory reads in UNIX system calls.

    STL note 1: you need an *adapted* version 2.01 970718) or higher.
    It is available (together with a testsuite) from
    http://www.ipmce.su/people/fbp/stl/stlport.html.
    Extensive online documentation is available at
    http://www.sgi.com/Technology/STL/
    Links to tutorials can be found at
    http://www.sgi.com/Technology/STL/other_resources.html

    STL note 2:

    If you use MS VC++, add the following
    three lines to stlcomp.h right after the
    #ifndef __STLCOMP_H #define __STLCOMP_H pair:

    #pragma warning(disable:4227)
    #pragma warning(disable:4804)
    #pragma warning(disable:4786)

    ABKCommon defines

    0. class Empty to be used as InfoClass parameter to templates.
    1. min/max/abs from STL
    2. bool/false//true from STL (ANSI compliant)
    3a. Macro abkfatal(CONDITION,ERRMESAGE)
    just like abkassert() 3c., but does not depend on whether
    a symbol is defined. "unconditional assertion"
    should be used in all noncritical places
    3b. Macro abkwarn(CONDITION,ERRMESAGE)
    just like abkguess() 3d, but does not depend whether
    a symbol is defined. "unconditional warning"
    should be used in all noncritical places
    3c. Macro abkassert(CONDITION,ERRMESSAGE)
    if ABKDEBUG is defined it checks the condition and
    if it fails, prints the message. If NDEBUG is not
    defined, it prints line number and filename, then stops.
    If NDEBUG is defined, it continues (standard ssert.h behavior)

    To have ABKDEBUG defined, your compiler should use -DDEBUG argument
    Otherwise, there is 0 overhead to have abkassert()

    When debugging, you can put breakpoints in abkassert_stop_here(),
    but this should be redundant since abkassert() is always fatal.

    3d. Macro abkguess(CONDITION,ERRMESSAGE)
    Same as above, but does not stop the program.
    Also, abkguess_stop_here() is really meaningful.

    4-5) InfoLines: TimeStamp, CmdLine, Platform, MemUsage, MemChange, User
    (to be used, e.g., when writing commented info into files)

    a) cout << TimeStamp() << endl;
    Today it printed the line "Timestamp : Sun Jun 15 16:18:45 PDT 1997"

    b) cout << CmdLine(argc,argv) << endl;
    Prints the command line.

    c) cout << MemUsage() << endl;
    # Memory use : 2.01324 Mb (peak) 1.17635 (estimate)
    (class MemUse converts to double)

    d) cout << Platform();
    # Platform : SunOS 5.5.1 sparc SUNW,Ultra-1

    e) cout << User() ;
    # User : imarkov@nexus6 (uclacs)

    d) MemChange memChange;
    // some memory allocation
    cout << "Additional memory requested : " << memChange << endl;
    memChange.resetmark();
    // more allocation
    cout << "More memory requested : " memCHange << endl;

    6. Class Timer. Timer::stop() Timer::start() (also starts when instantiated).
    cout << Timer;
    double Timer::getUnixTime() can be used for randomization

    An optional parameter to the _ctor and Timer::start(double limitInSec=0)
    sets the expiration time (in CPU seconds, not real seconds).
    bool Timer::expired()
    bool Timer::realTimeExpired()
    can be used to check if the time is over. The choice of CPU time over
    real time for expiration is explained by a much finer granularity of
    measurment. The author observed sensitivity of up to 0.001
    CPU sec. on Sparc architecture (while real seconds were integers).

    7. Class RNG (same as RandomNumberGenerator). See specs for random_gen1.0
    Sample use : RNG randng(3,10); unsigned randomNumber=randng;
    RNG randng(3.1,10.2); double randomNumber=randng;
    Can be preseeded to become deterministic
    RNG randng(3,10,seed); // seed is unsigned
    the seed (even if assign randomly) can be retrieved by getSeed();
    This allows to "reconstruct events"

    8. Param classes -- Command Line Parameter processors:

    if ( NoParams(argc,argv) ) cout << " Empty command line " << endl;

    BoolParam cursed("c",argc,argv); // catches -c, --c and +c in cmd line
    abkfatal(!cursed, " This process is cursed: bailing out... ");

    UnsignedParam number("num",argc,argv); // catches -num, --num and +num
    // always have to check if (number.found()) ... in some way, e.g.,
    abkfatal(number.found()," Number parameter not found ");
    unsigned temp = num + 2; // for example

    StringParam filename("f",argc,argv);
    if (filename.found()) cout << "File name : " << filename << endl;

    The "key" (e.g. "f","c" or "num" above) must be an arbitrary ASCII
    string targetting -key, +key and --key command line options.
    The value, if present, should follow -key. +key --key delimited by
    one or more spaces. Options w/o value are only recongnized by
    BoolParam (others report "not found")

    Useful methods:

    bool found() const // always need to check before anything else
    bool on() const // true if the key was invoked with +
    // one implicit conversions for each class

    Remark: using this class will lead to parsing whole command

    9. istream manipulators:

    eathash, skiptoeol,
    assertions: needeol, noeol, isnumber, isword
    needword(const char 😉 and needcaseword(const char 😉

    All except the last two are trivial and users are encouranged to
    look at implementations in abkmanip.h

    Examples:

    double x,y,z;
    cin >> eathash >> x >> noeol >> isnumber >> y >> noeol >> isnumber

    > z >> needeol;

    unsigned i,j;
    cout << " Enter <number> 'and' <number> : " << flush;
    cin >> i >> needword("and") >> j >> needeol;

    eathash gulps the rest of the line if the next non-blank char is #
    If the first non-blank char in the next line is #, it continues.

    skiptoeol eats everything until the line end included

    noeol will abkfatal is the next non-blank char is eol or eof
    isnumber will abkfatal if the next non-blank char can not start a number

    needeol will abkfatal if the next nonblank is not eol or eof

    needword(const char 😉 takes a string, eats all blank characters,
    reads the first word and abkfatals if it does not compare
    to the argument.
    needcaseword(const char 😉 same as above, but the comparison is
    case insensitive

    ----

    All except eathash, skiptoeol, needword() and needcaseword()
    if the manipulators don't abkfatal,
    they just eat some whitespace and do nothing else
    (implementation: they 'reaturn' what they read)
    needword() and needcaseword()
    if they do not abkfatal(), the word is being 'eaten'.

    10. ostream& operator<<(ostream& out, const vector<unsigned>& rhs)

    outputs vectors nicely in columns

    11. abk_dump_stack() prints stack on supported platforms.
    const char* SgnPartOfFileName(const char * fileName)
    produces a "significant" part of a filename (cuts down long paths)

    12. class Verbosity to regulate debug output from complicated classes

    UND hier das Makefile:
    .SUFFIXES: .o .cxx .exe .exeP .exeS .h.gch

    OPTFLAGS = -g -DABKDEBUG
    #OPTFLAGS= -O3 # use this for optimization instead of the above
    CCFLAGS = -G -PIC +p
    # +w2
    # comment +w/+w2 when compiling with optimization
    DEPENDOPT= -xM1
    CC = CC $(OPTFLAGS) $(CCFLAGS)
    LD = CC -G
    LDFINAL = CC
    AR = ar cr
    SODIRKEY = -R
    SONAMEKEY= -R # change to -h if you need "immobile"dynamic libraries.
    # LD_LIBRARY_PATH overrides -h
    # Make sure there is no conflict

    PURIFY = purify -cache_dir=cache -windows=no -log_file=purify.log\
    -always_use_cache_dir

    UCLA = /x/xx/OUR/packages
    IMPORT = /x/xx/IMPORT
    CC4LIBS = g++
    #LIBBASE = /x/xx/lib/(CC4LIBS)/gLIBBASE=/x/xx/lib/(CC4LIBS)/g LIBBASE = /x/xx/lib/(CC4LIBS)/O3
    SLIBBASE = (LIBBASE)/staticSTL=#I(LIBBASE)/static STL = \# -I(IMPORT)/STL/CC
    THISLIB = ABKCommon
    ARNAME = lib(THISLIB).aSONAME=lib(THISLIB).a SONAME = lib(THISLIB).so
    SODIR = $(PWD)
    TESTNAME = $(THISLIB)Test

    INCLUDES = (STL)I.I(STL) -I. -I(UCLA)
    LIBPATHS = (SODIRKEY)(SODIRKEY)(PWD)
    LIBS = -L$(LIBBASE) $(SODIRKEY). (LIBPATHS)l(LIBPATHS) -l(THISLIB)
    SLIBS = -L(SLIBBASE)l(SLIBBASE) -l(THISLIB)
    SOLABEL = (SONAMEKEY)(SONAMEKEY)(SODIR)/$(SONAME)

    OBJS = abkassert.o infolines.o paramproc.o abktimer.o platfDepend.o\
    abkio.o Tausworthe.o r250.o r1279.o seed.o verbosity.o\
    pathDelims.o abkfunc.o MD5/md5.o crc32.o abkcpunorm.o abkstring.o\
    abkroot.o SGI_STL_COMPAT/hashStatic.o abkrand_templ.o\
    mmapStreamBuf.o abkmessagebuf.o

    SRCS = $(OBJS:%.o=%.cxx)

    # The four definitions below are for use with the PRINT_VERSION_INFO macro
    # defined in ABKCommon/abkversion.h
    ABKPACKAGE =`pwd | sed 's/.*\///g'`
    ABKSYSTEM ="`uname -n`\x20running\x20`uname -sr | sed 's/ /-/g'`"
    ABKUSER =`whoami`
    ABKSYMBOLS =-D__ABKPACKAGE__=\"(ABKPACKAGE)\\" -D\_\_ABKSYSTEM\_\_=\\"(ABKSYSTEM)\"\
    -D__ABKUSER__=\"(ABKUSER)\\" -D\_\_ABKLIBBASE\_\_=\\"(LIBBASE)\"

    all : md5_objs hash_objs lib

    md5_objs:
    cd (PWD)/MD5;(PWD)/MD5;(MAKE) PWD=$(PWD)/MD5
    hash_objs:
    cd $(PWD)/SGI_STL_COMPAT; (MAKE)PWD=(MAKE) PWD=(PWD)/SGI_STL_COMPAT

    lib : md5_objs hash_objs $(OBJS);
    /bin/rm -f $(ARNAME) (SODIR)/(SODIR)/(SONAME)
    $(AR) $(ARNAME) (OBJS)(OBJS) (LD) -o (SODIR)/(SODIR)/(SONAME) $(OBJS) $(SOLABEL)

    test : ABKCommonTest0.exe ABKCommonTest1.exe ABKCommonTest2.exe \
    ABKCommonTest3.exe ABKCommonTest5.exe ABKCommonTest7.exe \
    ABKCommonTest9.exe ABKCommonTest10.exe ABKCommonTest11.exe \
    ABKCommonTest13.exe ABKCommonTest4.exe ABKCommonTest16.exe \
    ABKCommonTest19.exe ABKCommonTest20.exe ABKCommonTest21.exe

    testS: ABKCommonTest0.exeS ABKCommonTest1.exeS ABKCommonTest2.exeS \
    ABKCommonTest3.exeS ABKCommonTest4.exeS ABKCommonTest5.exeS \
    ABKCommonTest6.exeS ABKCommonTest7.exeS ABKCommonTest9.exeS \
    ABKCommonTest10.exeS

    .cxx.o:
    $(CC) $(INCLUDES) $(ABKSYMBOLS) -c $*.cxx

    .h.h.gch:
    $(CC) $(INCLUDES) $(ABKSYMBOLS) $*.h

    .cxx.exe:
    $(CC) $(INCLUDES) $(ABKSYMBOLS) -c $.cxx
    /bin/rm -f .exe*.exe (LDFINAL) -o $
    .exe $*.o $(LIBS)

    .cxx.exeS:
    $(CC) $(INCLUDES) $(ABKSYMBOLS) -c $.cxx
    /bin/rm -f .exeS*.exeS (LDFINAL) -o $
    .exeS $*.o -static $(SLIBS)

    .cxx.exeP:
    $(CC) $(INCLUDES) $(ABKSYMBOLS) -c $.cxx
    /bin/rm -f .exeP*.exeP (PURIFY) $(LDFINAL) -o $
    .exeP $*.o $(LIBS)

    numbits:
    /bin/rm -f numbits.exe
    (CC)cnumbits.cxx(CC) -c numbits.cxx (LDFINAL) -o numbits.exe numbits.o

    numbitS:
    /bin/rm -f numbits.exeS
    (CC)cnumbits.cxx(CC) -c numbits.cxx (LDFINAL) -static -o numbits.exeS numbits.o

    errorcheck:
    /bin/rm -f errorcheck.exe
    (CC)cerrorcheck.cxx(CC) -c errorcheck.cxx (LDFINAL) -o errorcheck.exe errorcheck.o

    depend:
    /bin/rm -f depend.mk

    depend.mk:
    $(CC) $(DEPENDOPT) $(INCLUDES) $(SRCS) >depend.mk

    # include depend.mk

    clean: md5_clean hash_clean
    /bin/rm -rf .o Templates.DB .exe TimeTest lib \
    core cache ir.out MD5/*.o SunWS_cache *notime new.out \
    *.h.gch

    hash_clean:
    cd $(PWD)/SGI_STL_COMPAT; (MAKE)PWD=(MAKE) PWD=(PWD)/SGI_STL_COMPAT clean

    md5_clean:
    cd $(PWD)/MD5; (MAKE)PWD=(MAKE) PWD=(PWD)/MD5 clean



  • Headerdateien kopiert man nicht einfach rein, sondern inkludiert sie in den Quelltext.
    Das Paket scheint schon sehr alt zu sein. Die Chancen das kompiliert zu bekommen sehe ich hier eher gering.
    Hier musst du wohl auch noch Bibliotheken erstellen. schau dich besser mal nach was aktuellerem um.


Anmelden zum Antworten