-
Notifications
You must be signed in to change notification settings - Fork 318
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
Build failures on MSVC #772
Comments
my thought is don’t modify the source so that it breaks. Sorry - we aren’t general purpose MSVC support - it has issues , but is popular enough we work around them. The code as is - works. On purpose. We do it that way - not because it is pretty, but because it’s functional.
|
G'day rgetz, Sorry let me be more clear. I haven't modified the source. msvc 2019 fails to compile libiio. The is due to the pattern change. Prior to this commit it builds and links ok for me. |
Recent builds on Azure don't have problems. Are you compiling with any weird flags that turn off optimization? |
Hi @reid-p, |
Thanks @pcercuei Yeap debug builds are the problem with msvc builds failing. I was trying to create a vcpkg port for libiio for use with msvc. Having debug builds has been nice occasionally. |
@reid-p The problem is that MSVC in debug mode is just very stupid. If it sees this code:
It will try to link against the I believe for your vcpkg, you should build in |
@pcercuei Can we disable |
@rgetz I tried but failed, MSVC has a "Debug" mode even when CMake doesn't have one. |
so, do we just document (in the |
Yes, but maybe leave this bug report open until the |
Added #798 |
gcc and clang always build with '-g', enabling easier debugging, so catch MSVC to the same. This will create seperate program database (.pdb) files, which map identifiers and statements in the project's source code to corresponding identifiers and instructions in compiled apps. These mapping files link the debugger to your source code, which enables debugging. Hopefully this will put a stop to those who want to build in windows in debug mode (which is not possible, see #772) This does not include the pdb files in the installers, so the only way to get them is build locally. Signed-off-by: Robin Getz <[email protected]>
gcc and clang always build with '-g', enabling easier debugging, so catch MSVC to the same. This will create seperate program database (.pdb) files, which map identifiers and statements in the project's source code to corresponding identifiers and instructions in compiled apps. These mapping files link the debugger to your source code, which enables debugging. Hopefully this will put a stop to those who want to build in windows in debug mode (which is not possible, see #772) This does not include the pdb files in the installers, so the only way to get them is build locally. Signed-off-by: Robin Getz <[email protected]>
gcc and clang always build with '-g', enabling easier debugging, so catch MSVC to the same. This will create seperate program database (.pdb) files, which map identifiers and statements in the project's source code to corresponding identifiers and instructions in compiled apps. These mapping files link the debugger to your source code, which enables debugging. Hopefully this will put a stop to those who want to build in windows in debug mode (which is not possible, see #772) This does not include the pdb files in the installers, so the only way to get them is build locally. Signed-off-by: Robin Getz <[email protected]>
With the pattern change from
#if WITH_USB_BACKEND
..
#endif
to
if (WITH_USB_BACKEND) {
....
}
I'm getting linker errors related to usb_context_scan() etc.
MSVC compiler is not smart enough to do dead code removal, or I haven't found the right switches.
Been some other reports in for different libraries of the same issue with MSVC.
Thoughts?
The text was updated successfully, but these errors were encountered: