| View previous topic :: View next topic |
| Author |
Message |
Steve Guest
|
Posted: Mon Mar 21, 2005 3:36 pm Post subject: How do I specify a .dl location? |
|
|
I am trying to figure out how to creat and use a library in C++Builder. I am able to build a library. I am also able to call functions in the library.
However I can only do so if the .dll is in the same directory as the .exe that is calling the library functions. How do I tell the .exe to look for the .dll over in my library project directory?
So fare I have.....
I specify the .lib directory for the .exe project in tools/Environmental Options/library and also in Project/Options/Directories&Conditionals.
I specify the .lib file for the .exe in Project Manager.
Thanks, Steve
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Mar 21, 2005 4:38 pm Post subject: Re: How do I specify a .dl location? |
|
|
"Steve" <steven.r.bridges (AT) navy (DOT) mil> wrote
| Quote: | However I can only do so if the .dll is in the same directory as
the .exe that is calling the library functions. How do I tell the .exe
to look for the .dll over in my library project directory?
|
The OS looks in the calling environment search path when looking for DLLs.
That includes the current directory, the OS's system folder, etc. If you
want to specify a specific folder that is not on the search path, then you
cannot link to the DLL statically at compile time. You will have to load
the DLL dynamically at run time. Then you can specific any path you want.
| Quote: | I specify the .lib directory for the .exe project in tools/Environmental
Options/library and also in Project/Options/Directories&Conditionals.
|
Those settings only effect the compiler and linker. They have no effect on
the final executable at run time.
Gambit
|
|
| Back to top |
|
 |
Arnie Guest
|
Posted: Tue Mar 22, 2005 3:40 pm Post subject: Re: How do I specify a .dl location? |
|
|
"Steve" <steven.r.bridges (AT) navy (DOT) mil> wrote
| Quote: |
I am trying to figure out how to creat and use a library in
C++Builder. I am able to build a library. I am also able to
call functions in the library.
However I can only do so if the .dll is in the same directory
as the .exe that is calling the library functions. How do I
tell the .exe to look for the .dll over in my library project
directory?
So fare I have.....
I specify the .lib directory for the .exe project in
tools/Environmental Options/library and also in
Project/Options/Directories&Conditionals.
I specify the .lib file for the .exe in Project Manager.
Thanks, Steve
|
Specify the path to the DLL in the PATH environment variable.
- Arnie
|
|
| Back to top |
|
 |
|