Why cant i loadlibrary with relative paths
    10 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    Sandeep
 le 7 Oct 2015
  
    
    
    
    
    Réponse apportée : Philip Borghesani
    
      
 le 7 Oct 2015
            hi, I want to load a library which in turn uses other headers so I put them in includepath option, but if at all I try to give the relative path, it wont find it. Also when the the function loadlibrary is run, which directory does it run in, the current working directory or matlab has a specific directory where it runs, like in windows. If this is the case then obviously the relative path wont work. Below is the code I try which works when I give the full path but does not when its relative.
[notfound, warnings] = loadlibrary('libfile', 'libfile.h', 'includepath', 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include'...
, 'includepath', 'C:\Program Files\Microsoft SDKs\Windows\v7.1\Include'...
, 'includepath', '.\MyFolder\inc');
0 commentaires
Réponse acceptée
  Philip Borghesani
    
      
 le 7 Oct 2015
        Loadlibrary runs from a freshly created temporary directory so relative paths will not work as include paths.
To build an include path use fullfile(cd,'MyFolder\inc')
0 commentaires
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur File Operations dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!