| |

VerySource

 Forgot password?
 Register
Search
View: 746|Reply: 4

Use as undefined type error

[Copy link]

2

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-2-14 13:30:01
| Show all posts |Read mode
I included the header file of class B in the header file of class A, and used a function of class A in the header file of class B. Compilation error: Undefined type A was used.
I added it in B's header file again; class A; still no.
Reply

Use magic Report

0

Threads

19

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 France

Post time: 2020-4-13 15:45:01
| Show all posts
Of course not, you can't use it that way. Use pointers or references instead.
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-4-13 17:45:01
| Show all posts
Include class A header files in class B header files
Reply

Use magic Report

0

Threads

36

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-4-14 15:15:02
| Show all posts
Add file header protection
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-5-1 23:15:02
| Show all posts
I guess it is your connection problem, not a compilation problem
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list