Commit 405b7a54 authored by 刘乐's avatar 刘乐

动态库创建

parent bb696b4b
#pragma once
#include "pandaAlgorithm.h"
/**
遗传算法对象
*/
class Genetic
class PANDAALGORITHM_API Genetic
{
public:
Genetic();
......@@ -47,6 +48,7 @@ public:
*@brief 更新种群
*/
void update();
void setNumPop(int numPop) { mNumPop = numPop; }
int numPop() const { return mNumPop; }
......
#pragma once
#if defined(PANDAALGORITHM_DLL)
#if defined(PANDAALGORITHM_EXPORTS)
#if defined(_MSC_VER)
#define PANDAALGORITHM_API __declspec(dllexport)
#else
#define PANDAALGORITHM_API
#endif
#else
#if defined(_MSC_VER)
#define PANDAALGORITHM_API __declspec(dllimport)
#else
#define PANDAALGORITHM_API
#endif
#endif
#else
#define PANDAALGORITHM_API
#endif
......@@ -119,7 +119,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;PANDAALGORITHM_DLL;PANDAALGORITHM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
......@@ -133,7 +133,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;PANDAALGORITHM_DLL;PANDAALGORITHM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
</ClCompile>
<Link>
......@@ -142,9 +142,14 @@
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<PostBuildEvent>
<Command>copy pandaAlgorithm.h $(OutDir)..\include /y
copy genetic.h $(OutDir)..\include /y</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="genetic.h" />
<ClInclude Include="pandaAlgorithm.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="genetic.cpp" />
......
......@@ -18,6 +18,9 @@
<ClInclude Include="genetic.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="pandaAlgorithm.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="genetic.cpp">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment