Re: Errors during VS compilation
Probablya a missing include. Could you try adding
#include "dof.h"
into dssmatrix.C ?
You are not logged in. Please login or register.
OOFEM forum → Developers Discussion → Errors during VS compilation
Probablya a missing include. Could you try adding
#include "dof.h"
into dssmatrix.C ?
Yes, all fine now.
Although this topic is a few years old now, I have managed to experience the same sort of problems when tried to build the solution wth VS2017. The fixes proposed in the previous answers work for classes but, for some reason, they don't work for structs (the reason might be that something has been changed on VS2017 compiler compared with the previous versions). When I try to build the latest code from the development branch, I encounter problem with the LoadBalancer class saying "attempting to reference a deleted function" in xutility. Traced back to loadbalancer I create a custom copy ctor and everything works. The similar error happens for modeStruct:
Severity Code Description Project File Line Suppression State
Error C2280 'oofem::modeStruct &oofem::modeStruct::operator =(const oofem::modeStruct &)': attempting to reference a deleted function core C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\xutility 2414
When I try to apply the same solution (create copy ctor) on modeStruct structure, I get the following errors:
Severity Code Description Project File Line Suppression State
Error C2512 'oofem::modeStruct': no appropriate default constructor available core C:\git\oofem\src\oofemlib\solutionbasedshapefunction.C 409
Severity Code Description Project File Line Suppression State
Error C2280 'oofem::modeStruct &oofem::modeStruct::operator =(const oofem::modeStruct &)': attempting to reference a deleted function core C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\xutility 2414
I don't understand if the default constructor is missing for modeStruct or for an object inside the modeStruct (e.g. SurfaceDataStruct). However, by defining a default constructor for any of the two, I haven't managed to solve the problem.
Any help would be much appreciated...
Marin
P.S.
For the matter of completeness, I post two additional errors that occur simultaneously with the previous ones:
Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file 'C:\git\oofem\src\oofemlib\core.dir\Debug\solutionbasedshapefunction.obj' liboofem C:\git\oofem\LINK 1
Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file 'Debug\oofem.lib' oofem C:\git\oofem\LINK 1
Hello, I just committed a series of patches that enable compilation on Visual C++ 2017 (serial version with no external modules for now).
Borek
Hello, I just committed a series of patches that enable compilation on Visual C++ 2017 (serial version with no external modules for now).
Borek
Thanks! It all works well now.
Dear all, as the troubles never end when you work with two different compilers, I have run into problems with oofempy project. It cannot compile and returns LNK 2019 and LNK 2001 errors (I use VS2019 but I guess the same error would occur on VS2017). I am posting examples of the errors below and attaching a file with complete list of errors.
6>oofem.obj : error LNK2019: unresolved external symbol "class oofem::FloatArray & __cdecl oofem::operator*=(class oofem::FloatArray &,double const &)" (??Xoofem@@YAAEAVFloatArray@0@AEAV10@AEBN@Z) referenced in function "public: static class oofem::FloatArray & __cdecl pybind11::detail::op_impl<29,0,class oofem::FloatArray,class oofem::FloatArray,float>::execute(class oofem::FloatArray &,float const &)" (?execute@?$op_impl@$0BN@$0A@VFloatArray@oofem@@V12@M@detail@pybind11@@SAAEAVFloatArray@oofem@@AEAV45@AEBM@Z)
6>oofem.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl oofem::StructuralElement::giveInternalForcesVector_withIRulesAsSubcells(class oofem::FloatArray &,class oofem::TimeStep *,int)" (?giveInternalForcesVector_withIRulesAsSubcells@StructuralElement@oofem@@UEAAXAEAVFloatArray@2@PEAVTimeStep@2@H@Z)
Please note that I have made a few changes in oofem.cpp file (compared to master) in order to fix previous errors given by MSVC compiler but I belive that these shouldn't have any effect on the errors listed here (you can see my changes in branch marin on unizg-fsb-nav/oofem).
Cheers,
Marin
Note that this issue has been solved by adding OOFEM_EXPORT, i.e., __declspec(dllimport) keyword to appropriate class declarations.
OOFEM forum → Developers Discussion → Errors during VS compilation
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 4 official extensions. Copyright © 2003–2009 PunBB.