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

Building errors and solutions on Windows #37

Open
aperfidia opened this issue Apr 19, 2017 · 1 comment
Open

Building errors and solutions on Windows #37

aperfidia opened this issue Apr 19, 2017 · 1 comment

Comments

@aperfidia
Copy link

aperfidia commented Apr 19, 2017

Environment:

Problems:

  • Could not find libAV resource in CMake
    ==> Force comment out the last 4 lines of <musly_git_root_path>/musly/cmake/FindLibAV.cmake and comment out version requirement of root CMakeList.txt

  • Lack of M_PI_2 Definitions
    ==> Manually define _USE_MATH_DEFINES in VS

  • Conflicts of win32's min/max macro
    ==> Manually define NOMINMAX in VS

  • <musly_git_root_path>/libmusly/method.cpp line 66, VS mark as "Non-const array length buffer_size"
    ==> Add const qualifier to buffer_size's declaration

  • After define NOMINMAX, all std::min/std::max in <musly_git_root_path>/libmusly/resampler.cpp are invalid then.
    ==> Add nessesary header, i.e. #include <algorithm> at begin of this file

  • <musly_git_root_path>/libmusly/decoders/libav.cpp line 290, VS mark as "unrecognized identifer and"
    ==> Use && instead

  • Redefinition of uint8_t in <musly_git_root_path>/libmusly/lib.cpp line 15 and VS's stdint.h header.
    ==> Comment out the former

  • When CMake option BUILD_STATIC is selected, the output libmusly.lib cannot be recognize in my project, VS hint unresolved symbol ....jukebox_poweron.., am I wrong?
    When this option is unselected, the output contains only 'libmusly.dll' and generate an error that musly_resample.lib not found.
    ==> No solution

@aperfidia aperfidia changed the title Building errors and solutions in Windows Building errors and solutions on Windows Apr 19, 2017
@f0k
Copy link
Collaborator

f0k commented Apr 19, 2017

Thank you for your report! First of all, is there a specific reason you need to build this with VS? The README file includes a guide for compiling with mingw: https://github.com/dominikschnitzer/musly#installation

Otherwise, your list is a mix of things we can or should change universally (const buffer_size, && instead of and, not defining uint8_t, #include <algorithm>), and things that are specific to VS (_USE_MATH_DEFINES, NOMINMAX). The latter would require some CMake magic to automatically add those defines if compiling with VS. Or actually, NOMINMAX should probably just be defined before include <windows.h>. Would you be willing to send a PR with the required changes to make it work in VS (without breaking compilation on Linux -- I can check that)?

About the BUILD_STATIC option, does #32 help?

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