Thread: C system call and msdos batch files.

  1. #16
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Quote Originally Posted by Dino View Post
    Or, maybe bat files don't support the long names, so you have to use the PROGRA~1 flavor syntax?

    I tried that but that didn't seem to work either, maybe it was something else I don't know, yes maybe it as something else, I only changed the names with spaces in, I'd need to change them all wouldn't I will try that later.
    But I forsee problems with it - what if more than one file has the same name at the start?

    OK I tried it again and it does work!!
    I don't like it much though, but it does work, I am a bit worried it might cause problems
    elsewhere going in the reverse direction.
    Last edited by esbo; 01-15-2009 at 10:17 AM.

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Again, why not use gcc-mingw instead - it's free, it's available, it's using a modern version of gcc (more standards compliant), and it's working in the native Windows API.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #18
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Quote Originally Posted by matsp View Post
    Again, why not use gcc-mingw instead - it's free, it's available, it's using a modern version of gcc (more standards compliant), and it's working in the native Windows API.

    --
    Mats

    Sounds like a good idea I guess I am just used to whatI have got but I must give it a go
    I had a few probs installing the last compiler.
    Actually that sounds quite good if it mean I can interface via windows instead of running in a dos window. I've been meaninng to switch to that. I am trying to download and install it now.

    Edit having a few probs doing that seem it could not dowload some of the files.
    Last edited by esbo; 01-15-2009 at 11:04 AM.

  4. #19
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Can't seem to download some of it seems to have been taken off line:

    The Old MinGWiki pages are again offline as a result of action from SF due to flock issues with the phpwiki application. We'll be trying a different approach.

    ???

  5. #20
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I didn't have any troubles getting to mingw.org, or navigating to the download site. There's an installer so you should only need to get the one file yourself. As what you quoted said, the archives are gone, but who cares about the archives?

  6. #21
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    OK I seem to have downloaded and install it.
    Not sure how to run it though.
    Maybe i need to read some stuff?

  7. #22
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    Quote Originally Posted by esbo View Post
    OK I tried it again and it does work!!
    NAILED IT!!
    Mainframe assembler programmer by trade. C coder when I can.

  8. #23
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by esbo View Post
    OK I seem to have downloaded and install it.
    Not sure how to run it though.
    Maybe i need to read some stuff?
    Quite likely. But "gcc -Wall xxx.c -o xxx" will compile your program and produce xxx.exe

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #24
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    After you've set up the PATH environment variable of course

  10. #25
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129

  11. #26
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Quote Originally Posted by robwhit View Post
    Doesn't mention Windows XP,
    The DJGPP library features transparent and automatic support for long file names on Windows 9X8. The DJGPP startup code queries the system for the availability of the LFN API, and if it's available, all low-level file-oriented primitives are automatically switched to using the special LFN-aware functions. This run-time detection of the LFN support means that the same executable will run on DOS and on Windows, and will automatically support long file names when it runs on Windows 9X.
    LFN API may not even be available according to that.

  12. #27
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    OK
    I managed to download it and install it.
    I found the 'documentation' and installation procedure a bit confusing.

    Anyway first i compiled a test program with g++ by following the instructions,
    that compiled OK, no sure what g++ is, is it just a c++ compiler?

    Anyway it compiled and ran OK, but I really wanted gcc, ofcourse I already have one of them
    and as the path was set up it would have ran the old version so I just put in
    the full path name so it ran the new version.

    That compiled OK too, as you would expect as I guess g++ "contains" gcc?

    I have not tested the long path names yet as I had 'worked around them' because I needed
    a version which works.
    It's actually going to be a bit of a pain going back to were I was now!!
    Last edited by esbo; 01-19-2009 at 09:32 PM.

  13. #28
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    Quote Originally Posted by matsp View Post
    Quite likely. But "gcc -Wall xxx.c -o xxx" will compile your program and produce xxx.exe

    --
    Mats

    Whats -Wall?

  14. #29
    Fountain of knowledge.
    Join Date
    May 2006
    Posts
    794
    OK I have tested it with long file names.
    At first I though it did not work as the batchfile to compile the test program overid the enviroment variable and set it back to the old gcc, which caused some confusion, but now I have corrected that
    now and it works fine now!!
    Thanks for your help!

    Incidently does this mean I will now be able to use some 'windowing stuff'?
    I have not really done any of that before, but if would be useful if I could.

  15. #30
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    -Wall tells the compiler to tell you about "all" "W"arnings.
    Mainframe assembler programmer by trade. C coder when I can.

Popular pages Recent additions subscribe to a feed