CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

‘argc’ was not declared in this scope

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   October 7, 2021, 06:26
Default ‘argc’ was not declared in this scope
  #1
New Member
 
Philipp Conen
Join Date: Jul 2021
Location: Germany, NRW
Posts: 22
Rep Power: 4
philippconen is on a distinguished road
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;
Having no idea how to do this I started with the tutorial by Stefan Radl: https://wiki.openfoam.com/Programming_by_Stefan_Radl and also read the guide: https://cfd.direct/openfoam/user-guide/v6-applications/.

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
Sadly, I quite not know where to start. Is it a problem of the linking or maybe the code?
/Make/files:
Code:
patchPointsOrder.C

EXE = $(FOAM_USER_APPBIN)/patchPointsOrder
/Make/options:
Code:
EXE_INC = \
	-I$(LIB_SRC)/finiteVolume/lnInclude \
	-I$(LIB_SRC)/meshTools/lnInclude \
        -I$(LIB_SRC)/OpenFOAM/include
	
EXE_LIBS = \
	-lfiniteVolume
tree:
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
Also, I am not sure what work needs exactly to be done to file the options file in the correct way. So in other works - where or how do I get the information on which paths and libraries I need to put in there?

I would be very happy about any help.

My OpenFOAM is version 3.0.1.

Greetings!
philippconen is offline   Reply With Quote

 

Tags
application, argv, code, compilation error, linking


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 19:39.