camster123
asked on
How to change the Output Directory in a LINUX makefile so that a shared object can be relatively specified in C# DLLImport?
I would like to find out how to change the Output Directory in a LINUX makefile so that a shared object can be relatively specified in C# DLLImport?
I read the following hint in
http://stackoverflow.com/questions/8316992/dll-import-path-how-to-get-dll-path-which-located-in-other-folder
Change the Output Directory setting in the C++ project to $(SolutionDir)bin\$(Config urationNam e) so that the native DLL ends up in the same folder as your managed program. Just use [DllImport("3rdparty.dll") ] in your C# code. – Hans Passant Nov 29 '11 at 20:38
I would like to know to do this in a makefile used in Ubuntu Linux 15.10.
Any help is greatly appreciated.
I read the following hint in
http://stackoverflow.com/questions/8316992/dll-import-path-how-to-get-dll-path-which-located-in-other-folder
Change the Output Directory setting in the C++ project to $(SolutionDir)bin\$(Config
I would like to know to do this in a makefile used in Ubuntu Linux 15.10.
Any help is greatly appreciated.
ASKER
@arnold,
Thank you for your solution.
What if I do not have an install option in my LINUX makefile? Will your solution still work?
Thank you for your solution.
What if I do not have an install option in my LINUX makefile? Will your solution still work?
ASKER
@arnold, make DESTDIR=/path install did not fix my C# DLLImport relative path requirement. Please suggest an alternate way.
Your question, is it for Linux or windows?
After rereading and your last comment, I am unclear on what you are after.
To add libraries, I uses -L/path/where/libraries you can multiple references added .........
After rereading and your last comment, I am unclear on what you are after.
To add libraries, I uses -L/path/where/libraries you can multiple references added .........
ASKER
@arnold,
My question is for Ubuntu Linux 15.10.
Thank you.
My question is for Ubuntu Linux 15.10.
Thank you.
To add paths to locate libraries you would use the -L option in the referenece to c/C++
-I adds include locations
-L adds library locations
-ldb4 adds/loads a specific in this case db4
A Makefile is a set of commands the items will be added to the commands
Often a Makefile has predefined variables which are included/referenced within with the gcc/g++ etc.
lets say you compiled a library in /home/users/camster
using the -L/home/users/camster/buil d -I/home/users/camster/buil d
presumes you have the source code with
include "somefile.h"
the -I parameter will help the compiler locate the somefile.h in the /home/users/camster/build while the -L will help the compiler locate the objects/etc.
-I adds include locations
-L adds library locations
-ldb4 adds/loads a specific in this case db4
A Makefile is a set of commands the items will be added to the commands
Often a Makefile has predefined variables which are included/referenced within with the gcc/g++ etc.
lets say you compiled a library in /home/users/camster
using the -L/home/users/camster/buil
presumes you have the source code with
include "somefile.h"
the -I parameter will help the compiler locate the somefile.h in the /home/users/camster/build while the -L will help the compiler locate the objects/etc.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Arnold's solution solved the problem.
make DESTDIR=/path install