Compiling a Class in several parts?!?

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Sep 2004
Posts: 421
Reputation: JoBe is on a distinguished road 
Solved Threads: 4
JoBe's Avatar
JoBe JoBe is offline Offline
Posting Pro in Training

Re: Compiling a Class in several parts?!?

 
0
  #11
Jun 29th, 2005
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,400
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 247
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Compiling a Class in several parts?!?

 
0
  #12
Jun 29th, 2005
In the top picture it looks like compile progress is in your vkv.h file. Your class declaration is in LATestVoorBeeldenBoek.cpp -- it should be in you vkv.h.

The popup seems to indicate that you were attempting to compile a header. You don't click on 'compile' for a header.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 421
Reputation: JoBe is on a distinguished road 
Solved Threads: 4
JoBe's Avatar
JoBe JoBe is offline Offline
Posting Pro in Training

Re: Compiling a Class in several parts?!?

 
0
  #13
Jun 29th, 2005
>> The popup seems to indicate that you were attempting to compile a header. You don't click on 'compile' for a header.

Then when I create that Header file vkv.h, I just write the code and save it as a Header File?

Also, you have a map called 'External Dependencies', instead of putting the Header file in there, can I just put it in the map 'Header files'?

I notice that in your Source Files for Sample PP, there are two .cpp files, main.cpp and vkv.cpp, did you add these to the vkv.h header file?

Did you add any files towards the main.cpp or/and vkv.cpp?

I have deleted the different programs and will make a new attempt tommorow, I printed you're example so I have an idea what it should look like

Thanks for your patience Dave, very much appreciated :!:
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,400
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 247
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Compiling a Class in several parts?!?

 
0
  #14
Jun 29th, 2005
>Then when I create that Header file vkv.h, I just write the code and save it as a Header File?

I think so -- I'm not familiar with that editor. I usually just save a file as whatever.h.

>Also, you have a map called 'External Dependencies', instead of putting the Header file in there, can I just put it in the map 'Header files'?

I didn't put anything anywhere. When the compiler found files that were #included, it listed them there.

>I notice that in your Source Files for Sample PP, there are two .cpp files, main.cpp and vkv.cpp, did you add these to the vkv.h header file?

I added the source files to the project.

>Did you add any files towards the main.cpp or/and vkv.cpp?

No.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 421
Reputation: JoBe is on a distinguished road 
Solved Threads: 4
JoBe's Avatar
JoBe JoBe is offline Offline
Posting Pro in Training

Re: Compiling a Class in several parts?!?

 
0
  #15
Jun 30th, 2005
Yep, got it Dave:

http://img252.imageshack.us/img252/9...gtwo5da.th.jpg

With your explanation and example I managed to do it

Thanks very much for the help, really appreciated it :!:

Thanks to ImageShack for Free Image Hosting
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,400
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 247
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Compiling a Class in several parts?!?

 
0
  #16
Jun 30th, 2005
Good to hear.

Describing the process of creating project using multiple source files is not the easiest thing to do!
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 421
Reputation: JoBe is on a distinguished road 
Solved Threads: 4
JoBe's Avatar
JoBe JoBe is offline Offline
Posting Pro in Training

Re: Compiling a Class in several parts?!?

 
0
  #17
Jun 30th, 2005
I understand, neither is trying to explain something what's wrong without being able to show it.

But like I said, with what you told me then showing me how you did it with the picture, I just deleted the previous one and started again.

I didn't compile the headerfile vkv.h and after creating the other source files and compiling them, the headerfile automatically was added towards the program

Thing with these items is, that once you have seen how it is supposed to be done, it isn't difficult at all, but, problem is, you have to be able to let it succeed ONE TIME :lol:
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC