Re: Run environment variable not used in debug mode

  • From: Egor Ushakov < >
  • To: , luckyvae < >
  • Subject: Re: Run environment variable not used in debug mode
  • Date: Thu, 08 Nov 2012 14:29:18 +0400

Hi,

have you tried to set up LD_LIBRARY_PATH in Project properties/Run/Environment?
I did this experiment:
- compiled:
std::cout << "LD_LIBRARY_PATH=" << getenv("LD_LIBRARY_PATH") << std::endl;
- set LD_LIBRARY_PATH=/abcd in Project properties/Run/Environment
- then run, output was:
LD_LIBRARY_PATH=/abcd
- debug, output was the same:
LD_LIBRARY_PATH=/abcd

Egor

On 11/ 5/12 05:08 PM, luckyvae wrote:
Hi everyone,

I'm facing a small problem:

In run mode, i've configured the environment variable in order to modify 
LD_LIBRARY_PATH to be able to locate the library I'm working on. This work 
exactly like I wanted. The only problem is that whenever I try to run it in 
debug mode (with gdb), gdb complains that it can't find my library. I've made 
a small test and it seems that the environment is not the same when a project 
is run and whenever we debug it.

Is it me or did I forgot to do something?

I've made a small reproductible test case that I've joined. It contains a cpp 
file that will execute a small shell script to show the definition of 
LD_LIBRARY_PATH.
If you run it, you should have something that starts with ../
And when you debug the project, you won't have the same values.

Netbeans 7.2
C/C++ plugin version: 1.18.1.1




Attachments:
http://forums.netbeans.org//files/testtar_187.gz




Run environment variable not used in debug mode

luckyvae 11/05/2012

Re: Run environment variable not used in debug mode

Egor Ushakov 11/08/2012

Project Features

About this Project

CND was started in November 2009, is owned by Leonid Lenyashin, and has 130 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close