| View previous topic :: View next topic |
| Author |
Message |
Gordon Prieur Posted via mailing list.
|
Posted: Thu Oct 29, 2009 8:03 pm Post subject: NetBeans 6.7.1 (and later) C/C++ is changing my $PATH! |
|
|
Hi,
Given the following C/C++ application project:
main(int argc, char **argv) {
char *path = getenv("PATH");
printf("path = %s\n", path);
}
If I use NetBeans 6.5.1 I get my path. If I use 6.7.1 I get
"/bin:/usr/bin:/usr/bin".
If I run with 6.8beta I get (after the OOB exception:-) I get my path with
"/usr/bin:/bin:/usr/bin:" appended.
Why is NetBeans messing with my path? I can't debug using netbeans any more!
It makes my program fail (during some PATH checking).
Gordon |
|
| Back to top |
|
 |
postmortem
Joined: 04 Jun 2009 Posts: 58 Location: Midwest USA
|
Posted: Fri Oct 30, 2009 12:18 am Post subject: |
|
|
| many IDEs do this, I bet they couldn't run 'sh' program reliably without modifying path of all child processes |
|
| Back to top |
|
 |
alexvsimon
Joined: 26 Jun 2009 Posts: 33
|
Posted: Fri Oct 30, 2009 8:15 am Post subject: |
|
|
Gordon,
please, file a bug.
IMHO IDE can have an option "do not touch my PATH at run".
Alexander |
|
| Back to top |
|
 |
efred
Joined: 12 Sep 2009 Posts: 19
|
Posted: Sat Oct 31, 2009 2:36 am Post subject: |
|
|
Hello
Just to tell you, your code worked for me in netbeans IDE 6.7
I dont have an answer for your code as I pasted in your code and it worked.
code:
#include <stdlib.h>
#include <stdio.h>
int main(int argc, char** argv) {
char *path = getenv("PATH");
printf("path = %s\n", path);
return (EXIT_SUCCESS);
endofcode:
It displayed my PATH in the cmd.
on vista.
I'll show you my C/C++ In Options:
Tool Collection:
MinGW (focus)
TOP TO BOTTOM
C:\MinGW\bin
C:\MinGW\bin\gcc.exe
C:\MinGW\bin\g++.exe
C:\MinGW\bin\g77.exe
C:\MinGW\bin\as.exe
C:\cygwin\bin\make.exe
C:\cygwin\bin\gdb.exe
Note: I have both MinGW and cygwin
I started with cygwin
then I needed MinGW, just for your information.
Also netbeans IDE 6.7 is new to me as I was using earlier version on same machine which I had installed cygwin then MinGW, which showed up in my new netbeans IDE 6.7
good luck
Fred |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|