cpubbs论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

LabVIEW+单片机学习套件全套教程资料下载[免费]LabVIEW论坛精华列表贴USB0816数据采集卡《LabVIEW宝典》
LabWindows/CVI论坛精华贴NET0816以太网数据采集卡RC0210远程设备授权系统 关闭关停锁定打开设备 户外分布式数据采集
NET1624低速高精度以太网数据采集卡WIFI0824SD无线WIFI网络数据采集卡脱机运行 SD存储 小尺寸微型 串口采集远程采集 安卓 手持移动采集 纪录仪
查看: 1968|回复: 1

[labview求助] 求助用导入共享库导入函数工具!

[复制链接]
发表于 2015-1-12 16:00:18 | 显示全部楼层 |阅读模式
用Import Shared Library导入dll的函数,出现错误《《Undefined symbols can prevent the wizard from recognizing functions and parameters. To correct this problem, check the header file to determine if you must add preprocessor definitions. Click the Back button to return to the previous page of the wizard to add a preprocessor definitionsl (for example, "NIAPI_stdcall = __stdcall" or "NIAPIDefined = 1").》》,在”配置包含路径和预处理定义“对话框中把头文件可能的预处理宏定义都试了还是不能解决。以下是头文件的宏预定义部分以及其中的两个函数GXInitLib()和GXCloseLib(),完整的.h和.dll文件见附件,哪位大神帮忙以下?
#ifndef GX_GALAXY_H
#define GX_GALAXY_H
//////////////////////////////////////////////////////////////////////////
//        类型定义,以下类型都在标准C库头文件stdint.h中有定义,但是在微软的编译平台
//        VS2010之前的版本中都不包含此文件,所以在此需要重定义
//////////////////////////////////////////////////////////////////////////
#if defined(_WIN32)
        #ifndef _STDINT_H
                #ifdef _MSC_VER // Microsoft compiler
                        #if _MSC_VER < 1600
                                typedef __int8            int8_t;
                                typedef __int16           int16_t;
                                typedef __int32           int32_t;
                                typedef __int64           int64_t;
                                typedef unsigned __int8   uint8_t;
                                typedef unsigned __int16  uint16_t;
                                typedef unsigned __int32  uint32_t;
                                typedef unsigned __int64  uint64_t;
                        #else
                                // In Visual Studio 2010 is stdint.h already included
                                #include <stdint.h>
                        #endif
                #else
                        // Not a Microsoft compiler
                        #include <stdint.h>
                #endif
        #endif
#else
        // Linux
        #include <stdint.h>
#endif
//------------------------------------------------------------------------------
//  操作系统平台定义
//------------------------------------------------------------------------------
#include <stddef.h>

#ifdef WIN32
        #ifndef _WIN32
                #define _WIN32
        #endif
#endif

#ifdef _WIN32
        #include <Windows.h>
        #define GX_DLLIMPORT   __declspec(dllimport)
        #define GX_DLLEXPORT   __declspec(dllexport)

        #define GX_STDC __stdcall
        #define GX_CDEC __cdecl

        #if defined(__cplusplus)
                #define GX_EXTC extern "C"
        #else
                #define GX_EXTC
        #endif
#else
        // remove the None #define conflicting with GenApi
        #undef None
        #if __GNUC__>=4
                #define GX_DLLIMPORT   __attribute__((visibility("default")))
                #define GX_DLLEXPORT   __attribute__((visibility("default")))

                #if defined(__i386__)
                        #define GX_STDC __attribute__((stdcall))
                        #define GX_CDEC __attribute__((cdecl))
                #else
                        #define GX_STDC
                        #define GX_CDEC
                #endif

                #if defined(__cplusplus)
                        #define GX_EXTC extern "C"
                #else
                        #define GX_EXTC
                #endif
        #else
                #error Unknown compiler
        #endif
#endif

#ifdef GX_GALAXY_DLL
        #define GX_DLLENTRY GX_EXTC GX_DLLEXPORT
#else
        #define GX_DLLENTRY GX_EXTC GX_DLLIMPORT
#endif
typedef int32_t GX_STATUS;
#define GX_API GX_EXTC GX_STATUS GX_STDC
GX_API GXInitLib();
GX_API GXCloseLib();
#endif  //GX_GALAXY_H




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
 楼主| 发表于 2015-1-17 16:02:22 | 显示全部楼层
额。。。解决了,把出错后面列出的未定义的宏复制过去就行了。。。这是什么原理呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|cpubbs论坛. ( 粤ICP备09171248号 )

GMT+8, 2025-5-5 02:13 , Processed in 0.508058 second(s), 9 queries , Gzip On, File On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表