• Create Account

Banner advertising on our site currently available from just $5! ### #Actualhatfarm Posted 13 August 2013 - 07:46 PM Okay, I decided I'd make a new post since the last one kinda got away from the original intent. So, I'm trying to build my application and I've got all my code compiling, but it's not linking and I'm not sure why. I kinda reworked the setup, I've got my engine that I've worked on and it compiles and links fine. My game code is compiling, but it will not find the link to the GLEW and SFML libraries. I cannot figure out why. It works fine with my setup in Windows, but Linux apparently hates it. Here's my top level CMakeLists.txt: cmake_minimum_required(VERSION 2.6.4) project(Balls) ADD_SUBDIRECTORY(bate) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include
${BATE_INCLUDES} ) set(EXEC_NAME "Balls to the Walls") set(Balls_SRCS src/application.cpp src/ball.cpp src/ballswindow.cpp src/brick.cpp src/component.cpp src/entity.cpp src/main.cpp src/menustate.cpp src/position.cpp src/system.cpp src/velocity.cpp ) set(Balls_INC include/application.h include/ball.h include/ballswindow.h include/brick.h include/component.h include/entity.h include/menustate.h include/position.h include/system.h include/velocity.h ) ADD_DEFINITIONS( -DSFML_STATIC ) add_executable(${EXEC_NAME} ${Balls_SRCS}${Balls_INC})

SET_TARGET_PROPERTIES(${EXEC_NAME} PROPERTIES COMPILE_DEFINITIONS "GLEW_STATIC=" ) TARGET_LINK_LIBRARIES(${EXEC_NAME} BatE )

IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Linux specific code SET_TARGET_PROPERTIES(${EXEC_NAME}
PROPERTIES
COMPILE_DEFINITIONS
"IS_LINUX="
)
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # Install target install(TARGETS${EXEC_NAME} DESTINATION bin)


BatE is my engine (Battle Engine).  I've tried linking SFML here, but that didn't change anything.  Any advice?

### #1hatfarm

Posted 13 August 2013 - 07:04 PM

Okay, I decided I'd make a new post since the last one kinda got away from the original intent.  So, I'm trying to build my application and I've got all my code compiling, but it's not linking and I'm not sure why.  I kinda reworked the setup, I've got my engine that I've worked on and it compiles and links fine.  My game code is compiling, but it will not find the link to the GLEW and SFML libraries.  I cannot figure out why.  It works fine with my setup in Windows, but Linux apparently hates it.  Here's my top level CMakeLists.txt:

cmake_minimum_required(VERSION 2.6.4)
project(Balls)

include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include${BATE_INCLUDES}
)

set(EXEC_NAME "Balls to the Walls")

set(Balls_SRCS
src/application.cpp
src/ball.cpp
src/ballswindow.cpp
src/brick.cpp
src/component.cpp
src/entity.cpp
src/main.cpp
src/position.cpp
src/system.cpp
src/velocity.cpp

)

set(Balls_INC
include/application.h
include/ball.h
include/ballswindow.h
include/brick.h
include/component.h
include/entity.h
include/position.h
include/system.h
include/velocity.h
)

add_executable(${EXEC_NAME}${Balls_SRCS} ${Balls_INC}) SET_TARGET_PROPERTIES(${EXEC_NAME}
PROPERTIES
COMPILE_DEFINITIONS
"GLEW_STATIC="
)

TARGET_LINK_LIBRARIES(${EXEC_NAME} BatE ) IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# Linux specific code
SET_TARGET_PROPERTIES(${EXEC_NAME} PROPERTIES COMPILE_DEFINITIONS "IS_LINUX=" ) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

# Install target
install(TARGETS \${EXEC_NAME} DESTINATION bin)


BatE is my engine (Battle Engine).  I've tried linking SFML here, but that didn't change anything.  Any advice?

PARTNERS