No main function while building 1.10.6 on Mountain Lion

Get help with compiling or installing the game, and discuss announcements of new official releases.

Moderator: Forum Moderators

Post Reply
jhc
Posts: 1
Joined: May 19th, 2013, 8:14 am

No main function while building 1.10.6 on Mountain Lion

Post by jhc »

The error msg I got is
[ 12%] Built target wesnoth-game
[ 17%] Built target wesnoth-core
[ 24%] Built target wesnoth-lua
Linking CXX executable ../wesnoth
Undefined symbols for architecture i386:
"_main", referenced from:
-u command line option
(maybe you meant: __ZN4gui211tlobby_main17send_chat_messageERKSsb, __ZN4gui211tlobby_main20process_network_dataERK6config ... SKIP)
It is strange that I do not have main function while creating the wesnoth executable :whistle: .
I've noticed that the main function seems to be defined in game.cpp around line number 594.

Code: Select all

#ifdef __native_client__
int wesnoth_main(int argc, char** argv)
#else
int main(int argc, char** argv)
#endif
{
SKIP
}
Therefore, I use "nm game.cpp.o | grep main" to show the symbol table of my game.cpp.o. The result is
00000000 T _SDL_main
00032bc4 S _SDL_main.eh
U __ZN2lg10log_domainC1EPKc
U __ZN2lg15list_logdomainsERKSs
U __ZN2lg23set_log_domain_severityERKSsi
000069b0 S __ZNK2lg6logger8dont_logERKNS_10log_domainE
U __ZNK2lg6loggerclERKNS_10log_domainEbb
00005bb0 t _bind_textdomain_codeset
00033e6c s _bind_textdomain_codeset.eh
00005b80 t _bindtextdomain
00033e50 s _bindtextdomain.eh
U _libintl_bind_textdomain_codeset
U _libintl_bindtextdomain
U _libintl_textdomain
00005be0 t _textdomain
00033e88 s _textdomain.eh
In addition, the flags that I use to compile game.cpp is
CXX_FLAGS = -m32 -I/opt/X11/include -I/Library/Frameworks/SDL.frame work/Headers -I/opt/X11/include/cairo -I/opt/X11/include/pixman-1 -I /opt/X11/include/freetype2 -I/opt/X11/include/libpng15 -I/usr/local/ Cellar/pango/1.34.0/include/pango-1.0 -I/usr/local/Cellar/glib/2.36. 2/include/glib-2.0 -I/usr/local/Cellar/glib/2.36.2/lib/glib-2.0/incl ude -I/usr/local/opt/gettext/include -I/usr/local/include/SDL -I/Use rs/Jared/playground/wesnoth-1.10.6/src -I/Users/Jared/playground/wes noth-1.10.6_build/src -I/usr/local/include/fribidi -I/usr/X11R6/incl ude -I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE -DWES NOTH_PATH=\"/usr/local/share/wesnoth\" -DLOCALEDIR=\"translations\" -DFIFODIR=\"/var/run/wesnothd\" -F/Library/Frameworks

CXX_DEFINES = -DDISABLE_POOL_ALLOC -DHAS_RELATIVE_LOCALEDIR=1 -DHAVE _CONFIG_H -DHAVE_FRIBIDI -DLUA_USE_POSIX -D_X11
These flags are generated by CMake, and I found these flags from "wesnoth-1.10.6_build/src/CMakeFiles/wesnoth.dir/flags.make". (wesnoth-1.10.6_build is a folder that I created in order to separate the source folder and the build folder)

Sorry for this lengthy post. I try to give as much information related to my problem. Thank you in advance.
Post Reply