Skip to content

[DLL] Minimax algorithm #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ build
*.asta.lock
*.jude
*.idea
cmake-build-release
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ add_subdirectory(AdversarialSearch/Minimax)
add_subdirectory(Miscellaneous)
add_subdirectory(NeuralNetwork/Perceptron)
add_subdirectory(NeuralNetwork/MLP)
add_subdirectory(Export)
9 changes: 9 additions & 0 deletions Export/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
add_definitions(-D MATHLIBRARY_EXPORTS)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/DLL)

set(FILES
MathLibrary.cpp
)
add_executable(MathLibrary ${FILES})

add_library(MathLibrary_DLL SHARED MathLibrary.cpp)
16 changes: 16 additions & 0 deletions Export/MathLibrary.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#include "MathLibrary.h"

int sum(int lhs, int rhs)
{
return lhs + rhs;
}

int getOne()
{
return 1;
}

int main(int argc, char *argv[])
{
return 0;
}
12 changes: 12 additions & 0 deletions Export/MathLibrary.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// MathLibrary.h - Contains declarations of math functions
#pragma once

#ifdef MATHLIBRARY_EXPORTS
#define MATHLIBRARY_API __declspec(dllexport)
#else
#define MATHLIBRARY_API __declspec(dllimport)
#endif

extern "C" MATHLIBRARY_API int sum(int lhs, int rhs);

extern "C" MATHLIBRARY_API int getOne();