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

Undefined reference to %60mainb

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2007, 14:12
Default Hi, I am compiling OpenFOAM
  #1
Member
 
Kuan Tek Seang
Join Date: Mar 2009
Posts: 31
Rep Power: 17
seang is on a distinguished road
Hi,

I am compiling OpenFOAM 1.4 with gcc 4.1.2 on OpenSUSE 10.1 and had the following strange error. Any help or hints is appreciated!

regards,
Tek Seang

SOURCE=gambitToFoam.L ; flex++ -f $SOURCE ; mv lex.yy.cc Make/linux64Gcc4DPOpt/gambitToFoam.C ; g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/tskuan/CFD/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC -c Make/linux64Gcc4DPOpt/gambitToFoam.C -o Make/linux64Gcc4DPOpt/gambitToFoam.o
stdin:16159: m4: Warning: Excess arguments to built-in `m4_ifdef' ignored
lex.yy.cc: In member function âvirtual int yyFlexLexer::yylex()â:
lex.yy.cc:14023: warning: use of old-style cast
lex.yy.cc:14023: warning: use of old-style cast
lex.yy.cc:14039: warning: use of old-style cast
lex.yy.cc:14599: warning: use of old-style cast
lex.yy.cc: In member function âint yyFlexLexer::yy_get_next_buffer()â:
lex.yy.cc:14847: warning: use of old-style cast
lex.yy.cc:14870: warning: use of old-style cast
lex.yy.cc:14883: warning: use of old-style cast
lex.yy.cc:14883: warning: use of old-style cast
lex.yy.cc:14904: warning: use of old-style cast
lex.yy.cc: In member function âyy_state_type yyFlexLexer::yy_get_previous_state()â:
lex.yy.cc:14952: warning: use of old-style cast
lex.yy.cc:14952: warning: use of old-style cast
lex.yy.cc: In member function âvoid yyFlexLexer::yyunput(int, char*)â:
lex.yy.cc:15012: warning: use of old-style cast
lex.yy.cc:15013: warning: use of old-style cast
lex.yy.cc:15021: warning: use of old-style cast
lex.yy.cc: In member function âint yyFlexLexer::yyinput()â:
lex.yy.cc:15088: warning: use of old-style cast
lex.yy.cc: In member function âvirtual yy_buffer_state* yyFlexLexer::yy_create_buffer(std::istream*, int)â:
lex.yy.cc:15168: warning: use of old-style cast
lex.yy.cc:15177: warning: use of old-style cast
lex.yy.cc: In member function âvirtual void yyFlexLexer::yy_delete_buffer(yy_buffer_state*)â:
lex.yy.cc:15199: warning: use of old-style cast
lex.yy.cc:15202: warning: use of old-style cast
lex.yy.cc:15204: warning: use of old-style cast
lex.yy.cc: In member function âvoid yyFlexLexer::yyensure_buffer_stack()â:
lex.yy.cc:15331: warning: use of old-style cast
lex.yy.cc:15349: warning: use of old-style cast
lex.yy.cc: In member function âvoid yyFlexLexer::yy_push_state(int)â:
lex.yy.cc:15367: warning: use of old-style cast
lex.yy.cc:15370: warning: use of old-style cast
lex.yy.cc:15370: warning: use of old-style cast
lex.yy.cc: In function âvoid* yyalloc(yy_size_t)â:
lex.yy.cc:15450: warning: use of old-style cast
lex.yy.cc: In function âvoid* yyrealloc(void*, yy_size_t)â:
lex.yy.cc:15462: warning: use of old-style cast
lex.yy.cc:15462: warning: use of old-style cast
lex.yy.cc: In function âvoid yyfree(void*)â:
lex.yy.cc:15467: warning: use of old-style cast
g++ -m64 -Dlinux64 -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -march=opteron -O3 -DNoRepository -ftemplate-depth-40 -IlnInclude -I. -I/home/tskuan/CFD/OpenFOAM/OpenFOAM-1.4/src/OpenFOAM/lnInclude -fPIC Make/linux64Gcc4DPOpt/gambitToFoam.o -L/home/tskuan/CFD/OpenFOAM/OpenFOAM-1.4/lib/linux64Gcc4DPOpt \
-lOpenFOAM -liberty -ldl -lm -o /home/tskuan/CFD/OpenFOAM/OpenFOAM-1.4/applications/bin/linux64Gcc4DPOpt/gambitT oFoam
/usr/lib/../lib64/crt1.o: In function `_start':
init.c.text+0x20): undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [/home/tskuan/CFD/OpenFOAM/OpenFOAM-1.4/applications/bin/linux64Gcc4DPOpt/gambit ToFoam] Error 1
seang is offline   Reply With Quote

Old   June 12, 2007, 14:53
Default Think it was that that version
  #2
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Think it was that that version of flex++ does not like ']]'. Put space inbetween any two angle brackets in gambitToFoam.L
mattijs is offline   Reply With Quote

Old   June 13, 2007, 00:33
Default Hi Mattijs, thanks for your
  #3
Member
 
Kuan Tek Seang
Join Date: Mar 2009
Posts: 31
Rep Power: 17
seang is on a distinguished road
Hi Mattijs,

thanks for your suggestion! that worked wonders!

The flex++ version i am using is 2.5.31

regards,
Tek Seang
seang is offline   Reply With Quote

Old   June 20, 2007, 11:04
Default Had the same problem on an Ubu
  #4
Senior Member
 
Jens Klostermann
Join Date: Mar 2009
Posts: 117
Rep Power: 17
jens_klostermann is on a distinguished road
Had the same problem on an Ubuntu (debian based) machine.

Also change:
ansysToFoam.L
fluentToFoam.L

as suggested by Mattijs.
jens_klostermann is offline   Reply With Quote

Old   July 2, 2007, 03:08
Default Had a similar problem when try
  #5
Member
 
sradl's Avatar
 
Stefan Radl
Join Date: Mar 2009
Location: Graz, Austria
Posts: 82
Rep Power: 18
sradl is on a distinguished road
Had a similar problem when trying to compile a new viscosity model (should give a new library). The error message is:
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64/crt1.o: In function `_start':
../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'

Followed by a bunch of other error messages

Can anyone help?

br
Stefan
sradl is offline   Reply With Quote

Old   July 2, 2007, 04:33
Default Use 'wmake libso' if you are c
  #6
Senior Member
 
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,677
Rep Power: 40
olesen has a spectacular aura aboutolesen has a spectacular aura about
Use 'wmake libso' if you are compiling a library.
A plain 'wmake' will attempt to create an application, which requires 'main()' and yields a failure if it is missing.
olesen is offline   Reply With Quote

Old   January 30, 2014, 01:22
Default Similar error
  #7
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13
Sherlock_1812 is on a distinguished road
Hi,

I know this is a really old thread. But i get a similar error. I am not compiling a library, just a solver. However, I still get this error message.

Code:
/usr/lib/../lib64/crt1.o: In function `_start':
/usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:109: undefined reference to `main'
collect2: ld returned 1 exit status
make: *** [/home1/ms/me12s056/OpenFOAM/me12s056-2.1.1/platforms/linux64GccDPOpt/bin/thermoSolutalPisoFoam] Error 1
Any help?
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Old   February 1, 2014, 14:19
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Srivaths,

This isn't enough information to work with, so here are some questions, to help isolate the source of the problem:
  1. Which Linux Distribution are you using and which architecture (32 or 64 bit)?
  2. What installation instructions did you follow for installing OpenFOAM 2.1.1.?
  3. Do you have more than one OpenFOAM version installed? If you do, how are you keeping them apart?
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   February 1, 2014, 14:48
Default
  #9
Senior Member
 
Srivathsan N
Join Date: Jan 2013
Location: India
Posts: 101
Rep Power: 13
Sherlock_1812 is on a distinguished road
Hello Bruno,

I am using Ubuntu 12.04 32 bit system. The 2.1.1 version was on a cluster that i'm running my cases on.

I would like to say that I've got the issue resolved. It was a beginner's error and I just didn't spot it initially.

Thank you for your time.
__________________
Regards,

Srivaths
Sherlock_1812 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[OpenFOAM.com] Undefined reference to %60yyFlexLexeryywrapb arjaan OpenFOAM Installation 13 June 1, 2016 13:33
Undefined reference mateusz_slowikowski OpenFOAM Running, Solving & CFD 7 February 27, 2015 15:35
Undefined reference to %60yyFlexLexeryywrapb zhoubinwx OpenFOAM Bugs 1 May 28, 2008 06:57
Undefined reference mateusz_slowikowski OpenFOAM Running, Solving & CFD 3 March 11, 2008 13:19
Compiling liftDrag crashed with initc%3cIMG SRC%3d%22httpopenfoamcfdonlinecomforumclipartsadgif%22 ALT%3d%22%22 BORDER%3d0%3etext0x20 undefined reference to %60mainb sponiar OpenFOAM Running, Solving & CFD 2 January 17, 2008 05:00


All times are GMT -4. The time now is 22:00.