How can I add a library path to a delphi project?

11,293

Put it in the project's search path (Project->Options->Delphi Compiler). You'll see a couple of examples there for using .\$(Platform)\$(Config), which is a relative path to the project based on the target platform and build configuration.

Share:
11,293
BIBD
Author by

BIBD

Oh gawd, I never fill these out

Updated on June 05, 2022

Comments

  • BIBD
    BIBD almost 2 years

    I have a couple precompiled (3rd party) libraries that I need to use in my project.

    I can get it to build if I put foo.a in the root of my project folder, however, I have a 32 bit version and a 64 bit version of the library and I don't want to have to swap out foo.a with foo.32.a and foo.64.a every time I build each version of the application.

    In this particular case I've put them in:

    [myroot]\iOSDevice32\Debug\foo.a
    [myroot]\iOSDevice32\Release\foo.a
    

    and

    [myroot]\iOSDevice64\Debug\foo.a
    [myroot]\iOSDevice64\Release\foo.a
    

    I could put it in the libary path (Tools -> Options -> Delphi Options -> Library -> Library Path); however, I want it to be specific to the project and relative to the root of the project folder (rather than hard coded to one location for all projects).

    How can I tell Delphi/Embarcadero RAD Studio where to find these libraries?

  • BIBD
    BIBD over 8 years
    When I do that, instead I get [DCC Error] E2597 ld: library not found for -lc++. It seems to be overiding some existing search path instead of adding too it.
  • BIBD
    BIBD over 8 years
    In this case I also tried it under Search path -> Value from "All configurations -All platforms" as well.
  • BIBD
    BIBD over 8 years
    Correction.... I also had it in the System library root path (which looked like a likely place to put such a creation earlier in the day). Sorry for the confusion.
  • R. Hoek
    R. Hoek about 3 years
    This is for setting the global/IDE library path, not for the project only.