• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling Compiling on Ubuntu 15.04 (Won't compile, but no errors show)

Fablow

Intermediate OT User
Content Editor
Joined
May 7, 2008
Messages
1,565
Solutions
6
Reaction score
145
Location
Canada
GitHub
Fablow77
Hello, it seems I'm having issues compiling on my Ubuntu 15.04. I do everything right (or seems that way), and when I go to run the command 'make' it just goes like this below, without compiling. Any ideas?
Code:
X@localhost:~$ cd forgottenserver
X@localhost:~/forgottenserver$ mkdir build
mkdir: cannot create directory ‘build’: File exists
X@localhost:~/forgottenserver$ cmake src
-- Configuring done
-- Generating done
-- Build files have been written to: /home/X/forgottenserver
X@localhost:~/forgottenserver$ make

Also, I've tried building the 'build' file, same results.
Also, I've tried on Root user, same exact thing.

Any help is appreciated!
 
follow the tutorial

go into build dir
Code:
 cd build

if you are in build directory your path should be like
X@localhost:~/forgottenserver/build

then try
Code:
cmake ..
make
 
Here is what I get:
Code:
X@localhost:~$ cd forgottenserver
X@localhost:~/forgottenserver$ mkdir build
X@localhost:~/forgottenserver$ cd build
X@localhost:~/forgottenserver/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/X/forgottenserver
X@localhost:~/forgottenserver/build$ make
make: *** No targets specified and no makefile found.  Stop.
 
Have you installed all the required tools?

Code:
sudo apt-get install git cmake build-essential liblua5.2-dev libgmp3-dev libmysqlclient-dev libboost-system-dev libboost-iostreams-dev libpugixml-dev

What was the output?

Also, what was the forgottenserver directory content after executing the cmake command?
 
Yes, I've installed all the required tools.
Code:
root@localhost:~# sudo apt-get install git cmake build-essential liblua5.2-dev libgmp3-dev libmysqlclient-dev libboost-system-dev libboost-iostreams-dev libpugixml-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
build-essential is already the newest version (12.1ubuntu2).
git is already the newest version (1:2.7.4-0ubuntu1).
libgmp3-dev is already the newest version (2:6.1.0+dfsg-2).
liblua5.2-dev is already the newest version (5.2.4-1ubuntu1).
libboost-iostreams-dev is already the newest version (1.58.0.1ubuntu1).
libboost-system-dev is already the newest version (1.58.0.1ubuntu1).
libpugixml-dev is already the newest version (1.7-2).
cmake is already the newest version (3.5.1-1ubuntu3).
libmysqlclient-dev is already the newest version (5.7.17-0ubuntu0.16.04.1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

What happens in the 'forgottenserver' folder is, that a folder creates 'build' which the tfs should be located at. Both errors that occur are in my first 2 posts.
 
Hmm.. it's weird. Are you sure you have downloaded the correct tfs repo?
Code:
git clone https://github.com/otland/forgottenserver.git

It should put all the files into build directory but it doesn' in your case
Code:
-- Build files have been written to: /home/X/forgottenserver
Also there are should be some more text informations before
Code:
-- Configuring done
-- Generating done


Can you check and post your cmake file? CMakeLists.txt
 
EDIT:
There is nothing before:
Code:
-- Configuring done
-- Generating done

Yes, I'm using the updated tfs. To be fair, I have tried other distributions, and the same result. Here is my 'CMakeLists.txt' file:
Code:
cmake_minimum_required(VERSION 2.8)

set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

project(tfs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(cotire)

add_compile_options(-Wall -Werror -pipe -fvisibility=hidden)

if (CMAKE_COMPILER_IS_GNUCXX)
    add_compile_options(-fno-strict-aliasing)
endif()

include(FindCXX11)

# Find packages.
find_package(GMP REQUIRED)
find_package(PugiXML REQUIRED)
find_package(LuaJIT)
find_package(MySQL)
find_package(Threads)

option(USE_LUAJIT "Use LuaJIT" ${LUAJIT_FOUND})

if(USE_LUAJIT)
    find_package(LuaJIT REQUIRED)
    if(APPLE)
      set(CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000")
    endif()
else()
    find_package(Lua)
endif()

find_package(Boost 1.53.0 COMPONENTS system iostreams REQUIRED)

include(src/CMakeLists.txt)
add_executable(tfs ${tfs_SRC})

include_directories(${MYSQL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} ${GMP_INCLUDE_DIR})
target_link_libraries(tfs ${MYSQL_CLIENT_LIBS} ${LUA_LIBRARIES} ${Boost_LIBRARIES} ${PUGIXML_LIBRARIES} ${GMP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

set_target_properties(tfs PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "src/otpch.h")
set_target_properties(tfs PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(tfs)
 
EDIT:
There is nothing before:
Code:
-- Configuring done
-- Generating done

Yes, I'm using the updated tfs. To be fair, I have tried other distributions, and the same result. Here is my 'CMakeLists.txt' file:
Code:
cmake_minimum_required(VERSION 2.8)

set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

project(tfs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(cotire)

add_compile_options(-Wall -Werror -pipe -fvisibility=hidden)

if (CMAKE_COMPILER_IS_GNUCXX)
    add_compile_options(-fno-strict-aliasing)
endif()

include(FindCXX11)

# Find packages.
find_package(GMP REQUIRED)
find_package(PugiXML REQUIRED)
find_package(LuaJIT)
find_package(MySQL)
find_package(Threads)

option(USE_LUAJIT "Use LuaJIT" ${LUAJIT_FOUND})

if(USE_LUAJIT)
    find_package(LuaJIT REQUIRED)
    if(APPLE)
      set(CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000")
    endif()
else()
    find_package(Lua)
endif()

find_package(Boost 1.53.0 COMPONENTS system iostreams REQUIRED)

include(src/CMakeLists.txt)
add_executable(tfs ${tfs_SRC})

include_directories(${MYSQL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} ${GMP_INCLUDE_DIR})
target_link_libraries(tfs ${MYSQL_CLIENT_LIBS} ${LUA_LIBRARIES} ${Boost_LIBRARIES} ${PUGIXML_LIBRARIES} ${GMP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

set_target_properties(tfs PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "src/otpch.h")
set_target_properties(tfs PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(tfs)

cmake file is same is mine.
Im not best at linux, but I'll try to help here.

There should be printed some more results than only Configuring/Generating done (For example boost version etc)
lets try check if program reads whole file

Use this CMakeLists.txt
Code:
cmake_minimum_required(VERSION 2.8)

message("test")

set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

project(tfs)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

include(cotire)

add_compile_options(-Wall -Werror -pipe -fvisibility=hidden)

if (CMAKE_COMPILER_IS_GNUCXX)
    add_compile_options(-fno-strict-aliasing)
endif()

include(FindCXX11)

# Find packages.
find_package(GMP REQUIRED)
find_package(PugiXML REQUIRED)
find_package(LuaJIT)
find_package(MySQL)
find_package(Threads)

option(USE_LUAJIT "Use LuaJIT" ${LUAJIT_FOUND})

if(USE_LUAJIT)
    find_package(LuaJIT REQUIRED)
    if(APPLE)
      set(CMAKE_EXE_LINKER_FLAGS "-pagezero_size 10000 -image_base 100000000")
    endif()
else()
    find_package(Lua)
endif()

find_package(Boost 1.53.0 COMPONENTS system iostreams REQUIRED)

include(src/CMakeLists.txt)
add_executable(tfs ${tfs_SRC})

include_directories(${MYSQL_INCLUDE_DIR} ${LUA_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} ${GMP_INCLUDE_DIR})
target_link_libraries(tfs ${MYSQL_CLIENT_LIBS} ${LUA_LIBRARIES} ${Boost_LIBRARIES} ${PUGIXML_LIBRARIES} ${GMP_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

set_target_properties(tfs PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "src/otpch.h")
set_target_properties(tfs PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(tfs)

and try run

Should print msg 'test' before
Code:
-- Configuring done
-- Generating done
 
No, there is no message 'test'.
Code:
X@localhost:~/forgottenserver/build$ cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/X/forgottenserver
 
Seems like it is executing another cmake file (an empty cmake file). Are you sure the path is correct?

It's a bit hard for me to help you, just by suggesting the solutions and checking the output. Im not expert here, would need to at least have an access to your server and check every possibilities manually.

For now, I am going to sleep (It's very late here). Gonna check this thread yesterday, maybe something comes up to my mind.

But don't worry, IMO some better linux admin should easy resolve this issue.
 
Yes, I'm sure the path is correct. Thank you for your help. I appreciate it. Hopefully I can find a solution, or someone has one =).
 
[Solved]

Solution:

Well, I don't know if this is a 'solution' per say, but this is what I did.

Step 1: Downloaded latest ForgottenServer on my computer.
Step 2: Logged in as Root
Step 3: Transferred files over into a folder called 'ots'.
Step 4:
Code:
root@localhost:~# cd ots
root@localhost:~/ots# mkdir build
root@localhost:~/ots# cd build
root@localhost:~/ots/build# cmake ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- cotire 1.7.6 loaded.
-- Performing Test COMPILER_KNOWS_CXX11
-- Performing Test COMPILER_KNOWS_CXX11 - Success
-- Performing Test COMPILER_KNOWS_STDLIB
-- Performing Test COMPILER_KNOWS_STDLIB - Failed
-- Found GMP: /usr/include/x86_64-linux-gnu
-- Found PugiXML: /usr/include
-- Found LuaJIT: /usr/lib/x86_64-linux-gnu/libluajit-5.1.so;/usr/lib/x86_64-linux-gnu/libm.so (found version "2.0.4")
-- MySQL Include dir: /usr/include/mysql  library dir: /usr/lib/x86_64-linux-gnu
-- MySQL client libraries: mysqlclient
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   system
-- CXX target tfs cotired without unity build.
-- Configuring done
-- Generating done
-- Build files have been written to: /root/ots/build
root@localhost:~/ots/build# make
[  1%] Generating CXX prefix source cotire/tfs_CXX_prefix.cxx
[  2%] Generating CXX prefix header cotire/tfs_CXX_prefix.hxx
[  3%] Building CXX precompiled header cotire/tfs_CXX_prefix.hxx.gch
Scanning dependencies of target tfs
[  4%] Building CXX object CMakeFiles/tfs.dir/src/otpch.cpp.o
[  5%] Building CXX object CMakeFiles/tfs.dir/src/actions.cpp.o
[  7%] Building CXX object CMakeFiles/tfs.dir/src/ban.cpp.o
[  8%] Building CXX object CMakeFiles/tfs.dir/src/baseevents.cpp.o
[  9%] Building CXX object CMakeFiles/tfs.dir/src/bed.cpp.o
[ 10%] Building CXX object CMakeFiles/tfs.dir/src/chat.cpp.o
[ 11%] Building CXX object CMakeFiles/tfs.dir/src/combat.cpp.o
[ 13%] Building CXX object CMakeFiles/tfs.dir/src/commands.cpp.o
[ 14%] Building CXX object CMakeFiles/tfs.dir/src/condition.cpp.o
[ 15%] Building CXX object CMakeFiles/tfs.dir/src/configmanager.cpp.o
[ 16%] Building CXX object CMakeFiles/tfs.dir/src/connection.cpp.o
[ 17%] Building CXX object CMakeFiles/tfs.dir/src/container.cpp.o
[ 19%] Building CXX object CMakeFiles/tfs.dir/src/creature.cpp.o
[ 20%] Building CXX object CMakeFiles/tfs.dir/src/creatureevent.cpp.o
[ 21%] Building CXX object CMakeFiles/tfs.dir/src/cylinder.cpp.o
[ 22%] Building CXX object CMakeFiles/tfs.dir/src/database.cpp.o
[ 23%] Building CXX object CMakeFiles/tfs.dir/src/databasemanager.cpp.o
[ 25%] Building CXX object CMakeFiles/tfs.dir/src/databasetasks.cpp.o
[ 26%] Building CXX object CMakeFiles/tfs.dir/src/depotchest.cpp.o
[ 27%] Building CXX object CMakeFiles/tfs.dir/src/depotlocker.cpp.o
[ 28%] Building CXX object CMakeFiles/tfs.dir/src/events.cpp.o
[ 29%] Building CXX object CMakeFiles/tfs.dir/src/fileloader.cpp.o
[ 30%] Building CXX object CMakeFiles/tfs.dir/src/game.cpp.o
[ 32%] Building CXX object CMakeFiles/tfs.dir/src/globalevent.cpp.o
[ 33%] Building CXX object CMakeFiles/tfs.dir/src/guild.cpp.o
[ 34%] Building CXX object CMakeFiles/tfs.dir/src/groups.cpp.o
[ 35%] Building CXX object CMakeFiles/tfs.dir/src/house.cpp.o
[ 36%] Building CXX object CMakeFiles/tfs.dir/src/housetile.cpp.o
[ 38%] Building CXX object CMakeFiles/tfs.dir/src/inbox.cpp.o
[ 39%] Building CXX object CMakeFiles/tfs.dir/src/ioguild.cpp.o
[ 40%] Building CXX object CMakeFiles/tfs.dir/src/iologindata.cpp.o
[ 41%] Building CXX object CMakeFiles/tfs.dir/src/iomap.cpp.o
[ 42%] Building CXX object CMakeFiles/tfs.dir/src/iomapserialize.cpp.o
[ 44%] Building CXX object CMakeFiles/tfs.dir/src/iomarket.cpp.o
[ 45%] Building CXX object CMakeFiles/tfs.dir/src/item.cpp.o
[ 46%] Building CXX object CMakeFiles/tfs.dir/src/items.cpp.o
[ 47%] Building CXX object CMakeFiles/tfs.dir/src/luascript.cpp.o
[ 48%] Building CXX object CMakeFiles/tfs.dir/src/mailbox.cpp.o
[ 50%] Building CXX object CMakeFiles/tfs.dir/src/map.cpp.o
[ 51%] Building CXX object CMakeFiles/tfs.dir/src/modules.cpp.o
[ 52%] Building CXX object CMakeFiles/tfs.dir/src/monster.cpp.o
[ 53%] Building CXX object CMakeFiles/tfs.dir/src/monsters.cpp.o
[ 54%] Building CXX object CMakeFiles/tfs.dir/src/mounts.cpp.o
[ 55%] Building CXX object CMakeFiles/tfs.dir/src/movement.cpp.o
[ 57%] Building CXX object CMakeFiles/tfs.dir/src/networkmessage.cpp.o
[ 58%] Building CXX object CMakeFiles/tfs.dir/src/npc.cpp.o
[ 59%] Building CXX object CMakeFiles/tfs.dir/src/otserv.cpp.o
[ 60%] Building CXX object CMakeFiles/tfs.dir/src/outfit.cpp.o
[ 61%] Building CXX object CMakeFiles/tfs.dir/src/outputmessage.cpp.o
[ 63%] Building CXX object CMakeFiles/tfs.dir/src/party.cpp.o
[ 64%] Building CXX object CMakeFiles/tfs.dir/src/player.cpp.o
[ 65%] Building CXX object CMakeFiles/tfs.dir/src/position.cpp.o
[ 66%] Building CXX object CMakeFiles/tfs.dir/src/protocol.cpp.o
[ 67%] Building CXX object CMakeFiles/tfs.dir/src/protocolgame.cpp.o
[ 69%] Building CXX object CMakeFiles/tfs.dir/src/protocolgamebase.cpp.o
[ 70%] Building CXX object CMakeFiles/tfs.dir/src/protocollogin.cpp.o
[ 71%] Building CXX object CMakeFiles/tfs.dir/src/protocolold.cpp.o
[ 72%] Building CXX object CMakeFiles/tfs.dir/src/protocolspectator.cpp.o
[ 73%] Building CXX object CMakeFiles/tfs.dir/src/protocolstatus.cpp.o
[ 75%] Building CXX object CMakeFiles/tfs.dir/src/quests.cpp.o
[ 76%] Building CXX object CMakeFiles/tfs.dir/src/raids.cpp.o
[ 77%] Building CXX object CMakeFiles/tfs.dir/src/reward.cpp.o
[ 78%] Building CXX object CMakeFiles/tfs.dir/src/rewardchest.cpp.o
[ 79%] Building CXX object CMakeFiles/tfs.dir/src/rsa.cpp.o
[ 80%] Building CXX object CMakeFiles/tfs.dir/src/scheduler.cpp.o
[ 82%] Building CXX object CMakeFiles/tfs.dir/src/scriptmanager.cpp.o
[ 83%] Building CXX object CMakeFiles/tfs.dir/src/server.cpp.o
[ 84%] Building CXX object CMakeFiles/tfs.dir/src/spawn.cpp.o
[ 85%] Building CXX object CMakeFiles/tfs.dir/src/spells.cpp.o
[ 86%] Building CXX object CMakeFiles/tfs.dir/src/talkaction.cpp.o
[ 88%] Building CXX object CMakeFiles/tfs.dir/src/tasks.cpp.o
[ 89%] Building CXX object CMakeFiles/tfs.dir/src/teleport.cpp.o
[ 90%] Building CXX object CMakeFiles/tfs.dir/src/thing.cpp.o
[ 91%] Building CXX object CMakeFiles/tfs.dir/src/tile.cpp.o
[ 92%] Building CXX object CMakeFiles/tfs.dir/src/tools.cpp.o
[ 94%] Building CXX object CMakeFiles/tfs.dir/src/trashholder.cpp.o
[ 95%] Building CXX object CMakeFiles/tfs.dir/src/vocation.cpp.o
[ 96%] Building CXX object CMakeFiles/tfs.dir/src/waitlist.cpp.o
[ 97%] Building CXX object CMakeFiles/tfs.dir/src/weapons.cpp.o
[ 98%] Building CXX object CMakeFiles/tfs.dir/src/wildcardtree.cpp.o
[100%] Linking CXX executable tfs
[100%] Built target tfs

EDIT:
If moving over to a different user, make sure to change the permissions so you are able to execute it.
 
Last edited:
Back
Top