Noobish C++ Question - invalid argument types

Apprentice
Posts: 14
Joined: 2008.08
Post: #16
akb825 Wrote:You need to include JSManager.h within JSFunctions.cpp so it knows the definition of the class.

JSFunctions.cp is included by JSManager.cpp, so it already has the header. Even so, I tried adding the include, but still no luck.



EDIT:

I found the problem, the argument type was wrong. If I try using the method with a simple string, it works fine.


Thank you all very much for the help so far. I'm sure this won't be the last you see of me around here!



EDIT2:

I could do with some help with MachO libraries, and how to get Allegro to read all the headers properly... anyone know how to get MachO library headers? or do I have to copy them into the project?
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #17
In C and C++, it's generally a bad idea to include cpp files within other cpp files. You want to keep all your interface information etc. in .h files and include those, then put the actual definitions for your functions in the .cpp files to be compiled separately and linked together.

Mach-O libraries are just a binary with your code to be dynamically linked at runtime. As such, there's no built-in mechanism to handle header files. The best way to get your headers working is to have an directory structure that allows you to easily add the include directory for one project to the additional include search paths for another project. For example, say you have a common directory called "MyProjects", with projects "Project1" and "Project2" within them. If you need the headers from Project1 in Project2, you can easily add a relative path from Project2 to Project1's include directory using the "-I" command line argument in gcc.
Quote this message in a reply
Apprentice
Posts: 14
Joined: 2008.08
Post: #18
akb825 Wrote:In C and C++, it's generally a bad idea to include cpp files within other cpp files. You want to keep all your interface information etc. in .h files and include those, then put the actual definitions for your functions in the .cpp files to be compiled separately and linked together.

Mach-O libraries are just a binary with your code to be dynamically linked at runtime. As such, there's no built-in mechanism to handle header files. The best way to get your headers working is to have an directory structure that allows you to easily add the include directory for one project to the additional include search paths for another project. For example, say you have a common directory called "MyProjects", with projects "Project1" and "Project2" within them. If you need the headers from Project1 in Project2, you can easily add a relative path from Project2 to Project1's include directory using the "-I" command line argument in gcc.

Thanks for that.


Has anyone here had any experience with Allegro with XCode? It seems to be missing half the headers in the .framework file, and I'm not sure how to get it to work. I had posted this on the allegro.cc forums, but I haven't had a reply there (posted on Thursday).


(Thanks again for help so far!)
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  invalid display CactusJack 2 2,883 May 12, 2009 03:39 AM
Last Post: Robin Forder
  Quicktime image importer file types? kelvin 2 2,623 Mar 15, 2005 08:19 PM
Last Post: arekkusu