Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows makefile library issue #210

Open
sammyfreg opened this issue Aug 15, 2022 · 0 comments
Open

Windows makefile library issue #210

sammyfreg opened this issue Aug 15, 2022 · 0 comments

Comments

@sammyfreg
Copy link

It seems like there's some issue with library extension handling for makefile project under windows.
Some internal logic seems to append a .a like it would be done on Linux.

Setup

  • OS: Window 10
  • Build: Makefile with gcc and clang
  • This simple project demonstrate the issue : https://github.com/sammyfreg/hello-world
  • Install the Chocolatey package manager (optional)
  • Using Chocolatey, install make, gcc, clang for Windows (or pick other preferred method)
  • Generate makefile projects by calling TestBuilb\Generate.bat
  • Compile projects, using TestBuild\Build\MakefileBuildAll.bat
  • Observe the errors tied to linking with the library project

Results

  • GCC:
    I had to manually set the library extensions to '.a' in "TestBuild\Generate\shared.sharpmake.cs : 193".
    Otherwise the linking fails with filename prefixed with a 'lib' and postfixed with a '.a'
    xxx/bin/ld.exe: cannot find -l:libExampleLib_Release.lib.a
    This is because ExampleLib_Release.lib is outputed, but trying to link with libExampleLib_Release.lib.a.
  • CLANG
    It fails even with the library extension set.
    (Error example when '.a' is not assigned in 'shared.sharpmake.cs : 193')
    LINK : fatal error LNK1181: cannot open input file ':libExampleLib_Retail.lib.a.lib'
    (Error example when '.a' is assigned in 'shared.sharpmake.cs : 193')
    LINK : fatal error LNK1181: cannot open input file ':ExampleLib_Release.a.lib'

Both problems seemed to be caused by the logic in Makefile::FixupLibraryNames()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@sammyfreg and others