Jump to content
  • 0

cmake error: multiple definition of `main'


Wryshu

Question

SOLVED: See reply below

Anyone have a solution how to get past this?

Following the wiki for CentOS 7 for MaNGOS Zero, getting an error on:

cmake /opt/mangos/SOURCES/server -DTBB_USE_EXTERNAL=1 -DCMAKE_BUILD_TYPE=release -DACE_USE_EXTERNAL=0 -DCMAKE_INSTALL_PREFIX=/opt/mangos -DINCLUDE_BINDINGS_DIR=scripts -DPCH=0 -DCMAKE_CXX_FLAGS="-O3 -march=native" -DCMAKE_C_FLAGS="-O3 -march=native"

Linking CXX shared library libmangosscript.so
CMakeFiles/mangosscript.dir/_build/CMakeFiles/2.8.11/CompilerIdCXX/CMakeCXXCompi         lerId.cpp.o: In function `main':
CMakeCXXCompilerId.cpp:(.text.startup+0x0): multiple definition of `main'
CMakeFiles/mangosscript.dir/tool/git_id/git_id.cpp.o:git_id.cpp:(.text.startup+0         x0): first defined here
collect2: error: ld returned 1 exit status
make[2]: *** [src/bindings/scripts/libmangosscript.so] Error 1
make[1]: *** [src/bindings/scripts/CMakeFiles/mangosscript.dir/all] Error 2
make: *** [all] Error 2

sudo make install

sudo make install
[  0%] Built target genrev
[  0%] Built target revision.h
[  0%] Built target ACE_Project
[  1%] Built target detour
[  5%] Built target g3dlite
[  5%] Built target gsoap
[ 26%] Built target storm
[ 26%] Built target framework
[ 28%] Built target shared
[ 29%] Built target realmd
[ 47%] Built target game
[ 48%] Built target mangosd
Linking CXX shared library libmangosscript.so
CMakeFiles/mangosscript.dir/_build/CMakeFiles/2.8.11/CompilerIdCXX/CMakeCXXCompilerId.cpp                                                                                                                                                    .o: In function `main':
CMakeCXXCompilerId.cpp:(.text.startup+0x0): multiple definition of `main'
CMakeFiles/mangosscript.dir/tool/git_id/git_id.cpp.o:git_id.cpp:(.text.startup+0x0): firs                                                                                                                                                    t defined here
collect2: error: ld returned 1 exit status
make[2]: *** [src/bindings/scripts/libmangosscript.so] Error 1
make[1]: *** [src/bindings/scripts/CMakeFiles/mangosscript.dir/all] Error 2
make: *** [all] Error 2

Many thanks for looking!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

I got some help in a PM on this from H0zen, and want to share what I learned.

First of all, if you follow the tutorial, you will not get the latest, so instead do the following:

create a SOURCES folder in your home folder

mkdir SOURCES && cd SOURCES

now git the source

git clone --recursive -b develop21 https://github.com/mangoszero/server.git mangos0

cd mangos0
git clone --recursive -b develop21 https://github.com/mangoszero/database.git database

create a _build folder

mkdir _build && cd _build

run cmake

** NOTE, make sure you chown /opt/mangos to the users compiling, or use sudo and chown later **

cmake .. -DCMAKE_INSTALL_PREFIX=/opt/mangos

now compile, and take a long break

make install

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use