Jump to content

  • Log In with Google      Sign In   
  • Create Account


C++ game development?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 Eamonn Rea   Members   -  Reputation: 54

Like
0Likes
Like

Posted 12 July 2013 - 09:51 AM

Hello smile.png When I was about 11 or 12, I was looking into C++. I was still a beginner programmer, only knowing JavaScript, HTML, CSS and a little bit of Python, so I didn't really understand C++. Now, almost a year and a half later, I've finished learning C. Mind you I'm not a genius at it, but I know the basics(printf, scanf, pointers, arrays, octal/hex/bin, etc) and I remember most of C++. The only thing I couldn't grasp in C++ was Polymorphism. Maybe a guide on that if you feel it's important for game development...? Anyway! I wanted to use Allegro for my game development, but it only works on 32Bit machines and won't install on my 64Bit mac! So that was fine, I thought. "I'll just use SFML! That'll be easy!", but what happened? SFML keeps giving me errors in XCode 4! No one else is having these errors, and the people on the forums said they didn't get this error, so they said just keep trying. Here I am, over 200 or so failed XCode projects that didn't work with SFML 2.0. For those of you that are curious here are the errors:

 

r5SBLAG.jpg

 

My names Eamonn, so my path to my Desktop is " /Users/eamonn/Desktop ", just in case you didn't know what that did.

 

Mac Specs(I dont think these are necessary, but just in case they are I'll tell you them):

 

64Bit processor

4GB RAM

2.5GHz

Intel Core i5

 

 

 

 

All of the code in the XCode project are all the defaults for the SFML application. I did not tamper with it at all(well, I did but I reset it by making another project).

 

CodingMadeEasy has a tutorial on SFML, and I think it's a pretty good one from what I've heard.

 

And one last little thing I'd like to ask about:

 

Eventually(maybe in a few years from now), I'd like to get into 3D game programming. This seems daunting, but in saying that I'm still trying to master 2D game development. Any 3D game programmers: Were you ever in this position? Where you were still making 2D graphics and were a little worried about the daunting task of 3D game programming? If you are a 3D game programmer, is it more fun than 2D game programming? What I mean is, is it more enjoyable? I love 2D game programming, and 3D game programming looks like a LOT of fun biggrin.png Of course, it will take years of practice at 2D game development, and then to understand the concepts behind 3D game programming would take a lot longer, then it'd be onto actually programming the game.

 

I understand that 3D game programming is hard, but don't tell me I can't do it. I just have to keep exercising my skills, and one day I'll be a pro at this! "The only way to do great work is to love what you do." - Steve Jobs

 

So yeah, thanks! Any help is appreciated!


Edited by Eamonn Rea, 12 July 2013 - 09:52 AM.


Sponsor:

#2 SimonForsman   Crossbones+   -  Reputation: 5972

Like
2Likes
Like

Posted 12 July 2013 - 10:11 AM

looks like a linker problem, make sure you're using the correct library files for SFML (You need the 64 bit xcode version).

 

You could take a look at this short guide: http://sfml-dev.org/tutorials/1.6/start-osx.php


I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#3 Eamonn Rea   Members   -  Reputation: 54

Like
0Likes
Like

Posted 12 July 2013 - 10:31 AM

looks like a linker problem, make sure you're using the correct library files for SFML (You need the 64 bit xcode version).

 

You could take a look at this short guide: http://sfml-dev.org/tutorials/1.6/start-osx.php

 

Still getting the same errors. sad.png But thanks for the link! smile.png Still more help than the official Forum tongue.png

 

EDIT: Wait wait, no no! There are more errors! Here's a screenie!

 

aFx5PGn.jpg?1

 

I don't like XCode, but I can't have CodeCompletion with Code::Blocks!


Edited by Eamonn Rea, 12 July 2013 - 10:33 AM.


#4 SimonForsman   Crossbones+   -  Reputation: 5972

Like
1Likes
Like

Posted 12 July 2013 - 10:32 AM

do you have the sfml lib files in /usr/local/lib ?


I don't suffer from insanity, I'm enjoying every minute of it.
The voices in my head may not be real, but they have some good ideas!

#5 Eamonn Rea   Members   -  Reputation: 54

Like
0Likes
Like

Posted 12 July 2013 - 10:39 AM

I have the following SFML files in there(I believe it's all of them):

 

libsfml-audio.2.0.dylib
libsfml-audio.2.dylib
libsfml-audio.dylib
libsfml-graphics.2.0.dylib
libsfml-graphics.2.dylib
libsfml-graphics.dylib
libsfml-network.2.0.dylib
libsfml-network.2.dylib
libsfml-network.dylib
libsfml-system.2.0.dylib
libsfml-system.2.dylib
libsfml-system.dylib
libsfml-window.2.0.dylib
libsfml-window.2.dylib
libsfml-window.dylib


#6 AllEightUp   Moderators   -  Reputation: 4165

Like
2Likes
Like

Posted 12 July 2013 - 11:52 AM

By the looks of the errors, it sure seems that you are missing a library linkage in your project.  An SFML render window is contained in the the graphics library, so if you were only linking against the window library that would cause problems.  Some other random thoughts would also include the following items.  First, have you fiddled with any of the C++11 flags and stdlib's?  If you have, it is possible, though it seems unlikely, that such changes could change signatures for that function.  This could be especially true of the allocator template given there were some changes to that in C++11.  Another item is a bit more annoying, and I'm not sure if it holds true any longer but the linker used to be order sensitive by default such that you would need to make sure you linked system, then window and finally graphics or some symbols would be missed.

 

The only other thing I can think of is a quick proof of concept.  If you download the repository I use for my articles and build that, you can at least prove that you don't have any configuration issues with your machine or XCode as it uses SFML.  The big difference is that in my repository I use CMake and build SFML as part of the project instead of relying on the binary releases, basically in order to avoid exactly this sort of OMG what's wrong sort of crap.. :)  Anyway, if you want to try that it should only take a little while to download and build (actually running it takes a little work though, so oops :)), you can find it here: a8u  You need CMake 2.8.11 or higher for it, just run it on the list file under the game folder and the resulting xcode project should compile just fine without link errors.



#7 nhatkthanh   Members   -  Reputation: 334

Like
0Likes
Like

Posted 12 July 2013 - 11:58 AM

If you prefer, here is the setup with the sfml framework for OSX, and it's straight forward http://www.sfml-dev.org/tutorials/2.0/start-osx.php



#8 Eamonn Rea   Members   -  Reputation: 54

Like
0Likes
Like

Posted 12 July 2013 - 12:06 PM

If you prefer, here is the setup with the sfml framework for OSX, and it's straight forward http://www.sfml-dev.org/tutorials/2.0/start-osx.php

That was the tutorial that gave the the error :(

 

 

By the looks of the errors, it sure seems that you are missing a library linkage in your project.  An SFML render window is contained in the the graphics library, so if you were only linking against the window library that would cause problems.  Some other random thoughts would also include the following items.  First, have you fiddled with any of the C++11 flags and stdlib's?  If you have, it is possible, though it seems unlikely, that such changes could change signatures for that function.  This could be especially true of the allocator template given there were some changes to that in C++11.  Another item is a bit more annoying, and I'm not sure if it holds true any longer but the linker used to be order sensitive by default such that you would need to make sure you linked system, then window and finally graphics or some symbols would be missed.

 

The only other thing I can think of is a quick proof of concept.  If you download the repository I use for my articles and build that, you can at least prove that you don't have any configuration issues with your machine or XCode as it uses SFML.  The big difference is that in my repository I use CMake and build SFML as part of the project instead of relying on the binary releases, basically in order to avoid exactly this sort of OMG what's wrong sort of crap.. smile.png  Anyway, if you want to try that it should only take a little while to download and build (actually running it takes a little work though, so oops smile.png), you can find it here: a8u  You need CMake 2.8.11 or higher for it, just run it on the list file under the game folder and the resulting xcode project should compile just fine without link errors.

 

I downloaded that file, opened CMake, and everything went well! I got an XcodeProject called "CMakeProject.xcodeproj", ran it and it all went 100%, though it didn't fix SFML :( I've never fiddled with anything.



#9 Eamonn Rea   Members   -  Reputation: 54

Like
1Likes
Like

Posted 12 July 2013 - 12:15 PM

Hey everyone! I got it working! It turns out the SFML folder in /usr/local/include was from an old version of SFML from April 2013. It's all working now! I can't wait to get into game development with C++!



#10 AllEightUp   Moderators   -  Reputation: 4165

Like
0Likes
Like

Posted 12 July 2013 - 12:16 PM

I downloaded that file, opened CMake, and everything went well! I got an XcodeProject called "CMakeProject.xcodeproj", ran it and it all went 100%, though it didn't fix SFML sad.png I've never fiddled with anything.

 

Well, that at least mostly proves that it is not some random oops with XCode installation or anything and that your machine is all fine and dandy.  Barring a random gamma ray burst changing a bit everytime you recompile your project that is. :)

 

<snip>

 

Glad to hear you got it all figured out.... :)

  •  





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS