delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/03/02/05:28:55

X-Spam-Check-By: sourceware.org
Message-ID: <4406C9AD.7060705@pad.zuken.de>
Date: Thu, 02 Mar 2006 11:32:13 +0100
From: Kai Benndorf <ben_1 AT pad DOT zuken DOT de>
Reply-To: ben_1 AT pad DOT zuken DOT de
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Querying the LIB environment (from g++) don't work with current cygwin.dll (1.5.19-4)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------010307030300090609020109
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,

i can't query the LIB environment variable from C++ code, compiled with 
g++, with GetEnvironmentVariable, as demonstrated in the appended, small 
example program. Other variables (e.g. PATH could be retrieved without 
problems). The example program queries LIB and prints it out. The output 
i received is an empty string.

I've installed the current cygwin version.

If i go back with the cygwin dll to 1.5.18-1 it worked without 
problems!!! But than a lot of other cygwin tools don't worked.

The problem occured originally on compiling the Coin3D library. They are 
using a cygwin compiled wrapper program (wrapmsvc.exe), which is 
querying the LIB variable and failed.

Many thanks for any hints

Kai

--------------010307030300090609020109
Content-Type: text/plain;
 name="getEnv.cpp"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="getEnv.cpp"

#include <iostream>

#include <Windows.h>

int main( void )
{
  const int bSize = 32657;
  char buffer[bSize];
  int resultsize = GetEnvironmentVariable("PATH", buffer, bSize);
  std::cout << "PATH: " << buffer << std::endl;
  buffer[0] = 0;
  resultsize = GetEnvironmentVariable("LIB", buffer, bSize);
  std::cout << "LIB: " << buffer << std::endl;
}


--------------010307030300090609020109
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--------------010307030300090609020109--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019