AIX编译报错 "No licenses available" 如何解决?

本文介绍了如何通过重启许可服务解决C编译过程中遇到的许可不足的问题。通过使用i4cfg工具停止并重新启动相关子系统,使得编译过程恢复正常。

1506-507 (W) No licenses available. Contact your program supplier to add additional users. Compilation will proceed shortly.

/ >cd usr/opt/ifor/bin
/usr/opt/ifor/bin >./i4blt -sl cn


i4blt Version 4.6.8 AIX -- LUM Basic License Tool
(c) Copyright 1995-2004, IBM Corporation, All Rights Reserved
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.
(c) Copyright 1991-1997 Gradient Technologies Inc., All Rights Reserved
(c) Copyright 1991,1992,1993, Hewlett-Packard Company, All Rights Reserved

ADM-10037: There are no active license servers

/usr/opt/ifor/bin >lssrc -a |grep ifor
llbd             iforncs                       inoperative
glbd             iforncs                       inoperative
i4lmd            iforls                        inoperative
i4glbcd          iforncs                       inoperative
i4gdb            iforls                        inoperative
i4llmd           iforls                        inoperative

【解决方法】

/usr/opt/ifor/bin >./i4cfg -stop
i4cfg Version 4.6.8 AIX -- LUM Configuration Tool
(c) Copyright 1995-2004, IBM Corporation, All Rights Reserved
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.

/usr/opt/ifor/bin >./i4cfg -start
i4cfg Version 4.6.8 AIX -- LUM Configuration Tool
(c) Copyright 1995-2004, IBM Corporation, All Rights Reserved
US Government Users Restricted Rights - Use, duplication or disclosure
restricted by GSA ADP Schedule Contract with IBM Corp.

0513-059 The i4llmd Subsystem has been started. Subsystem PID is 823524.

'Start Services' has completed successfully

/usr/opt/ifor/bin >lssrc -a |grep ifor
i4llmd           iforls           823524       active
llbd             iforncs                       inoperative
glbd             iforncs                       inoperative
i4lmd            iforls                        inoperative
i4glbcd          iforncs                       inoperative
i4gdb            iforls                        inoperative

问题解决,c编译不再报错。

### VS2012 中因引用不同版本 DLL 导致编译错误的解决方案 在 Visual Studio 2012 (VS2012) 开发环境中,当项目中存在多个版本的 DLL 文件时,可能会因为版本冲突而导致编译错误。以下是针对此类问题的具体分析和解决办法。 #### 1. **问题原因** - 当项目中引用了相同名称但不同版本的 DLL 文件时,可能导致编译器无法解析正确的类型或命名空间。 - 如果某些 DLL 的依赖项未正确配置,或者目标框架不匹配,也可能引发类似的错误[^1]。 - 此外,如果项目中的依赖关系未正确设置,也会导致编译失败[^3]。 #### 2. **解决方法** ##### 方法一:清理并重新添加引用 - 删除当前项目中所有有问题的 DLL 引用。 - 手动将所需的 DLL 文件复制到项目的 `bin` 或 `Debug` 目录下。 - 在项目中右键单击“引用”,选择“添加引用”,然后浏览至新复制的 DLL 文件路径进行添加。 - 确保在添加引用时勾选“复制到本地”选项,以便在编译过程中自动将 DLL 文件复制到输出目录。 ##### 方法二:调整绑定重定向 - 如果项目中使用的是 .NET Framework,并且需要兼容不同版本的 DLL,可以通过编辑应用的配置文件 (`App.config`) 来实现绑定重定向。 - 配置示例如下: ```xml <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="YourDllName" publicKeyToken="yourPublicKeyToken"/> <bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="2.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration> ``` - 替换其中的 `YourDllName` 和 `publicKeyToken` 为实际的 DLL 名称及其公钥令牌[^1]。 ##### 方法三:检查目标框架一致性 - 确认项目的目标框架与所引用的 DLL 文件一致。如果不一致,可以尝试更改项目的 `.NET Framework` 版本来适配 DLL 的需求。 - 在 Visual Studio 中,右键单击项目 -> 属性 -> 应用程序 -> 更改目标框架。 ##### 方法四:修复 NuGet 包管理器中的依赖项 - 如果问题是由于 NuGet 包引起的,建议更新或卸载相关包后再重新安装最新版本。 - 使用命令行工具运行以下命令来强制恢复所有 NuGet 包: ```bash Update-Package –reinstall ``` ##### 方法五:处理第三方控件许可证问题 - 若项目涉及第三方控件(如 Telerik、DevExpress 等),需注意其许可证文件可能影响 DLL 加载行为。 - 将 `Properties\licenses.licx` 文件从源代码控制中移除,并确保每次构建前清空该文件的内容[^2]。 #### 3. **注意事项** - 对于 C++ 编写的原生 DLL 文件,在部署时还需确认是否存在其他必要的运行时库支持(如 VCRUNTIME140.DLL)。必要时可安装对应的 Microsoft Visual C++ Redistributable 包[^4]。 - 调试阶段可通过启用 Fusion Logging 工具查看具体的 Assembly Load Failure Log,从而定位加载失败的原因。 --- ### 示例代码片段 以下是一个简单的脚本用于验证特定目录下的所有 DLL 是否能够成功加载: ```csharp using System; using System.Reflection; class Program { static void Main(string[] args) { string dllPath = @"C:\YourProject\Bin\"; try { Assembly.LoadFrom(dllPath + "YourLibrary.dll"); Console.WriteLine("DLL loaded successfully."); } catch (Exception ex) { Console.WriteLine($"Error loading DLL: {ex.Message}"); } } } ``` ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值