How do I compile the main.cpp in the Example1?

For developers writing C++, Fortran, Java, code who have questions or comments to make.

Moderators: silvia, selimgunay, Moderators

Post Reply
Random
Posts: 7
Joined: Thu Sep 22, 2016 4:58 am
Location: Huazhong University of Science and Technology
Contact:

How do I compile the main.cpp in the Example1?

Post by Random »

Can anyone tell me how I should do to build the main.cpp in vs2010(X64).I have no idea which file to include .
Thanks.
Last edited by Random on Fri Mar 24, 2017 7:00 am, edited 1 time in total.
Random
Posts: 7
Joined: Thu Sep 22, 2016 4:58 am
Location: Huazhong University of Science and Technology
Contact:

Re: How do I build the main.cpp in the Example1?

Post by Random »

Dear fmk and other developers:
http://opensees.berkeley.edu/community/ ... =4&t=60643
I figured out how to build it,
here is how:
1:use 32bit windows
2:use visual studio (because it uses visual C++ compiler)
3:create a new solution
4:add source files which are in quickmain project to it as source file(main.cpp,elemen_API.cpp,vc2005.cpp)
5:find all header files *.h files in a good revision (5563 is good) then copy them into a new directory(e.g headers)
6:find all *.lib files and copy them into new directory(e.g library)
7:adress "headers" directory as additional dependency in project properties(properties\config...properties\C\C++\general\additional include directory)
8:adress "library" directory as additional library directory
9:name all libs (about 37libs) as input for additional dependencies
if you got c4996 error then navigate to project properties and set sdl check to none and warning level to OFF and then surely the things going to work correctly contact me if any other thing shown up! good luck



I follow the steps Compiling Opensees Without Tcl,but I still get errors.I have some questions about the steps.We just add all .h files,what about .cpp files?

the errors:
tcl.lib(elementAPI_TCL.obj) : error LNK2005: "struct modState theModelState" (?theModelState@@3UmodState@@A) has been defined in elementAPI_Dummy.obj
1>tcl.lib(elementAPI_TCL.obj) : error LNK2005: _ops_error_has been defined in elementAPI_Dummy.obj
1>tcl.lib(elementAPI_TCL.obj) : error LNK2005: _OPS_GetNumRemainingInputArgs has been defined in elementAPI_Dummy.obj
1>tcl.lib(elementAPI_TCL.obj) : error LNK2005: _ops_getintinput_ has been defined in elementAPI_Dummy.obj
1>tcl.lib(elementAPI_TCL.obj) : error LNK2005: _ops_getdoubleinput_ has been defined in elementAPI_Dummy.obj
1>tcl.lib(elementAPI_TCL.obj) : error LNK2005: _ops_getstring has been defined in elementAPI_Dummy.obj
1>tcl.lib(elementAPI_TCL.obj) : error LNK2005: _OPS_GetStringCopy has been defined in elementAPI_Dummy.obj
1>tcl.lib(elementAPI_TCL.obj) : error LNK2005: _ops_getmaterial_ has been defined in elementAPI_Dummy.obj
.....
Random
Posts: 7
Joined: Thu Sep 22, 2016 4:58 am
Location: Huazhong University of Science and Technology
Contact:

Re: How do I compile the main.cpp in the Example1?

Post by Random »

Finally I solved the problem...But I made some changes about the sp_constrain in the main.cpp file.
Before I changed
SP_Constraint *sp1 = new SP_Constraint(1, 1, 0, 0.0);
SP_Constraint *sp2 = new SP_Constraint(2, 1, 1, 0.0);
SP_Constraint *sp3 = new SP_Constraint(3, 2, 0, 0.0);
SP_Constraint *sp4 = new SP_Constraint(4, 2, 1, 0.0);
SP_Constraint *sp5 = new SP_Constraint(5, 3, 0, 0.0);
SP_Constraint *sp6 = new SP_Constraint(6, 3, 1, 0.0);
after that
SP_Constraint *sp1 = new SP_Constraint(1, 0, 1);
SP_Constraint *sp2 = new SP_Constraint(1, 1, 1);
SP_Constraint *sp3 = new SP_Constraint(2, 0, 1);
SP_Constraint *sp4 = new SP_Constraint(2, 1, 1);
SP_Constraint *sp5 = new SP_Constraint(3, 0, 1);
SP_Constraint *sp6 = new SP_Constraint(3, 1, 1);
It worked fine in my computer.
TPdct
Posts: 43
Joined: Thu Jan 21, 2016 5:51 am
Location: Dalian University of Technology

Re: How do I compile the main.cpp in the Example1?

Post by TPdct »

It's not necessary to use windows 32 bit, Linux 32bit or 64bit are all ok
Post Reply