2 Replies - 158 Views - Last Post: 09 August 2012 - 05:38 PM Rate Topic: -----

#1 rethc  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 76
  • Joined: 23-April 12

Array of objects linking error

Posted 09 August 2012 - 05:25 PM

Im getting a linking error on this line:

LibItem* array[10];


if i try this:
LibItem::LibItem *array[10];


I get an error Improper use of typdef 'LibItem"

The object LibItem definition is in a header file and declaration is in the source file. what is the correct syntax for a array of objects

This post has been edited by rethc: 09 August 2012 - 05:27 PM

Is This A Good Question/Topic? 0
  • +

Replies To: Array of objects linking error

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1690
  • View blog
  • Posts: 2,553
  • Joined: 21-June 11

Re: Array of objects linking error

Posted 09 August 2012 - 05:28 PM

Can you show us the declaration? Is it extern?

... Wait...

Quote

The object LibItem definition is in a header file and declaration is in the source file.


You mean the other way around, right?

This post has been edited by sepp2k: 09 August 2012 - 05:29 PM

Was This Post Helpful? 0
  • +
  • -

#3 rethc  Icon User is offline

  • D.I.C Head

Reputation: 12
  • View blog
  • Posts: 76
  • Joined: 23-April 12

Re: Array of objects linking error

Posted 09 August 2012 - 05:38 PM

edit: fixed, i just needed a default constructor

This post has been edited by rethc: 09 August 2012 - 05:50 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1