dll创建中,遇到WARN:inconsistent dll linkage. dllexport assumed.

本文详细介绍了如何通过设置预处理器定义文本框来创建DLL导出库,并解释了如何将特定字符串加入其中以避免编译器的假设和警告。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

To create the DLL export library, select "setting..." from the Project menu. Select the C/C++ tab. Append, or insert, ",DLLDIR_EX" (without the quotation marks) to the Preprocessor Definition text box. Then click OK. This will prevent compiler assumptions and warnings。

要创建DLL导出库中,选择从项目菜单中的“设置...”。选择C/ C+ +选项卡。追加或插入“,DLLDIR_EX”(不带引号)到预处理器定义文本框。然后单击确定。这将防止编译器假设和警告。

如:

#ifndef _MYSERIALDLL_IMP
#define MYSERIALAPI __declspec(dllimport)
#else
#define MYSERIALAPI __declspec(dllexport)
#endif


需要将",_MYSERIALDLL_IMP"(不带引号)加入到预处理器定义文本框,警告才会消失。

D:/software/Gradle/wrapper/dists/gradle-8.4-all/caches/transforms-3/1c7ee2effc4702b7612f760440e420dd/transformed/jetified-databinding-ktx-8.3.2-api.jar!/META-INF/databindingKtx_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1. D:\wordCode\HiAppProject\HiApp\build\intermediates\packaged_manifests\envBetaDebug\AndroidManifest.xml:347: warn: unexpected element <intent-downloadFilter> found in <manifest><application><activity>. D:\wordCode\HiAppProject\HiApp\build\intermediates\packaged_manifests\envBetaDebug\AndroidManifest.xml:679: warn: unexpected element <state> found in <manifest><application><receiver><intent-filter>. D:\wordCode\HiAppProject\HiApp\build\intermediates\packaged_manifests\envBetaDebug\AndroidManifest.xml:743: warn: unexpected element <state> found in <manifest><application><receiver><intent-filter>. D:\wordCode\HiAppProject\HiApp\build\intermediates\packaged_manifests\envBetaDebug\AndroidManifest.xml:1344: warn: unexpected element <state> found in <manifest><application><receiver><intent-filter>. D:\wordCode\HiAppProject\HiApp\build\intermediates\packaged_manifests\envBetaDebug\AndroidManifest.xml:1359: warn: unexpected element <state> found in <manifest><application><receiver><intent-filter>. warn: removing resource com.huawei.appmarket:plurals/agguard_find_n_risk_app without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_recent_scan without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_recent_scan_title_all_apps without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_recent_scan_title_has_virus without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_safety_report_chart_processed without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_scan_item_unused_apps_tips_more without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_sync_fa_unsafe without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_tab_scan_unsafe_bottom_tip without required default value. warn: removing resource com.huawei.appmarket:plurals/agguard_unknown_app_card_content_more without required default value. warn: removing resource com.huawei.appmarket:plurals/appcomment_accessibility_disliked without required default value. warn: removing resource com.huawei.appmarket:plurals/appcomment_accessibility_like_zero without required default value. warn: removing resource com.huawei.appmarket:plurals/appcomment_accessibility_liked without required default value. warn: removing resource com.huawei.appmarket:plurals/appzone_comment_count without required default value. warn: removing resource com.huawei.appmarket:plurals/cancel_ignore_desc without required default value. warn: removing resource com.huawei.appmarket:plurals/detail_comment_commented_people without required default value. warn: removing resource com.huawei.appmarket:plurals/downloadedreport_app_limited_ex without required default value. warn: removing resource com.huawei.appmarket:plurals/downloadedreport_awardtype_point_ex without required default value. warn: removing resource com.huawei.appmarket:plurals/forum_cards_sort_title without required default value. warn: removing resource com.huawei.appmarket:plurals/image_selected_count_title without required default value. warn: removing resource com.huawei.appmarket:plurals/media_selected_count without required default value. warn: removing resource com.huawei.appmarket:plurals/pics_num_tips without required default value. warn: removing resource com.huawei.appmarket:plurals/server_upgrades_prompt_minute_format without required default value. warn: removing resource com.huawei.appmarket:plurals/update_notify_title_ex_new without required default value. warn: removing resource com.huawei.appmarket:plurals/video_num_tips without required default value. warn: removing resource com.huawei.appmarket:plurals/video_selected_count_title without required default value. warn: removing resource com.huawei.appmarket:plurals/weibo_share_word without required default value. warn: removing resource com.huawei.appmarket:string/about_fans_qq_group without required default value. warn: removing resource com.huawei.appmarket:string/about_weixin_account without required default value. warn: removing resource com.huawei.appmarket:string/about_xinweibo_account without required default value. warn: removing resource com.huawei.appmarket:string/agguard_add_security_control_explanation without required default value. warn: removing resource com.huawei.appmarket:string/agguard_app_intercept_description without required default value. 讲解报错
最新发布
07-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值