Giter Club home page Giter Club logo

unity-uwp-il2cpp-with-csharp-project-example's People

Contributors

tautvydaszilys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-uwp-il2cpp-with-csharp-project-example's Issues

Linker problem

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.

Got error: unresolved external symbol "__declspec(dllimport) void __stdcall AddActivatedEventArgs(struct IInspectable *)" (__imp_?AddActivatedEventArgs@@YGXPAUIInspectable@@@Z)

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!

Will this approach work with Unity 2018?

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.