Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-15-2010, 02:33 AM   #1 (permalink)
Registered Member
 
headkaze's Avatar
 
Join Date: Feb 2010
Posts: 343
Default Forward declaring an Obj-C class in C++

I had this working before but since I've been moving code around to clean things up I'm getting an error now.

I am forward declaring an Obj-C class inside a .h file. It's just a pointer inside a C++ definition.

Code:
class MD2Model;
I get the following error

Code:
.. error: 'MD2Model' redeclared as different kind of symbol
.. previous declaration of 'struct MD2Model'
This worked fine a moment ago, and now it doesn't.
headkaze is offline   Reply With Quote
Old 03-15-2010, 02:57 AM   #2 (permalink)
Registered Member
 
headkaze's Avatar
 
Join Date: Feb 2010
Posts: 343
Default

Nevermind, all I had to do is in the files where the error was showing to move the

Code:
#include "MD2Model.h"
To the very top of the include list so it is included before the forward declaration.

Last edited by headkaze; 03-15-2010 at 03:00 AM.
headkaze is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 268
20 members and 248 guests
ADY, AragornSG, Bertrand21, Dani77, Dattee, Duncan C, fkmtc, HDshot, HemiMG, iDifferent, JasonR, macquitzon216, mer10, prchn4christ, Rudy, sacha1996, sneaky, spiderguy84, Sunny46, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,231
Posts: 380,768
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:11 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0