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 ) , an emulated linux compilation environment for compiling linux programs under windows, it provides C, C++ header files, system libraries and some compiling tools under linux Collections such as gcc, g++ and make tools 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 tools g++ compiler MinGW 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.

 

Conversion tool mingw-utils-0.3.tar, get "\bin\ reimp.exe" copyTo " mingw\bin\ ", or copy reimp.exe to the .lib directory to be converted .

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 : Create a blank minimal code plugin, merge or create a non-visual plugin. The plugin can be seen in the Plugin list.

Content Only : Create a Plugin that only contains content.

Blueprint library : Create a Plugin that contains the BlueprintFunctionLibrary. Used to create a static blueprint node.

Editor Toolbar Button : Create a Plugin that can add a button to the LevelEditor's toolbar, and then create and implement the button's "OnButtonClick" event.

Editor Standalone Window : Create a Plugin that can add a button to the LevelEditor toolbar. Clicking the button will wake up an empty independent tab window.

Editor Mode : Creates an editor mode plugin that will contain a toolkit example specifying the UI displayed in the "Modes" tab. A basic UI will also be included to illustrate editor interaction and the use of undo/redo functionality.

Thridparty Library : Create a Plugin that includes third-party libraries, including an example of howTo include, load, and use third-party libraries.

 

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

 

Package the third-party library of UE4 Plugin link for Android / Linux platform: convert the .a /.so (vrpn.a here) into the "Plugins\RTS\Source\ThirdParty\RTSLibrary\Android" directory;

Package the UE4 Plugin link third-party library for the Mac platform: Convert the .dylib (here is libExampleLibrary.dylib) into the "Plugins\RTS\Source\ThirdParty\RTSLibrary\Mac\Release" directory;

Package the Win64/Win32 platform UE4 Plugin link third-party library: convert the .lib/.dll (vrpn.lib here) into the "Plugins\RTS\Source\ThirdParty\RTSLibrary\x64" directory;

 

 in RTS plugin

 

To be continued....

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326152763&siteId=291194637