Error LNK 2019 when building Opensees V 2.4.6

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

Moderators: silvia, selimgunay, Moderators

Post Reply
kim2kie
Posts: 4
Joined: Wed Sep 07, 2011 9:07 pm
Location: http://www.kim2kie.com
Contact:

Error LNK 2019 when building Opensees V 2.4.6

Post by kim2kie » Tue Jul 28, 2015 5:59 am

Hi, fmk.
My friend and I have compiled the OS2.4.6 (Win64) downloaded by SVN on VS2013 64bit with tcl/tk x64 8.5.18.
We did our best to solve the following errors for several days with the previously mentioned solutions, and came to fail.
FIY, my OS is Windows 7 (64bit).
Could you give a tip to find a way?
Dookie

-----------------------------------
+Discription:
Error 12 error LNK2019: unresolved external symbol "public: __cdecl QuadBeamEmbedContact::QuadBeamEmbedContact(void)" (??0QuadBeamEmbedContact@@QEAA@XZ) referenced in function "public: virtual class Element * __cdecl FEM_ObjectBrokerAllClasses::getNewElement(int)" (?getNewElement@FEM_ObjectBrokerAllClasses@@UEAAPEAVElement@@H@Z)

+File:
E:\OpenSees\Code64\Win64\proj\openSees\actor.lib(FEM_ObjectBrokerAllClasses.obj)

+Project:
OpenSees
-----------------------------------

kim2kie
Posts: 4
Joined: Wed Sep 07, 2011 9:07 pm
Location: http://www.kim2kie.com
Contact:

Re: Error LNK 2019 when building Opensees V 2.4.6

Post by kim2kie » Wed Jul 29, 2015 5:42 am

Thanks, fmk.
Finally, we found a solution after surveying previous postings.

The cause of the errors LNK 2019 was that the corresponding projects didn't have proper source files (.cpp and .h).
They should be added into the projects.

For example, the following error
"Error 12 error LNK2019: unresolved external symbol "public: __cdecl QuadBeamEmbedContact::QuadBeamEmbedContact..."
can be solved by
copying the files "QuadBeamEmbedContact.cpp" and "QuadBeamEmbedContact.h" into the folder "Elements/UWelements".

Thanks again to fmk and my friend, Chae.

kim2kie
Posts: 4
Joined: Wed Sep 07, 2011 9:07 pm
Location: http://www.kim2kie.com
Contact:

Re: Error LNK 2019 when building Opensees V 2.4.6

Post by kim2kie » Mon Aug 03, 2015 5:34 am

Most of LNK2019 errors were solved by the above way.
However two LNK 2019 errors linked with fortran files still remain as follows:

----------
Error 12 error LNK2019: unresolved external symbol SDM2D referenced in function "protected: void __cdecl StressDilatancyModel2D::GetCurrentStress(void)" (?GetCurrentStress@StressDilatancyModel2D@@IEAAXXZ) E:\OpenSees\Code64\Win64\proj\openSees\material.lib(StressDilatancyModel2D.obj) OpenSees
Error 13 error LNK2019: unresolved external symbol SDM3D referenced in function "protected: void __cdecl StressDilatancyModel3D::GetCurrentStress(void)" (?GetCurrentStress@StressDilatancyModel3D@@IEAAXXZ) E:\OpenSees\Code64\Win64\proj\openSees\material.lib(StressDilatancyModel3D.obj) OpenSees
----------

My friend and I tried to solve them by making libraries (.dll) from the fortran project which included fortran files, but failed.
In the Visual studio, the setting we used as follows:
- Linker > General > Additional Library Directories : Fortran folder including the '.lib' file
- Linker > Input > Additional Dependencies : Fortran '.dll' file was selected
- Configuring Visual Studio for Mixed-Language Applications
Microsoft.Cpp.x64.user Properties > VC++ Directories > Library Directories > "$(IFORT_COMPILER14)\compiler\lib\intel64" was added.


We really need help!

kim2kie
Posts: 4
Joined: Wed Sep 07, 2011 9:07 pm
Location: http://www.kim2kie.com
Contact:

Re: Error LNK 2019 when building Opensees V 2.4.6

Post by kim2kie » Wed Aug 05, 2015 4:45 am

Finally, we found a way. It was a matter of 32 and 64 bits.
We tried to compile using Win64 but contacted to the matter of fortran linking mentioned above.
Then we changed the solution from win64 to win32, and did the compiling successfully.
Win64 compiling with fortran codes needs to be debugged again by developers.

fmk
Site Admin
Posts: 5883
Joined: Fri Jun 11, 2004 2:33 pm
Location: UC Berkeley
Contact:

Re: Error LNK 2019 when building Opensees V 2.4.6

Post by fmk » Thu Aug 06, 2015 2:08 pm

you could have also just removed the 2 StressDilatancy models that were causing the problem (as i doubt you will be using them in your models)

Post Reply