Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by hatfarm

  1. I guess there is one more issue I'm having.  make clean is just not working.  When I type that in, it says:   "cmake_clean.cmake:21 (INCLUDE):   include called with wrong number of arguments.  Include only takes one   file."   This is in Linux, with MSVC2010, I have no issues.  Any ideas?
  2. 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?
  3. I REALLY REALLY appreciate the offer, it's in such an infant stage right now that I'm not that worried about an NDA or anything like that.  However, I kind of got it working last night.  I cleaned up the CMakeLists.txt and did things the way SFML does in their examples.  That got me past the immediate error, but moved it down the line to the pthread library.  SFML doesn't do a find_package(pthread) nor could I, so I decided that since Linux is easier to get these libraries with, I'd just use the dynamic libraries for Linux.  So, I have it use the static libraries for Windows and then in Linux it uses the static libraries.  I'm getting wildly different behavior in Linux (one of my assertions, which doesn't get thrown in Windows gets thrown immediately in Linux).  I'm going to have to work through that, but I'm happy to be doing that rather than messing with CMake.     Thank you so much for your help, I'm sure once I go to build on Mac, I'll have plenty more questions, but I'm doing okay now.
  4. Well, the weirdest thing is, I can make the examples for SFML fine.  There's specifically an X11 example, and I checked that CMake file in order to get what I should put here.  When I make that, it works fine.  I really can't figure out what the deal is here though...  I actually have the exact message print that you put, and nothing looks funny, except the include directories don't appear to have ';' after them, but that doesn't appear to be the issue.  This is incredibly frustrating, because I just want to code.
  5. So, I've fixed a couple of issues.  This OpenGL issue has gone away, I was telling it to link against my executable and not the library, which was a problem, because the executable wasn't defined in the library's .txt file.  The script issue has just gone away, it wasn't solved by just restarting, because I didn't change anything between restarts in order to get it to work, but it's working without the script, so I'm not complaining about not making any headway.  I'm having a problem with it not finding X11 in Linux.  I have X11, because it compiled SFML fine, but as far as my makefile is concerned, it's not being linked properly.  I get this error when I try to make in Linux:   /usr/bin/ld: /home/hatfarm/SFML-2.1//lib/libsfml-window-s.a(WindowImplX11.cpp.o): undefined reference to symbol 'XGetWindowAttributes' /usr/bin/ld: note: 'XGetWindowAttributes' is defined in DSO /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so so try adding it to the linker command line /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libX11.so: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status Here's the code I have in my CMakeLists.txt file that should ensure that X11 is linked properly:   IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") find_package(X11 REQUIRED) set(LIB_INCLUDES ${LIB_INCLUDES} ${X11_INCLUDE_DIR}) set(LIB_LINKS ${LIB_LINKS} ${X11_LIBRARIES} ) ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") That's in both my library and executable's CMakeFiles.txt... I know that LIB_INCLUDES and LIB_LINKS are correctly used because it doesn't complain about OpenGL.  Any ideas?
  6. That's actually how I've been working with it.  I'm still not sure why that issue is happening, but now I'm having issues with the libraries linked by SFML.  I'm working on that, but I'm having an issue with CMake saying: "Cannot specify link libraries for target "/usr/lib/i386-linux-gnu/libGLU.so" which is not built by this project."   Any ideas?  It appears I've got GLU installed, that doesn't appear to be the issue.  Why is it so much more brutal in Linux?
  7. Well, I got around the issue a bit.  I created a bash script that exports the variables and then calls cmake-gui.  It works, it's lame, but it works.  However, then it has trouble finding any of the libraries that SFML links against.  This is incredibly frustrating.
  8. Gah!  I figured out why the problem is happening, a bit.  Part of the reason is that the environment variables are not getting read properly by CMake.  I've got SFML_ROOT defined in the /etc/environment file, and then I also can print out $SFML_ROOT in the terminal and it works, but CMake does not recognize them (I put a MESSAGE statement in there).  So, that's the problem, but I'm not sure how to fix it.  I even wrote a script that created the environment variable, then exported it and prints it out, it prints them all out, but it is not finding it inside of CMake...   Anyone have any ideas?
  9. I use git at home and at work.  At home, I pretty much just use the command line, but at work we use Git Extensions and we like it quite a bit.  We've not really had any major issues with merge conflicts, except with binary objects (simulink models) and that hasn't been a huge deal.  Using .gitignore is pretty easy and can be very robust, I have literally never seen a file I didn't need to push at work.  At home, it's not a huge deal because I know every file anyway, but I do use a .gitignore to get rid of some of the stuff.
  10. Yeah, it's incredibly frustrating.  At least Visual Studio accepts / as well as \ .
  11. Well, I figured it out.  It was an issues with / vs \ .  I had to fix that in the files including my included files.  Now I've got to sift through all the errors and resolve them.  I'm glad that defines are so easy in CMake, so I can define smart_ptr differently in windows and linux.  Thanks for your help.  I apologize it wasn't actually Cmake related, but it was build environment related :)
  12. Yeah, I understand that, but at the beginning of my CmakeLists.txt file I have:   include_directories( "${PROJECT_BINARY_DIR}" $ENV{GLM_ROOT} $ENV{RAPIDXML_ROOT} $ENV{SFML_ROOT}/extlibs/headers $ENV{SFML_ROOT}/include ) And the environment variable "GLM_ROOT" points to the location where I have GLM (it's a header only library, so nothing to compile).  I have it point to the root directory /home/glm, which is where I have it point to in Windows (essentially... c:\glm there) and it works, but in Linux I have no such luck.  The Makefile created under Linux doesn't seem to know where the include file is located.  
  13. Actually, it's not finding GLM.  That's the first file included that it cannot find, so the problem is that it's not getting my include files right.  I checked that I have the environment variables setup, and they are, and they point to the correct place, but it says "cannot find glm/glm.h".  However, I didn't compile SFML in Linux, so I'll have to do that also.  I was thinking I could just put the libraries I'm using into the include path directory if I really need to, but I'd prefer to not have to do that, since CMake should be doing that work for me.
  14. So, I think I'm a day short of a necro on this, so just under the gun.  However, I thought I'd post in this thread again because it's related to that.  So, I've got it working in Windows, but I'm having issues with Linux.  I have it generate a Makefile, but it's not listing my include directories/libraries.  Any thoughts?  It's essentially the same as the text that was posted above (just a few more source files).  
  15. Well, FreeType doesn't use OpenGL.  But it IS a rendering library.  It will give you bitmaps of a font, that it has rendered.  The trick is to use these in OpenGL.  Swiftcoder is right in that it can be REALLY insane how many draw calls you get if you don't do it right.  I create a texture atlas of all the usable characters (or those that you know you'll use) and then keep VBOs for the locations of rectangles and tex coords.  Then, I just keep an array of all of the strings that have been added to that one specific font, and whenever a new one is added, the VBOs get updated (well, not always, but that's neither here nor there).  This means for any one font, you can limit it to one call.  You can even do color with another VBO.  If you have a lot of fonts though, that gets pretty untenable, but I haven't had that problem :) I also don't antialias, but that's because I'm not THAT worried about the text.  Anyway, I think I've gotten a bit away from the OP, but really you can use FreeType with OpenGL, it just isn't a direct text drawer, but I don't know of any of those that are specifically 3.3+
  16. I accidentally downvoted you, I meant to up vote you but my laptop's mousepad is super sensitive.  Anyway, thank you for these articles, they came at a perfect time in the development of my engine.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!