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

动态库创建

parent bb696b4b
#pragma once #pragma once
#include "pandaAlgorithm.h"
/** /**
遗传算法对象 遗传算法对象
*/ */
class Genetic class PANDAALGORITHM_API Genetic
{ {
public: public:
Genetic(); Genetic();
...@@ -47,6 +48,7 @@ public: ...@@ -47,6 +48,7 @@ public:
*@brief 更新种群 *@brief 更新种群
*/ */
void update(); void update();
void setNumPop(int numPop) { mNumPop = numPop; } void setNumPop(int numPop) { mNumPop = numPop; }
int numPop() const { return mNumPop; } 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 @@ ...@@ -119,7 +119,7 @@
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_DEBUG;_CONSOLE;PANDAALGORITHM_DLL;PANDAALGORITHM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
</ClCompile> </ClCompile>
<Link> <Link>
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck> <SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>NDEBUG;_CONSOLE;PANDAALGORITHM_DLL;PANDAALGORITHM_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode> <ConformanceMode>true</ConformanceMode>
</ClCompile> </ClCompile>
<Link> <Link>
...@@ -142,9 +142,14 @@ ...@@ -142,9 +142,14 @@
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
<PostBuildEvent>
<Command>copy pandaAlgorithm.h $(OutDir)..\include /y
copy genetic.h $(OutDir)..\include /y</Command>
</PostBuildEvent>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="genetic.h" /> <ClInclude Include="genetic.h" />
<ClInclude Include="pandaAlgorithm.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="genetic.cpp" /> <ClCompile Include="genetic.cpp" />
......
...@@ -18,6 +18,9 @@ ...@@ -18,6 +18,9 @@
<ClInclude Include="genetic.h"> <ClInclude Include="genetic.h">
<Filter>头文件</Filter> <Filter>头文件</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="pandaAlgorithm.h">
<Filter>头文件</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="genetic.cpp"> <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