问题描述
在Cygwin中,出于问题cygA.dll
和cygB.dll
(还有更多,但此处不相关)的问题,我有一个链接到共享库的可执行文件。据我所知,应该将PATH
用于cygA.dll
在Cygwin中的共享库路径。然后,我尝试运行可执行文件,并期望找不到cygB.dll
的错误。令我惊讶的是,我得到了error while loading shared libraries: cygA.dll: cannot open shared object file: No such file or directory
用ldd
检查没有显示任何.dll条目,但是cygcheck
正确报告了cygcheck: track_down: could not find cygB.dll
我还有一个具有指向cygA.dll
的相同共享链接的不同可执行文件,该文件没有问题。
在将cygA.dll
的路径放在PATH
上后,我的新可执行文件也可以正常运行。因此Cygwin找不到cygB.dll
,但错误地将cygA.dll
报告为丢失的那个。这对于一个大型项目可能会很痛苦... 这是预期的行为还是错误 ?在后一种情况下,存在什么错误?我应该向Cygwin报告吗?
解决方法
如果cygwin缺少二级DLL,则只能看到加载一级DLL的失败。 Windows无法传递信息
您可以使用strace获得相关信息 EG:
<MenuItem x:Name="tesst" Header="nane" >
<MenuItem.Template>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border x:Name="templateRoot" SnapsToDevicePixels="true"
BorderThickness="{TemplateBinding Control.BorderThickness}"
Background="{TemplateBinding Control.Background}"
BorderBrush="{TemplateBinding Control.BorderBrush}">
<Grid VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter x:Name="Icon" ContentSource="Icon"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" VerticalAlignment="Center"
HorizontalAlignment="Center" Width="16" Height="16" Margin="3"/>
<Path x:Name="GlyphPanel" Data="M 0,0 L 4,3.5 L 0,7 Z" FlowDirection="LeftToRight" Margin="3"
Visibility="Collapsed" VerticalAlignment="Center" Fill="{TemplateBinding Control.Foreground}"/>
<ContentPresenter Grid.Column="1" ContentSource="Header" RecognizesAccessKey="true"
Margin="{TemplateBinding Control.Padding}"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"/>
<Popup x:Name="PART_Popup" AllowsTransparency="true" Focusable="false"
PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
Placement="Bottom"
IsOpen="{Binding IsSubmenuOpen,RelativeSource={RelativeSource TemplatedParent}}"
PlacementTarget="{Binding ElementName=templateRoot}">
<Border x:Name="SubMenuBorder" Background="#FFF0F0F0" BorderBrush="#FF999999" BorderThickness="1" Padding="2">
<ScrollViewer x:Name="SubMenuScrollViewer" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,TypeInTargetAssembly={x:Type FrameworkElement}}}">
<Grid RenderOptions.ClearTypeHint="Enabled">
<Canvas Height="0" Width="0" HorizontalAlignment="Left" VerticalAlignment="Top">
<Rectangle Name="OpaqueRect" Height="{Binding ElementName=SubMenuBorder,Path=ActualHeight}"
Width="{Binding ElementName=SubMenuBorder,Path=ActualWidth}"
Fill="{Binding ElementName=SubMenuBorder,Path=Background}"/>
</Canvas>
<Rectangle HorizontalAlignment="Left" Width="0" Margin="29,2,2" Fill="#FFD7D7D7"/>
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle"
KeyboardNavigation.TabNavigation="Cycle" Grid.IsSharedSizeScope="true"
SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"/>
</Grid>
</ScrollViewer>
</Border>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="MenuItem.IsSuspendingPopupAnimation" Value="true">
<Setter TargetName="PART_Popup" Property="Popup.PopupAnimation" Value="None"/>
</Trigger>
<Trigger Value="{x:Null}" Property="MenuItem.Icon">
<Setter TargetName="Icon" Property="UIElement.Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="MenuItem.IsChecked" Value="true">
<Setter TargetName="GlyphPanel" Property="UIElement.Visibility" Value="Visible"/>
<Setter TargetName="Icon" Property="UIElement.Visibility" Value="Collapsed"/>
</Trigger>
<Trigger Property="MenuItem.IsHighlighted" Value="true">
<Setter TargetName="templateRoot" Value="#3D26A0DA" Property="Border.Background"/>
<Setter TargetName="templateRoot" Value="#FF26A0DA" Property="Border.BorderBrush"/>
</Trigger>
<Trigger Property="UIElement.IsEnabled" Value="false">
<Setter TargetName="templateRoot" Value="#FF707070" Property="TextElement.Foreground"/>
<Setter TargetName="GlyphPanel" Value="#FF707070" Property="Shape.Fill"/>
</Trigger>
<Trigger SourceName="SubMenuScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
<Setter TargetName="OpaqueRect" Value="{Binding ElementName=SubMenuScrollViewer,Path=VerticalOffset}" Property="Canvas.Top"/>
<Setter TargetName="OpaqueRect" Value="{Binding ElementName=SubMenuScrollViewer,Path=HorizontalOffset}" Property="Canvas.Left"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</MenuItem.Template>
<MenuItem.ItemsPanel>
...
但是Windows正确提供了弹出信息: