`

use VRPN on GearVR, or porting VRPN from win64/win32 to Android

阅读更多

 

1、 VRPN include .lib static library On Win64/Win32 plateform,if u need it running On Android,U need to convert to Linux Plateform as a .so dynamic library or .a static library

You may need to install the enviroment of MinGW (Minimalist GNU on Windows) 可在windows下编译linux程序的仿真linux编译环境,它提供了linux下的C、C++头文件、系统库和一些linux下的编译工具集合如gcc、g++和make工具 mingw-w64-install.zip or mingw-get-setup.exe (version 0.6.2, win32)

Installer step:
1. "MinGW Installation Manager"  Select the package you wish to manage,include  "Basic Setup" and "All Packages", GCC need 3 tools: MinGW base toolsg++ compilerMinGW Make. open the Installation menu and select the "Apply Changes" operation.
2. Ensure that MSYS knows where MinGW is located,  located to path "E:\Program Files\MinGW\mingw-win32\msys\1.0\etc\fstab", and ensure "fstab" contains one line:
     "E:/Program Files/MinGW/mingw-win32    /mingw".
3. Environment Settings
  • Right-click on your "My Computer" icon and select "Properties". Click on the "Advanced" tab, then on the "Environment Variables" button.
  • You should be presented with a dialog box with two text boxes. The top box shows your user settings. The PATH entry in this box is the one you want to modify. Note that the bottom text box allows you to change the system PATH variable. You should not alter the system path variable in any manner, or you will cause all sorts of problems for you and your computer!
  • Click on the PATH entry in the TOP box, then click on the "Edit" button
  • Scroll to the end of the string and at the end add “
    ;<installation-directory>\bin
  • press OK -> OK -> OK and you are done.

 

转换工具 mingw-utils-0.3.tar ,get "\bin\reimp.exe" copyTo "mingw\bin\",或者将 reimp.exe 拷贝到将要转换的 .lib 目录。

use rimp.exe convert .lib to .a
C:\Users\admin>E:
E:\>
E:\>cd Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015>
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015> reimp quat.lib
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015> reimp gpsnmea.lib
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015> reimp vrpn.lib
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015> reimp vrpn_HID_device_watcher.lib
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015> reimp vrpn_server.lib
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015> reimp vrpn_timecode_generator.lib
E:\Plugins\RTSPlugin\Source\ThirdParty\Vrpn\Lib\VS2015> reimp vrpnserver.lib

reimp consle help ( if u genarated .obj file ,you can use "dlltool quat.obj -l quat.a" to genarated .a file ):
Usage: reimp [options] IMPLIB
  -s, --dump-symbols      dump symbols to stdout
  -d, --only-def          only create .def files
  -c, --keep-case         keep case in lib*.a file names
  --dlltool <name>        use <name> for dlltool
  --as <name>             use <name> for assembler

 

Readme for reimp

* Overview
`reimp' is a tool to convert Microsoft's new-style (short) import libraries to import libraries for win32 ports of GNU tools (mingw32,cygwin).
`reimp' reads an MS import library and writes all imports to the corresponding .DEF file(s) that it feeds to `dlltool' that creates the import library.

* Invocation
Usage: reimp [options] IMPLIB

Options:
-s, --dump-symbols dump symbols to stdout
-d, --only-def only create .def files
-c, --keep-case keep case in lib*.a file names
--dlltool use for dlltool
--as use for assembler

The `--dump-symbols' option makes `reimp' use a quick method for
finding imported symbols and sending the names of found symbols to
stdout. If the input library contain non-imported symbols they will be
listed as well. The output symbols will have all decoration preserved
(i.e '_' will prefix most symbols), so if you feed it to dlltool you
should strip leading underscores. For example
echo EXPORTS > imp.def
reimp imp.lib | sed 's/_//' >> imp.def
dlltool -k --def imp.def --output-lib libimp.a --dllname imp.dll
The `--only-def' option makes `reimp' stop after generating the .DEF
file(s).
By default `reimp' converts all output library names to lower-case. By
using the `keep-case' option `reimp' will use exactly the case of the
DLL imported from when creating an import library. KERNEL32.dll will
generate libKERNEL32.a and not libkernel32.a as it would be default.

* Notes on mixed libraries
If an input library contain regular objects (non-imports, i.e code and
data) `reimp' will write out those objects unless you specify one of
the `--only-def' and `--dump-symbols' options. You probably want to
include those objects as well in the generated library. `reimp'
doesn't do that automatically so you have to do it manually using `ar', like this
# this generates several .o or .obj files.
reimp imp.lib
# add them to library
ar rcs libimp.a *.obj

 

 

OR

 

use "lib2a" (LIB to A converter) Free Open Source program - GNU GPL Licence.

 

This tool automatically converts a .LIB file (MS Visual C linker library) into .A file (MinGW linker library).
It is useful to make a C/C++ program a reusable component.

I have written it because I did not have found a such tool over the Net.

 

The main program is LIB2A.bat that performs successive stages for converting .LIB file to .A file into in the "convert" folder.

 

How it works

The conversion process is accomplished in several steps:
1. Copy your .LIB file and .DLL file into the "convert" folder.
1. Edit and replace the files names in the four first lines at the LIB2A.bat.
1. Run LIB2A.bat.

You can find your .A linker library into the "convert" folder.

 

 2、UE4 Create a Blank C++ Project, Open the Item "Edit" > "Plugin" > "New Plugin", choose a template and then specify a name to create a new plugin.

Blank: 创建一个空白的 最少量代码的 Plugin, 合并或者建立一个非可视化的 Plugin。在 Plugin list 可以看到该插件。

Content Only: 创建一个只包含内容的 Plugin。

Blueprint library: 创建一个包含 BlueprintFunctionLibrary 的 Plugin。用于创建一个静态的蓝图节点。

Editor Toolbar Button: 创建一个可以在 LevelEditor 的工具栏 添加 button 的 Plugin,然后创建并实现该 button 的 "OnButtonClick" event.

Editor Standalone Window: 创建一个可在 LevelEditor 工具栏添加 button 的Plugin,点击 button 将唤醒一个空的 独立选项卡窗口。

Editor Mode: 创建一个编辑器模式的 Plugin,将包含一个工具包示例,指定显示在 “Modes” 标签的 UI。还将包含基本的 UI 说明 editor 交互 和 undo/redo 功能的使用。

Thridparty Library:创建一个包含第三方库的 Plugin,包含了一个howTo include、load、use 第三方库的示例。

 

 this is my RTS Plugin folder:
 
 Plugins\RTS\Source\ThirdParty\RTSLibrary

 

打包 Android / Linux 平台 UE4 Plugin link 第三方库:将转换成 .a /.so (此处为 vrpn.a)放入 “Plugins\RTS\Source\ThirdParty\RTSLibrary\Android” 目录;

打包 Mac 平台 UE4 Plugin link 第三方库 : 将转换成 .dylib (此处为 libExampleLibrary.dylib)放入 “Plugins\RTS\Source\ThirdParty\RTSLibrary\Mac\Release” 目录;

打包 Win64/Win32 平台 UE4 Plugin link 第三方库:将转换成 .lib/.dll(此处为 vrpn.lib)放入 “Plugins\RTS\Source\ThirdParty\RTSLibrary\x64” 目录;

 

 在 RTS plugin

 

未完待续....

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 大小: 10.2 KB
  • 大小: 31.5 KB
分享到:
评论

相关推荐

    mtp usb驱动32和64位下载(win7mtp usb驱动) Media Transfer Protocol Porting Kit

    mtp usb驱动32和64位下载(win7mtp usb驱动) Media Transfer Protocol Porting Kit 媒体传输协议移植工具包 解决手机连接电脑驱动安装失败导致手机识别不了的问题

    MTP Porting Kit 12.0(包含32位和64位

    MTP Porting Kit 12.0 是一个专门用于处理Media Transfer Protocol (MTP) 的移植工具包,适用于32位和64位操作系统。这个工具包旨在帮助开发者和用户在不同的设备上顺利实现MTP协议的支持,从而实现更高效、更安全的...

    Android Wifi Driver Porting

    标题与描述概述的知识点主要涉及Android系统中Wi-Fi驱动的移植过程,这在移动设备开发领域是一项关键技能,尤其对于那些希望优化或自定义设备Wi-Fi功能的开发者来说至关重要。以下是对这一知识点的深入解析: ### ...

    Android-Porting-on-Embedded-Platform.rar_android_android porting

    总的来说,"Android-Porting-on-Embedded-Platform"涵盖了Android在嵌入式平台移植的全貌,包括硬件驱动开发、内核移植、系统编译、UI适配以及测试调试等多个层面的知识。无论是对硬件工程师还是软件开发者,深入...

    Android Porting On Real Target

    "Android Porting On Real Target" Android 作为一个移动设备软件栈,包括操作系统、中间件和关键应用程序。本文档将详细介绍 Android 架构和将其移植到真实硬件目标的过程。 Android 架构 Android 的核心组件...

    Porting to 64-bit ARM

    ### 64位ARM移植与开发指南 #### 引言:为什么选择64位? 在IT行业中,随着技术的发展和需求的变化,对于处理器架构的选择也日益成为关注的焦点。64位ARM架构作为一项重要的技术进步,正在逐渐取代传统的32位架构...

    Android Porting Guide

    ### Android Porting Guide详解 #### 一、概览 本文档是关于如何为特定硬件平台进行Android系统移植的指南。Android作为一个开源项目,其灵活性允许开发者根据不同的硬件需求进行定制和优化。本指南由Rockie Cheng...

    Embedded Android - Porting, Extending and Customizing

    综上所述,《嵌入式Android - Porting, Extending and Customizing》这本书不仅深入浅出地讲解了如何将Android系统移植到各种嵌入式设备上,还提供了大量的实践案例和实用技巧,对于希望在这个领域有所作为的专业...

    Embedded Android Porting, Extending, and Customizing 2013最新版

    ### 嵌入式Android移植、扩展与定制 #### 知识点概览 1. **嵌入式Android概述** 2. **移植Android系统至不同硬件平台** 3. **定制化Android系统的方法** 4. **扩展Android功能的技术** 5. **Android构建系统的深入...

    android_wifi_porting_eng.doc

    ### Android WiFi移植指南 本文档将引导您逐步了解如何在定制版Android系统中添加新的WiFi驱动并确保WiFi功能正常运行。此文档最初是为Android 2.1版本编写的,但其中的概念和技术同样适用于之前的Android版本,...

    Making Win32 Applications Mobile Porting to Windows CE; PDF

    ### 将Win32应用程序移植到Windows CE:关键知识点解析 #### 一、概述 《将Win32应用程序移植到Windows CE》这本书由Nancy Nicolaisen撰写,并由Wiley Publishing, Inc.出版。该书主要针对那些希望将基于Windows...

    Embedded Android Porting,Extending, and Customizing

    标题和描述中提到的《Embedded Android Porting, Extending, and Customizing》是一本与嵌入式Android移植、扩展和定制相关的专业书籍。这本书被视为创建基于Android系统的系统开发者的重要参考资源。由于本书不是由...

    porting android

    【Porting Android】是指将Android操作系统移植到不同的硬件平台或者设备上,使其能够在这些平台上运行。这个过程涉及到多个层面的技术工作,包括驱动程序开发、编译系统调整、内核适配以及用户空间应用的兼容性处理...

    Android_Porting台湾 移植与研究实行.zip

    《Android移植与研究实行》是针对Android操作系统在台湾地区的移植和优化进行深入探讨的专业资料。这份压缩包包含的PDF文档,很可能是详细讲解了如何将Android系统适应台湾的硬件环境、语言需求以及本地化服务的过程...

Global site tag (gtag.js) - Google Analytics