Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

@koukiwf

手っ取り早くunityで既存cppをdll化して動かすやり方

※これは動作確認テストのために、いろいろ端折ったものです。
 最低限すら守っていません。

動いてるcppプロジェクトのcppファイルに
exturn "C" _declspec(dllexport) int test(){return 0;}
って追加して
プロジェクトのプロパティからc/c++のsdlをnoにして
configuration Typeをdllに変更してビルド

生成されたdll群をunityに突っ込んで
using System.Runtime.InteropService;
[DllImport("dll名(拡張子要らない)")]private static extern int test();
って追加して

Debug.Log(test().toString());

ってStart(){}にでも突っ込む。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?