User forums > General (but related to Code::Blocks)

cygwin support

(1/1)

tiwag:
thanks for adding the cygwin support

i've tested it with some of my cygwin projects and building and debugging is working fine  :D

i wonder, how the cygwin pathes are set up from within CB ?
can you tell me how you did initialize the cygwin environment from within CB ?

example: built using cygwin compiler ...

--- Code: ---#include <stdio.h>
#include <stdlib.h>

main()
{
    char *envp = getenv("PATH");
    printf("PATH=\n%s\n\n",envp);
    return 0;
}

--- End code ---

... and run from CB prints

--- Code: ---PATH=
/usr/bin:/cygdrive/c/Python24/:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/
System32/Wbem:/cygdrive/d/Programme/Subversion/bin:/cygdrive/d/Programme/Gemeinsame Dateien/GTK/2.0/
bin:/cygdrive/d/IAR/EXE:/cygdrive/d/TOOLS

--- End code ---

thanks,
--tiwag

MortenMacFly:

--- Quote from: tiwag on January 02, 2007, 03:19:50 pm ---can you tell me how you did initialize the cygwin environment from within CB ?

--- End quote ---
AFAIK it's based on reading the Cygwin drive prefix from the registry (e.g. "cygdrive")) and then just exchanging the drive letter with /cygdrive/[DRV_LETTER].
Anyway, keep in mind that your application actually should already use the Cygwin layer at run-time to print the PATH's. Thus the printout (which is fully correct btw) should originate from Cygwin (DLL)...?!
With regards, Morten.

tiwag:

--- Quote from: MortenMacFly on January 02, 2007, 04:21:18 pm ---
--- Quote from: tiwag on January 02, 2007, 03:19:50 pm ---can you tell me how you did initialize the cygwin environment from within CB ?

--- End quote ---
AFAIK it's based on reading the Cygwin drive prefix from the registry (e.g. "cygdrive")) and then just exchanging the drive letter with /cygdrive/[DRV_LETTER].
Anyway, keep in mind that your application actually should already use the Cygwin layer at run-time to print the PATH's. Thus the printout (which is fully correct btw) should originate from Cygwin (DLL)...?!
With regards, Morten.

--- End quote ---

this means with other words, that CB only adds "X:\cygwin\bin" to the actual PATH environment variable and that's it ?
thanks for giving me the hint !
--tiwag

Navigation

[0] Message Index

Go to full version