Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error: ‘vector’ is not a member of ‘std’ #4

Open
iagolessa opened this issue Dec 16, 2017 · 7 comments
Open

Build error: ‘vector’ is not a member of ‘std’ #4

iagolessa opened this issue Dec 16, 2017 · 7 comments

Comments

@iagolessa
Copy link

log.Allwmake.extend.withError.txt

Found an error during compilation of the library on a cluster, in file:
fluidSolvers/finiteVolume/RBFMeshMotionSolver/RBFMeshMotionSolver.C
in line 297:5: error: ‘vector’ is not a member of ‘std’. Managed it by including the vector library in the file. May affect other users as well. Log file attached.

@wyldckat
Copy link
Owner

If you're using foam-extend 4.0, then you must use the package that was developed for that version, namely this one: http://openfoamwiki.net/index.php/Extend-bazaar/Toolkits/Fluid-structure_interaction#Install_on_foam-extend-4.0

@arionf
Copy link

arionf commented Dec 20, 2018

If you're using foam-extend 4.0, then you must use the package that was developed for that version, namely this one: http://openfoamwiki.net/index.php/Extend-bazaar/Toolkits/Fluid-structure_interaction#Install_on_foam-extend-4.0

Im using Fsi_40.tar.gz on foam-extend-4.0 and still get the same error. I also tried to compile other versions but it didnt work:

luidSolvers/finiteVolume/RBFMeshMotionSolver/RBFMeshMotionSolver.C: In member function ‘virtual void Foam::RBFMeshMotionSolver::solve()’:
fluidSolvers/finiteVolume/RBFMeshMotionSolver/RBFMeshMotionSolver.C:297:5: error: ‘vector’ is not a member of ‘std’
std::vector movingControlPointLabelsVector;
^

@wyldckat
Copy link
Owner

@arionf: Which GCC version are you using? Namely what do the following commands give you?

gcc --version
g++ --version

@wyldckat wyldckat reopened this Dec 21, 2018
@arionf
Copy link

arionf commented Dec 21, 2018

@arionf: Which GCC version are you using? Namely what do the following commands give you?

gcc --version
g++ --version

gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@wyldckat
Copy link
Owner

I'm currently re-building foam-extend 4.0 on a VM with Ubuntu 18.04. However, I've using GCC 5, as instructed here: https://openfoamwiki.net/index.php/Installation/Linux/foam-extend-4.0/Ubuntu#Ubuntu_18.04

What I mean by this is that it is my suspicion and vague memory that GCC 7 does not use the same STL structure that GCC 5 uses. In other words, std::vector has changed how its meant to be used.

I don't know how much foam-extend 4.0 has been tested with GCC 7, so I don't know if it's stable enough and/or if everything builds as intended. However, it should work fairly well with GCC 5.

That said, the solids4foam project is still in development and I don't know when they will release it, but it should better support the more recent GCC versions, as well as the more recent foam-extend 4.1 that is in development.

I'll report back here once I'm managed to finish testing building myself the FSI toolkit for foam-extend 4.0, but I've dropped by just in case I forget to write about this until then.

@wyldckat
Copy link
Owner

OK, the good/bad news is that this issue occurs also with GCC 5...

I guess I will really have to bring in the code from openfoamwiki and re-adapt it...

@wyldckat
Copy link
Owner

wyldckat commented Mar 2, 2019

I've finally managed to look into this and the solution is apparently fairly simple... all that was missing is the addition of this line:

#include <vector>

next to the other includes in the file src/fluidSolidInteraction/fluidSolvers/finiteVolume/RBFMeshMotionSolver/RBFMeshMotionSolver.C.

A quick way to apply this fix is to run the following command before running Allwmake:

sed -i -e 's=\(using namespace\)=#include <vector>\n\1=' fluidSolidInteraction/fluidSolvers/finiteVolume/RBFMeshMotionSolver/RBFMeshMotionSolver.C

Warning: I tested this only on Ubuntu 18.04, using GCC 5.5.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants