Jump to content

Recommended Posts

Posted

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).

Cheers

Kieran

post-828-131369617023_thumb.png

  • 4 weeks later...
Posted (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 by tkyler
Posted

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

Posted (edited)

Aright, I have hit another bump. While trying to build the ExampleGuage.cpp file from the AdvancedSDKExamples. I get the following errors.

2lc22b6.png

jhd179.png

o6mmag.png

(had to use this because the image uploader here isn't working for me)

Cheers

Kieran

Edited by Kieran
Posted

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.)

Posted

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

Posted (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 by tkyler
Posted (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 by Ben Russell

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...