gomoku / Carbon-Gomoku

Gomoku game (Five in a Row) playing program with a really strong advanced artificial intelligence algorithm (evaluation function, mini-max with cut offs, alpha-beta, transposition table, situation signatures, candidate generating, expert knowledge, further enhancements). Very heavly documented in author's native language (polish) - see Documentation_PL folder. Other tags: Tic Tac Toe, 5 in a Row, Go-Moku, Connect, Connect5, Connect6, Caro, Noughts and Crosses, AI, engine. Original author: Michał Czardybon Original website: http://mczard.republika.pl/gomoku.en.html Email: mczard@poczta.onet.pl Country: Poland Programming language: C++ IDE: Visual Studio 6.0 project (works also in 7.1) Year: 2002 (this project has over 13 years!) Notes: First time on any source code repository.
105 stars 43 forks source link

I am using Unity3D C#. How to transfer C++ to C# ? #1

Open HyVong007 opened 3 years ago

HyVong007 commented 3 years ago

I want to use this lib in Unity3D game. please help

ChisBread commented 3 years ago

"transfer C++ to C#" is not a good idea. try compile project to create Dll file and use 'DllImport' import c function. ref: https://stackoverflow.com/questions/19450783/how-to-use-dllimport-in-c

HyVong007 commented 3 years ago

To be able to use for C#, the C++ source code must be "P-Invoke" format, not PURE C++ ! Tell me if i was wrong ? if i compile a "Pure C++" to a DLL file, i am not sure if i could use file.DLL for C# ??

On Sat, May 8, 2021 at 2:50 PM Bread @.***> wrote:

"transfer C++ to C#" is not a good idea. compile project to create Dll File ref: https://stackoverflow.com/questions/19450783/how-to-use-dllimport-in-c

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gomoku/Carbon-Gomoku/issues/1#issuecomment-835184786, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEZ4J3ZKGUOY74MLEIQWOG3TMTUNJANCNFSM436OJYXA .

ChisBread commented 3 years ago

you are right! you have to export function like: extern "C" __declspec(dllexport) void foo();

HyVong007 commented 3 years ago

Thank you very much