CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Compiling liftDrag crashed with initc%3cIMG SRC%3d%22httpopenfoamcfdonlinecomforumclipartsadgi f%22 ALT%3d%22%22 BORDER%3d0%3etext0x20 undefined reference to %60mainb (

sponiar January 16, 2008 10:05

Good afternoon to forum, I wo
Good afternoon to forum,
I would like to build liftDrag tool to OF 1.4.1. I follow steps in this 'compiling tutorial' by pUl (Thank you a lot, very helpfull).

Compiling source code in:

is ssuccessful without any Errors. All directory structure with source code and header files for liftDrag was donwloaded from: nFOAM-1.4.1-dev/src/postProcessing/

In second steps, when I am try tu build liftDrag in:
$WM_PROJECT_INST_DIR/OpenFOAM-1.4.1/applications/utilities/postProcessing/miscel laneous/liftDrag
wclean && wmake

building crashed with this report:
options:10:12: warning: backslash-newline at end of file
Making dependency list for source file liftDrag.C
SOURCE=liftDrag.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/postProcessing/incompressible/lnIncl ude -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/postProcessing/incompressible -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/turbulenceModels -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/LESmodels -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/LESmodels/LESdeltas/lnInclude -IlnInclude -I. -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -c $SOURCE -o Make/linux64GccDPOpt/liftDrag.o
g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/postProcessing/incompressible/lnIncl ude -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/postProcessing/incompressible -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/turbulenceModels -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/LESmodels -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/LESmodels/LESdeltas/lnInclude -IlnInclude -I. -I/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC Make/linux64GccDPOpt/liftDrag.o -L/home/sponiar/OpenFOAM/OpenFOAM-1.4.1/lib/linux64GccDPOpt \
-lincompressiblePostProcessing -lOpenFOAM -liberty -ldl -lm -o /home/sponiar/OpenFOAM/OpenFOAM-1.4.1/applications/bin/linux64GccDPOpt/liftDrag
/usr/lib/../lib64/crt1.o: In function `_start':
init.c undefined reference to `main'
collect2: ld returned 1 exit status


It looks like some mistakes in 'ld' or in gcc. So I rebuild gcc-4.2.2, how prof.Jasak advise:
I do not rebuild binutils, which contain 'ld'.
$ ld -v
GNU ld version 20051219 (SUSE Linux)

This is 'Make option files' from liftDrag src and app:

::: applications/utilities/postProcessing/miscellaneous/liftDrag/Make/options :::

-I$(LIB_SRC)/postProcessing/incompressible/lnInclude \
-I$(LIB_SRC)/postProcessing/incompressible \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/LESmodels \

-lincompressiblePostProcessing \

::: /src/postProcessing/incompressible/Make/options :::

-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/LESmodels \

-lfiniteVolume \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModels \
-lincompressibleLESmodels \

Any idea, where could be mistake?
Thank you for you responses.
David Sponiar

bychkov January 16, 2008 14:39

Hello David, Your options f
Hello David,

Your options files looks good. The problem can be in the code (check header files that included in liftDrag.C utility). Also check that folder $FOAM_SRC/postProcessing/incompressible/lnInclude contain links to liftDrag.C and liftDrag.H files.

You can try to build enhanced liftDrag
I have no problem with this on my OpenSUSEx64.


sponiar January 17, 2008 05:00

I am sending greetings to my e
I am sending greetings to my eastern neighbour,
Hello Ivan.

Thanks a lot to your utility. Compilitation and building liftDrag from your prepare tool was successefuly.

It looks - how you said - like some mistake in linking header files. I checked header and linking up and I did not find any weirdly.

For completeness' sake:
• OpenFOAM-1.4.1.linux64GccDPOpt
• compilation and building Ivan's anhanced liftDragTool was successfuly,
• gcc-4.2.1 binary pack downloaded for OF 1.4.1,
• GNU linker ld included in my linux distribution (I did not rebuild new binutils).


All times are GMT -4. The time now is 09:38.