I have a simple C # application that links a library to the mingnu compiler. I can easily call functions in the library without any problems.
However, the library calls getenvto set itself, this environment variable must be configured for the library to work correctly, so I use Environment.SetEnvironmentVariable, however, the library cannot get the value that I set.
getenv
Environment.SetEnvironmentVariable
getenv . SetEnvironmentVariable , getenv. setenv, getenv.
: http://msdn.microsoft.com/en-us/library/tehxacec(VS.71).aspx
"getenv _putenv , _environ, . getenv , , " ", . , envp main wmain, . "
_putenv_s #, , ++.
InteropServices:
InteropServices
using System.Runtime.InteropServices; public class TestEnv { [DllImport( "msvcrt.dll" )] public static extern int _putenv_s( string e, string v ); public TestEnv() { _putenv_s( "ENV_VAR", "VALUE" ); } }
, .
See here the P / Invoke Signature Generator .
Download Link Microsoft CLRInsideOut2008_01.exe
Source: https://habr.com/ru/post/1787585/More articles:Null user certificate in HTTPServletRequest - javatableview disappears after resizing view - objective-cWARNING. You cannot assign these protected attributes: id (ar-extensions) - ruby-on-railsHow to keep the state of the Eclipse plug-in between sessions? - javaEF4 CTP5 - Column Audit CreatedOn - .netWhat is the difference between a multi-user web application and a multi-layer web application? - architectureMysql Select the entry where PRIMARY key = x - mysqlВедение журнала активированного действия bean в PhaseListener - loggingPerl command or module, for example Linux command "file" - cross-platformhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1787590/convert-special-characters-to-iso-latin-1-codes-with-php&usg=ALkJrhh0qm8BUCiWqR--8un_ayRdt0KI8AAll Articles