Inherit from another projects class

Hello together,
I am new to Eclipse-CDT and I have the following Problem:
I have 2 C++-Projects im my Workspace,
now i want ClassB in Project 2 to inherite from ClassA in Project 1
I managed that by adding the Source-Path of Project 1 to the Include-List (Project2->Properties->Paths and Symbols->Include) of Project2
After that I am able to include the header for ClassA in my ClassB-Source.
But when i want to build Project2 i got the following Errors:
Quote:
Nicht definierter Verweis auf `ClassA::ClassA(char*)' ClassB.cpp /Project2/src/system line 16 C/C++ Problem
Nicht definierter Verweis auf `ClassA::~ClassA()' ClassB.cpp /Project2/src/system line 21 C/C++ Problem
Line 16 is the Call of the ClassB-Constructor,
Line 21 is the ClassB-Destructor:
ClassA - Header:
class ClassA
protected:
public:
ClassA(char *workingDir);
virtual ~ClassA();
ClassA - cpp:
ClassA::ClassA(char *workingDir)
ClassA::~ClassA()
ClassB - Header:
class ClassB : public ClassA
public:
ClassB(char *workingDir);
virtual ~ClassB();
ClassB - cpp:
ClassB::ClassB(char *workingDir) :
ClassA(workingDir) // Line 16 -> Nicht definierter Verweis auf `ClassA::ClassA(char*)' ClassB.cpp /Project2/src/system line 16 C/C++ Problem
ClassB::~ClassB() // Line21 -> Nicht definierter Verweis auf `ClassA::~ClassA()' ClassB.cpp /Project2/src/system line 21 C/C++ Problem
What is the Problem here?

Undefined reference (Nicht definierter Verweis) is a linker error. It means the linker couldn't find the object files defining ClassA members. If these are in a different project then you need a way to cause the linker to include the objects files from the project containing ClassA when linking executables using ClassB.
I realize this is vague but you apparently have code missing in your post. For example, how does ClassB know about ClassA in your ClassB - Header and ClassB - cpp and is there a main routine somewhere? Also, are these managed projects or makefile projects? It's difficult to know ahead of time what would be helpful, ain't it?
I tend to think of related projects as libraries for use by the project intended to produce main executable code. That means the "external" projects should be building link libraries. Perhaps the easiest way is to combine all of them into one project unless there is some pressing reason for keeping them separate.

Similar Messages

  • How to include a CSS from another project

    Hi all,
    I'm developing an AbstractPortalComponent which uses some of my own defined stylesheets. I can include the stylesheet defined in my own project by this:
    com.sapportals.portal.prt.resource.IResource myStyle =
    request.getResource("css", "css/my_nav.css");   
    response.include(request, myStyle);
    Now I need to include another CSS but from another project.
    I tried also to get the response and write the HTML code but it writes it into the <BODY></BODY> tag and the CSS is not used when rendering the document:
    ...</head>
    <body class="prtlBody urFontBaseFam urScrl">
    <LINK REL=stylesheet HREF="/irj/portalapps/myProject/css/zglobal.css" TYPE="text/css">
    Does anybody know the solution?
    Thanks in advance,
    Romano

    There are document hooks that you can use to insert things into the response of a page being written to the client.
    Therefore, if you create a service which implements the IDocumentHookListener, you will then need to implement the
    String doDocumentHook(int documentPosition, IPortalComponentRequest request, IPortalComponentResponse response)
    and
    void doDocumentHook(int documentPosition, IPortalComponentRequest request, IPortalComponentResponse response)
    The first method, that returns a String, you can basically check where in the document you would like to write code, something like
    switch (documentPosition) {
      case IDocumentHookListener.HEAD_SECTION_BEGIN :
        return "some string";
        break;
      case IDocumentHookListener.HEAD_SECTION_END :
        return "some other string";
        break;
    The second method, simply writes out the String returned from the first method to the response, i.e.
      response.write(doDocumentHook(documentPosition, request));
    I hope this helps
    Darrell

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

  • Importing sequence from another project, can't connect to dynamic link

    I'm trying to get another sequence from another project into this one (mostly to be able to copy over a specific edit from that without remaking it) and when trying to do so, the system, as per the usual, tries to connect to the dynamic link server, but stalls on the connection screen for some time.  One time it simply told me that it could not connect, and another time I got an "unspecified draw error".  I'm using a PC.  Any help that anyone could provide would be greatly appreciated; I've never run into this issue before, and have had to copy edits between projects multiple times.

    Hi Boonslayer,
    Wrong forum. Moving to Premiere Pro forum.
    Kevin

  • Importing single bin from another project

    Do any of the experts (or former Avid users) know how to import a single bin from another project into the current project - is this possible in CS6? Also is there anything like the dupe detection in Avid? On the subject of Speech to text (analysis) does this improve over time - i.e. is there a learning system such as in Dragon Naturally Speaking that will reduce the gibberish somewhat? Thanks

    Hi Mike,
    You can only import an entire Premiere Pro project, or a selected sequence, into your current PP project.  If you want to import just a single Bin, you can:
    Make a copy of the project you want to import, and then, in the Project window, delete all media outside the Bin you you want to keep.  Now import that modified project with only 1 Bin.
    Put all of your Bin's media on a new sequence, and then import just that sequence into PP.  Only the media associated with that sequence will be copied into your master project.
    Import your entire PP project and delete all media outside your Bin from within your master project.
    No dupe detection as of yet.  If you haven't already, please send Adobe a Feature Request here: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&promoid=EWQQL.  The more people ask this, the better the chances we'll finally get it (I miss it from FCP).
    As for Speech to text, I don't use it so I don't know.  Hopefully someone else will chime in.
    Hope this helps.  Cheers!

  • Inheriting Project Roles from another project

    Hello all,
    I wants to inherit all the project roles from one project to another without actually creating the new roles, and then close the parent project.
    Because i have one business requirement that we need to create a new project with same resources as the parent project and it is too time consuming to create roles, consider the case there are 10-15 resources assigned.
    Is there is any way to do it ?

    Hi Rahul,
    You can create generic  project template in which you can create the WBS and create the roles as well as you can assign business partner to roles .
    use the template while creating the project all the role from the template will be inherited.
    Regards
    shiv

  • How to refresh a JTable of a class from another thread class?

    there is an application, in server side ,there are four classes, one is a class called face class that create an JInternalFrame and on it screen a JTable, another is a class the a thread ,which accept socket from client, when it accept the client socket, it deal the data and insert into db,then notify the face class to refresh the JTable,but in the thread class I used JTable's revalidate() and updateUI() method, the JTable does not refresh ,how should i do, pls give me help ,thank you very much
    1,first file is a class that create a JInternalFrame,and on it there is a table
    public class OutFace{
    public JInternalFrame createOutFace(){
    JInternalFrame jf = new JInternalFram();
    TableModel tm = new MyTableModel();
    JTable jt = new JTable(tm);
    JScrollPane jsp = new JScrollPane();
    jsp.add(jt);
    jf.getContentPane().add(jsp);
    return jf;
    2,the second file is the main face ,there is a button,when press the button,screen the JInternalFrame. there is also a thread is beggining started .
    public class MainFace extends JFrame implements ActionListener,Runnable{
    JButton jb = new JButton("create JInternalFrame");
    jb.addActionListener(this);
    JFrame fram = new JFrame();
    public void performance(ActionEvent e){
    JInternalFrame jif = new OutFace().createOutFace(); frame.getContentPane().add(JInternalFrame,BorderLayout.CENTER);
    public static void main(String[] args){
    frame.getContentPane().add(jb,BorderLayout.NORTH);
    frame.pack();
    frame.setVisible(true);
    ServerSokct ss = new ServerSocket(10000);
    Socket skt = ss.accept()'
    new ServerThread(skt).start();
    3.the third file is a thread class, there is a serversoket ,and accept the client side data,and want to refresh the JTable of the JInternalFrame
    public class ServerThread extends Thread{
    private skt;
    public ServerThread(Sokcet skt){
    this.skt = skt;
    public void run(){
    OutputObjectStream oos = null;
    InputObjectStream ios = null;
    try{
    Boolean flag = flag;
    //here i want to refresh the JTable,how to write??
    catch(){}
    4.second is the TableModel
    public class MyTableModel{
    public TableModel createTableModel(){
    String[][] data = getData();
    TableModel tm = AbstractTableModel(
    return tm;
    public String[][] getData(){
    }

    Use the "code" formatting tags when posting code.
    Read this article on [url http://www.physci.org/codes/sscce.jsp]Creating a Simple Demo Program before posting any more code.
    Here is an example that updates a table from another thread:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=435487

  • Import grades from another project

    Well, I've battled with this for a year now and here's the result – a simple AppleScript app to let you import grades and geometry from one project (or part of a project) into another for that big weekend render. Run it from the desktop, Dock or stick it in the Script menu. No more three-hourly feeds!
    It's here, it's free.

    Fearless,
    Pardon my ignorance on this, ( I have only been playin with color for a couple of weeks), but from what I have experienced is that I can work on a project, and in the setup room, under the grades tab, I can save the current grade that I'm on. Then in a new project I can import that grade and apply that to any clips that I choose in my timeline.
    I dont have any experience with trying it on geometry though. Again still in the learning part of this app, I guess I'm just looking at when your script would be needed.
    Its great to have an asset like you in the community, thank you for posting this free script. And any advice you have is appreciated!
    sz

  • Inserting animations from another project

    Hello,
    I'm using Captivate 5 (ver. 5.0.2.630) for a while know and up till know I've included interactive content by using creating it in another project, publishing it and than I included it as an animation in my main project.
    That worked fine for me for while but roughly since the last patch the anymation I include won't show anymore.
    The old anymation I included some months ago are solid white (picture 1) work perfectly fine but the ones I recently included are see-through and won't show in the publishe project (picture 2).
    Any ideas how to fix this?
    Thank you
    Michael
         Picture 1
         Picture 2

    Sorry if I was unclear on this. The animation was created in captivate and then imported into my main captivate project as a .swf. I've been working that way since march this year without problems but for the last 1...2 month it just doesn't work anymore.
    What I've done so far is to include the slides from the "animation" project and included them into my main project. But that's not always possible since I might cause problems with my navigation on some occasions.

  • How to call a Jclient form from another project?

    In my workspace, there are three projects. One is for business components. The other two are Jclient forms applications. Can I open a Jclient form from another Jclient form in another project?
    I used to create multi_form accounting application using Oracle Form Builder in which I can call a form from another form.

    Just set one project to be dependant on another in the project settings dialog of the former. This should work.

  • Create New Project and put photo in from another project folder

    This is what I thought was going to be a relative task.
    Move a batch of photos from one project folder into another new empty one.
    I can highlight and select the photos in question and select Edit and Copy.
    Go to new project folder,but No Paste function available.
    I then see the New From Selection in the menu bar....but no New Project.
    Anyone help me out here?
    Mac intuitive !!!!what a load of ???X?£?$

    Ummm OK, tried that and yes it does work, but when you have a large list of projects, it means having to drag a long way down the list, while it is scrolling.
    Bit inconvenient, but if it is the only way. Shame this does not have keyboard shortcut like so much of the Apple stuff
    Will probably have to name a project similar to the one I want to copy from in the future, then rename it again afterwards.
    Thanks

  • Import part of the sequence from another project

    I'm working on about the fifth edit of a project and now want to move part of a sequence (about 40 clips) from one project to another. I understand I could import the entire sequence and then delete all but the portion I want, or delete all but the portion I want and then import it as the entire sequence - but this might take a while. Anyone know of a quicker way to import a portion of a sequence from one project to another. Many thanks

    Thanks guys,
    Would have reported back earlier but have been on other adventures. FYI, never get involved in filming medieval stuff, they're insane. But back to the project in topic, unfortunately the lasso / copy from one project to another certainly did not work in this instance. However thanks to Craig Howard @ # 1. This is probably the only method that will work in this example and even so I'll report on it's outcome later.
    Thanks guys!

  • How sholud we call one jframe class from another jframe class

    Hi
    In my application i am calling one jframe class from another jframe clas.
    how sholud we make previous jframe inactve when another jframe is invoked?(user sholud not able to make any changes on on parent jframe window when another jframe is invoked)
    Pls reply.

    Sorry for me it is not possible to change existing code,
    pls suggest me any other solution so that i can inactive parent jframe when child jframe execution is going on.

  • How to call a process from another project

    Hi;
    How to calling a process from another process in another project? Which activity that i need or web service, direct binding? I use 11g

    Hi Tulasi ;
    I have wsdl of the process i need to call. Also wsdl address on the server. But CALL activity can't use to service call. CALL activity can use only to reusable process call.
    I think, this operation must make on composite.xml. But I have a same problem with this method and it don't work.
    I create a base process that looking at below. It's include a direct binding. Is it include a direct binding?
    [Base Process|http://d1201.hizliresim.com/t/s/21wqu.png]
    Then i create a process that call to base process:
    [Caller Process|http://d1201.hizliresim.com/t/s/21wqx.png]
    I paste to base process' wsdl address on the server. Then i select port type (BaseProcessPortType) and a warning has occured that you see the picture above. Base Process contain Oracle SOA Composite Type. What's the wrong? It happened for Callback Port Type.
    And second question is what's the Address? (under Reference Binding Setails option).
    I think, i create the this direct binding correctly, i call to base process into my caller process via service activities.

  • Frames flickering in from another project. HELP.

    I just finished a project and exported it last week. Today I am working on another project and frames are flickering in from the last project Along with a lot of other weird flickering. I am not sure if it is a linking issue or what. I have restarted my computer and replaced the footage and nothing is seeming to work. I am working on adobe premiere cc 2014 and on a mac pro 2013, 2.7 GHz 12-Core Intel Xeon E5, 64 GB 1867 MHz DDR3 ECC, AMD FirePro D500 3072 MB, OS X.
    Here is a link to a small export to what is going on: https://www.youtube.com/watch?v=zAurGOjxopI&feature=youtu.be
    PLEASE HELP!

    Ummm OK, tried that and yes it does work, but when you have a large list of projects, it means having to drag a long way down the list, while it is scrolling.
    Bit inconvenient, but if it is the only way. Shame this does not have keyboard shortcut like so much of the Apple stuff
    Will probably have to name a project similar to the one I want to copy from in the future, then rename it again afterwards.
    Thanks

Maybe you are looking for