tautvydaszilys / unity-uwp-il2cpp-with-csharp-project-example Goto Github PK
View Code? Open in Web Editor NEWThis project demonstrates how to use IL2CPP scripting backend when you want final UWP application to use a C# project.
This project demonstrates how to use IL2CPP scripting backend when you want final UWP application to use a C# project.
I my project I changed method declaration from:
AddActivatedEventArgs(IInspectable* activatedEventArgs)
to:
AddNavigatedEventArgs(const wchar_t* uri);
and had problems with building VS solution, I was getting error:
Error LNK2019 unresolved external symbol "__declspec(dllimport) void __cdecl AddNavigatedEventArgs(wchar_t const *)" (_imp?AddNavigatedEventArgs@@YAXPEB_W@Z) referenced in function "public: void __cdecl <lambda_04e3cba9169c0bbc1d026482afcbec48>::operator()(void)const " (??R<lambda_04e3cba9169c0bbc1d026482afcbec48>@@QEBAXXZ)
To make it work I had to change declaration in App.xaml.cpp from:
__declspec(dllimport) void __stdcall AddNavigatedEventArgs(const wchar_t* uri)
to:
__declspec(dllimport) extern "C" void __stdcall AddNavigatedEventArgs(const wchar_t* uri);
Without "extern "C"", compiler was changing the method name and linker wasn't able to find it.
Hi TautvydasZilys,
I try to follow your idea to do the same thing in a Unity UWP D3D IL2CPP app I developed. However, after I insert the code (C++ version) you suggested here I got the error:
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol "__declspec(dllimport) void __stdcall AddActivatedEventArgs(struct IInspectable *)" (_imp?AddActivatedEventArgs@@YGXPAUIInspectable@@@z) eDrawings E:\eDrawingsDev\HoloLens\Native_Unity\eDrawings\HoloLensBuild\eDrawings\App.obj 1
So I insert the VS code part in App.cpp because it's a D3D IL2CPP app.
Anything I am missing here to make it work? Thanks!
I wasn't able to make this work with Unity 2018.3. Any chance you could provide a version of this sample that targets 2018.3? I suspect I may have blundered in the way the project is configured, but it's not obvious.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.