|
[Sponsors] |
October 7, 2021, 06:26 |
‘argc’ was not declared in this scope
|
#1 |
New Member
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4 |
Dear Foamers,
for the first time, I am trying to compile an application in OpenFOAM. Regarding my needs, I would like to build the code mentioned in this thread: https://www.cfd-online.com/Forums/op...ary-patch.html Code:
#include "setRootCase.H" #include "createTime.H" #include "createMesh.H" label PatchID = mesh.boundaryMesh().findPatchID("tuyau"); const polyPatch& patchFound = mesh.boundaryMesh()[PatchID]; labelList labelPatchFound( patchFound.meshPoints() ); pointField meshPoints(mesh.points()); long nombre = 0; forAll(labelPatchFound , label) { vector coord = meshPoints[labelPatchFound[label]]; Info << coord[0] << " " << coord[1] << " " << coord[2] << endl; nombre++; } Info << nombre << endl; After trying to merge a simple code from the tutorial with the above-mentioned code I am getting the following output (errors). Code:
philipp@philipp-MS-7A38:~/OpenFOAM/philipp-3.0.1/apps/patchPointsOrder$ wmake Making dependency list for source file patchPointsOrder.C g++-5 -m64 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=64 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -O3 -DNoRepository -ftemplate-depth-100 -I/home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/finiteVolume/lnInclude -I/home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/meshTools/lnInclude -I/home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/include -IlnInclude -I. -I/home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/lnInclude -I/home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/OSspecific/POSIX/lnInclude -fPIC -c patchPointsOrder.C -o Make/linux64GccDPInt64Opt/patchPointsOrder.o In file included from patchPointsOrder.C:17:0: /home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/include/setRootCase.H: In function ‘int main()’: /home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/include/setRootCase.H:5:24: error: ‘argc’ was not declared in this scope Foam::argList args(argc, argv); ^ /home/philipp/OpenFOAM/OpenFOAM-3.0.1/src/OpenFOAM/include/setRootCase.H:5:30: error: ‘argv’ was not declared in this scope Foam::argList args(argc, argv); ^ /home/philipp/OpenFOAM/OpenFOAM-3.0.1/wmake/rules/General/transform:8: recipe for target 'Make/linux64GccDPInt64Opt/patchPointsOrder.o' failed make: *** [Make/linux64GccDPInt64Opt/patchPointsOrder.o] Error 1 /Make/files: Code:
patchPointsOrder.C EXE = $(FOAM_USER_APPBIN)/patchPointsOrder Code:
EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/OpenFOAM/include EXE_LIBS = \ -lfiniteVolume Code:
philipp@philipp-MS-7A38:~/OpenFOAM/philipp-3.0.1/apps/patchPointsOrder$ tree . ├── Make │** ├── files │** ├── linux64GccDPInt64Opt │** │** ├── options │** │** ├── patchPointsOrder.C.dep │** │** ├── sourceFiles │** │** └── variables │** └── options └── patchPointsOrder.C I would be very happy about any help. My OpenFOAM is version 3.0.1. Greetings! |
|
Tags |
application, argv, code, compilation error, linking |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compile calcMassFlowC | aurore | OpenFOAM Programming & Development | 13 | March 23, 2018 07:43 |
error compiling modified applications | yvyan | OpenFOAM Programming & Development | 21 | March 1, 2016 04:53 |
Compile problem | ivanyao | OpenFOAM Running, Solving & CFD | 1 | October 12, 2012 09:31 |
checking the system setup and Qt version | vivek070176 | OpenFOAM Installation | 22 | June 1, 2010 12:34 |
How to get the max value of the whole field | waynezw0618 | OpenFOAM Running, Solving & CFD | 4 | June 17, 2008 05:07 |