Menu

#406 Cross-compilation support

open
nobody
None
5
2023-09-15
2023-02-21
AtnNn
No

Hello,

Cross-compiling 7zip from Linux targeting Windows needs a few tweaks: header files are case sensitive and include paths cannot have backslashes.

These changes have been useful for building on NixOS.

Thanks!

1 Attachments

Discussion

  • Igor Pavlov

    Igor Pavlov - 2023-02-21

    Yes, I know about these changes.
    But note that some compilers in Windows also require correct cases if we enable all warnings.
    So we must have both versions for each h file:

    #if defined(__MINGW32__) || defined(__MINGW64__)
    #include <windows.h>
    #else
    #include <Windows.h>
    #endif
    
     

    Last edit: Igor Pavlov 2023-02-21
    • Sam Tansy

      Sam Tansy - 2023-09-15

      But note that some compilers in Windows also require correct cases if we enable all warnings.

      Which ones? It has nothing to do wit compiler and everything to do with case in/sensitivity of file system and ability to find these files. No windows compiler ever complained about case of headers' file names. If compiler is able to open, let's say, "wInDoWs.H" with #include <windows.h> it will not complain as it opens the file, no problem. But in *nixes file systems are case sensitive and "wInDoWs.H" and "windows.h" are two different files and trying to open first with second name will simply fail, and that is what compiler complains about.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.