Kieran Posted July 27, 2011 Report Posted July 27, 2011 Hi,I am learning C/C++ so I can code for X-Plane. I have downloaded the XPSDK and the sample files. I have opened the SDKExamples (the XCode project file) and have built them successfully. However when I went to build the AdvancedSDKExamples (again from the XCode project file) I got many build errors; all originating from XCode not being able to find the XPSDK header files. (attached image shows the error I'm getting)Also I just want to confirm that for the example files, a ".c" extension is for C files and a ".cpp" extension is for C++ files.All help is greatly appreciated, thanks in advance (and for reading this far).CheersKieran Quote
tkyler Posted August 20, 2011 Report Posted August 20, 2011 (edited) Hey Kieran...I can very much remember when I started and the biggest frustration was dealing with the compiler and the error messages. For any given x-code project, the project file itself will have a LOT of settings associated with it that tell the compiler what to compile, how to compile, what type of processor to compiler for, what libraries to use and of course, where to find headers, etc....probably a hundred or more options. Anyhow, one of the settings is for specifying paths to header files. Pointing xcode to the SDK headers, especially when dealing with other's projects or source code...it's a pretty common action.The good news is doing that will probably fix this issue, the bad news is I'm on a mac without xcode at the moment and can't show you some screenshots as to where to set those...I myself can't remember; however, with some exploration you might hunt it down. On the left side of the xcode window is a "navigation" pane that shows source files, external frameworks, etc. On one of those bad boys, you double/right click and you'll get the project options to pop up. It's a really long confusing list at first. Anyways, somewhere in that list is a "path to the headers" option. You'll want to point it to the SDK Cheaders folder and make sure the recursive options is on so it will traverse into that folder looking for headers. If you do not have the recursive option, you have to point xcode to each header folder individually (there's 3) ...at least best I can remember. There's some many headaches I've encountered in the past I can't remember them all, but that's the place to start.This is a simplification since there are many better ways to go about it, but if you're just beginning, then pointing xcode directly at the header folder is a good start to get a "feel" for how xcode does it's thing and you can save the "convenience" methods for when you get some more experience. If you still don't get it, I'll try and grab some screenshots of the setting at first opportunity.-Tom Edited August 20, 2011 by tkyler Quote
Kieran Posted August 20, 2011 Author Report Posted August 20, 2011 Thanks Tkyler. Got it working.I'm sure I will have some more questions down the road, but for now I'll continue editing the examples.Cheers Kieran Quote
Kieran Posted August 20, 2011 Author Report Posted August 20, 2011 (edited) Aright, I have hit another bump. While trying to build the ExampleGuage.cpp file from the AdvancedSDKExamples. I get the following errors.(had to use this because the image uploader here isn't working for me)Cheers Kieran Edited August 20, 2011 by Kieran Quote
tkyler Posted August 21, 2011 Report Posted August 21, 2011 Kieran. I myself don't know the issue on this one offhand....sorry! Perhaps ask over at the org in Sandy's forum?....and brace for some obscure answer Quote
Kieran Posted August 21, 2011 Author Report Posted August 21, 2011 Oh, ok. Posted over at the .org. Quote
Ben Russell Posted August 21, 2011 Report Posted August 21, 2011 Do you want to learn C or make stuff for X-Plane?I'm obviously biased, but you have a long hard road cut out for yourself.If there's something in mind that you want to make and you need some pointers I'd be happy to kick-start you into Gizmo scripting...If there's something you want to do, but can't do in Gizmo, I'd love to hear about that...I don't think C/C++ is a language worth learning unless you have very specific aims in mind. Python is far more useful for all but the lowest level tasks.That said...With your error, you want to add a Framework to your project, specifically the OpenGL.framework, you should be able to find it in /Library/Frameworks/ I believe.The menus / process to add it in Xcode should be easy enough.(Expect to be fighting these obscure error messages for quite some time.) Quote
Kieran Posted August 21, 2011 Author Report Posted August 21, 2011 Hi Ben,I can't seem to find any frameworks by the name "OpenGL" in /Libary/Frameworks, nor could I find any via searching.I have looked at Gizmo, but I couldn't find anywhere to begin. With C/C++ there was a wiki on how to start, and example code; i can't seem to find this for Gizmo.I would love to use Gizmo, I have read about it and can see the benefits (I have a basic knowledge of python), but I don't know where to start.I currently don't have any specific projects in mind, but as I continue to develop my various aircraft, I'm sure there will be things that will need a plugin.If someone can give me a few pointers to start in Gizmo, I will be sure to give it a go.Cheers Kieran Quote
Kieran Posted August 21, 2011 Author Report Posted August 21, 2011 Never mind the C/C++ issue, Sandy gave me some updated code and it builds fine. Quote
tkyler Posted August 21, 2011 Report Posted August 21, 2011 (edited) As someone who likes to learn period...I like to learn C/C++ for "non-xplane" reasons and just the overall mental challenge so I continue to study it. Besides, if Ben dies or falls of the face of the earth or is abducted by aliens or something, then it doesn't hurt to know SDK esoterica either....... BUT for now I use gizmo exclusively for xplane when I need to get something done, the power is just stupid and fast. I agree the "how to begin" documentation is lacking and as a "typer" and a "talker", I'd like to write something up eventually. That being said, if your goal is to accomplish results within x-plane as opposed to "the journey", then in that case, I think you owe it to yourself to look into gizmo. I was a "slow converter" having written all my stuff in C on the MU2 and Falco, but having accomplished everything in gizmo/lua that I did in C now, I'm not looking back. No compiler, no compiler headaches, just a text editor and instant changes while the sim runs. If, however, you just plain flat-out want to learn some C for whatever reason, then we won't knock you for that either because sometimes you have to experience the challenge to embrace the solutions. Edited August 21, 2011 by tkyler Quote
Ben Russell Posted August 21, 2011 Report Posted August 21, 2011 (edited) I started in Visual Basic.Became obsessed with "Knowing C".Learnt C.. ..and a whole pile of other stuff along the way.Turned around and made myself a script engine with VB-like ease so that I don't have to use C anymore to enjoy programming. Edited August 21, 2011 by Ben Russell Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.