Windows Vista DLL Creation: Difference between revisions

From OpenSeesWiki
Jump to navigation Jump to search
(Created page with ' The foll'''Bold text'''owing is the 24 steps needed to build a .dll & 4 steps to test it. This is hopefully foolproof! 1. Open ViualStudio 2. File -> New Project 3. Give it nam...')
 
No edit summary
Line 1: Line 1:
The foll'''Bold text'''owing is the 24 steps needed to build a .dll & 4 steps to test it. This is hopefully foolproof!
The foll'''Bold text'''owing is the 24 steps needed to build a .dll & 4 steps to test it. This is hopefully foolproof!


1. Open ViualStudio
1. Open ViualStudio
2. File -> New Project
2. File -> New Project
3. Give it name of the '''New class''' and location of current class files (ElasticPPCPP and C:\???\OpenSeesDeveloper\material
3. Give it name of the '''New class''' and location of current class files (ElasticPPCPP and C:\???\OpenSeesDeveloper\material
4. Select OK.
4. Select OK.
5. New windows pops up, Select Application Settings
5. New windows pops up, Select Application Settings
6. Select DLL AND select Empty Project
6. Select DLL AND select Empty Project
7. Select Finish
7. Select Finish


Line 13: Line 18:


8. Right click on source files, select add Existing Item.
8. Right click on source files, select add Existing Item.
9. browse to the class file (should be up 1 directory, select it (elasticPPcPP.cpp)
9. browse to the class file (should be up 1 directory, select it (elasticPPcPP.cpp)
10.Right click on heared files, select add existing item.
10.Right click on heared files, select add existing item.
11. browse to header file, select it (elasticOOCPP.h)
11. browse to header file, select it (elasticOOCPP.h)
12. right click on Project (ElasticPPCPP), select build.
12. right click on Project (ElasticPPCPP), select build.


'''It fails in compilation''', as cannot find file elementAPI.h
'''It fails in compilation''', as cannot find file elementAPI.h
13. right click on Project (ElasticPPCPP), select Properties.
13. right click on Project (ElasticPPCPP), select Properties.
14. select C/C++ folder icon
14. select C/C++ folder icon
15. In Configuration pull down menu, select all Configurations
15. In Configuration pull down menu, select all Configurations
16. Click 3 dots to right of Additional Include Directories
16. Click 3 dots to right of Additional Include Directories
17. In window that pops up, select folder
17. In window that pops up, select folder
18. add to line ..\..\core (this directory contains the elementAPI.h file).
18. add to line ..\..\core (this directory contains the elementAPI.h file).
19. select ok.
19. select ok.
20 right click on project (ElasticPPCPP), select build
 
20. right click on project (ElasticPPCPP), select build


'''It fails in Linking''', a lot of unresolved external symbols.
'''It fails in Linking''', a lot of unresolved external symbols.
21. Right click on source files, select add Existing Item.
21. Right click on source files, select add Existing Item.
22. browse to the core directory (should be 1 directory up)
22. browse to the core directory (should be 1 directory up)
23. select all the .cpp files here
23. select all the .cpp files here
24. right click on Project (ElasticPPCPP), select build.
24. right click on Project (ElasticPPCPP), select build.


IT SHOULD WORK! .. IF IT FAILS GET MY ATTENTION.
IT SHOULD WORK! .. IF IT FAILS GET MY ATTENTION.
Line 39: Line 61:


1. using windows finder, copy the .dll (C:\??\OpenSeesDeveloper\material\ElasticPPCPP\Debug) into the class directory (C:\???\material\)
1. using windows finder, copy the .dll (C:\??\OpenSeesDeveloper\material\ElasticPPCPP\Debug) into the class directory (C:\???\material\)
2. run OpenSees (2.2.0) (C:\??\OpenSeesDeveloper\bin)
2. run OpenSees (2.2.0) (C:\??\OpenSeesDeveloper\bin)
3. cd into directory containing example (cd ..\material)
3. cd into directory containing example (cd ..\material)
4. source an example script containing your new command, i.e. type: "source example1.tcl"
4. source an example script containing your new command, i.e. type: "source example1.tcl"


IT SHOULD RUN THE SCRIPT! .. IF IT FAILS GET MY ATTENTION.
IT SHOULD RUN THE SCRIPT! .. IF IT FAILS GET MY ATTENTION.

Revision as of 19:23, 30 August 2010

The follBold textowing is the 24 steps needed to build a .dll & 4 steps to test it. This is hopefully foolproof!

1. Open ViualStudio

2. File -> New Project

3. Give it name of the New class and location of current class files (ElasticPPCPP and C:\???\OpenSeesDeveloper\material

4. Select OK.

5. New windows pops up, Select Application Settings

6. Select DLL AND select Empty Project

7. Select Finish

a new project pops up in the workspace with class name (ElasticPPCPP)

8. Right click on source files, select add Existing Item.

9. browse to the class file (should be up 1 directory, select it (elasticPPcPP.cpp)

10.Right click on heared files, select add existing item.

11. browse to header file, select it (elasticOOCPP.h)

12. right click on Project (ElasticPPCPP), select build.

It fails in compilation, as cannot find file elementAPI.h

13. right click on Project (ElasticPPCPP), select Properties.

14. select C/C++ folder icon

15. In Configuration pull down menu, select all Configurations

16. Click 3 dots to right of Additional Include Directories

17. In window that pops up, select folder

18. add to line ..\..\core (this directory contains the elementAPI.h file).

19. select ok.

20. right click on project (ElasticPPCPP), select build

It fails in Linking, a lot of unresolved external symbols.

21. Right click on source files, select add Existing Item.

22. browse to the core directory (should be 1 directory up)

23. select all the .cpp files here

24. right click on Project (ElasticPPCPP), select build.


IT SHOULD WORK! .. IF IT FAILS GET MY ATTENTION.

Now test it,

1. using windows finder, copy the .dll (C:\??\OpenSeesDeveloper\material\ElasticPPCPP\Debug) into the class directory (C:\???\material\)

2. run OpenSees (2.2.0) (C:\??\OpenSeesDeveloper\bin)

3. cd into directory containing example (cd ..\material)

4. source an example script containing your new command, i.e. type: "source example1.tcl"

IT SHOULD RUN THE SCRIPT! .. IF IT FAILS GET MY ATTENTION.