Web lists-archives.com

[Mingw-users] setenv()




Hello, all

Is  the  setenv() function from stdlib.h supposed to
work in MinGW?  When I compile  the  following  pro-
gram:

#include <stdlib.h>
int main( int argc, char** argv )
{  setenv("test", "1", 1);
   return 0;
}

I get:

   cco6C8tG.o:test.c:(.text+0x26): undefined reference to `setenv'
   collect2.exe: error: ld returned 1 exit status

If  change  the  file extension to cpp, the error is
different:

   test.cpp: In function 'int main(int, char**)':
   test.cpp:3:24: error: 'setenv' was not declared in this scope
    { setenv("test", "1", 1);

And where is stdlib.h located?  I couldn't  discover
it using:

   find / -name stdlib.h

-- 
()  ascii ribbon campaign - against html e-mail
/\  http://preview.tinyurl.com/qcy6mjc [archived]


------------------------------------------------------------------------------
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe