×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    103

    How to correctly create a subproject ?

    I have a Symbian project in Qt/QWidget and I want to use most of its code into another project, just have a different main.cpp and different QMainWindows.

    I created a Subdirs Project (SubProject) and then another mobile project (I named it also SubProject) and in main.cpp of SubProject I include some files from the MainProject.

    The problem is that I get "undefined reference" error on build for all classes from MainProject I'm trying to reference. I tried also adding them to SubProject.pro, but it's the same error. What am I doing wrong and how to correctly create a subproject that can use the files from main project?

    Code:
    make.exe: Entering directory `C:/Develop/QtProjects/MainProject/SubProject'
    sbs -c arm.v5.udeb.gcce4_4_1
     mifconv    : BITMAP  	[arm.v5.udeb.gcce4_4_1]
     target     : epoc32\release\armv5\udeb\SubProject.exe  	[arm.v5.udeb.gcce4_4_1]
       c:/qtsdk/symbian/tools/gcce4/bin/../lib/gcc/arm-none-symbianelf/4.4.1/../../../../arm-none-symbianelf/bin/ld.exe: warning: C:/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/release/armv5/udeb/usrt3_1.lib(ucppinit.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
       C:/QtSDK/Symbian/SDKs/SymbianSR1Qt474/epoc32/build/subproject/c_49a1196a6e3af7fc/Subproject_exe/armv5/udeb/main.o: In function `main':
       C:/Develop/QtProjects/MainProject/SubProject/SubProject/src/main.cpp:218: undefined reference to `MyClass::getInstance()'

  2. #2
    Registered User
    Join Date
    Jul 2008
    Posts
    103

    Re: How to correctly create a subproject ?

    Could it also be a paths error? What would I need to check and change?

    PS: I tried including just 1 file from main project. If the method I call is in the .h file, I don not get any "undefined reference" errors. If it's in the .cpp file, I get " undefined reference" errors. From what I understand, just the .h files from main project are correctly included, probably it's a paths error, how do I manage to correctly add .cpp files to project?
    Last edited by catharsis; 2012-04-13 at 08:57.

  3. #3
    Registered User
    Join Date
    Jul 2008
    Posts
    103

    Re: How to correctly create a subproject ?

    Can anybody help me on this? So .h files are included correctly into project, but .cpp files are not.

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    42

    Re: How to correctly create a subproject ?

    There is a much simpler method: copy your .pro file in the same directory and change it according to your needs. The main.cpp can be the same with conditional define or another file with a different name.

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    103

    Re: How to correctly create a subproject ?

    Ok, so I would have 2 projects that are using same src folder and some common files (thus no duplicates files and changes would be synchronized)? This might work and would be much simpler. Thanks.

    PS: would there be any conflicts with Makefile, deployment.pri and bld.inf ? I can rename the deployment.pri file, but what about Makefile and bld.inf ?
    Last edited by catharsis; 2012-04-13 at 11:10.

  6. #6
    Registered User
    Join Date
    Apr 2011
    Posts
    42

    Re: How to correctly create a subproject ?

    I didn't have to worry about that my only conflict is with the localization file which I need to reedit for the application name each time I change project.

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    103

    Re: How to correctly create a subproject ?

    I renamed deployment.pri and now both project work. Thanks.

Similar Threads

  1. How to use CSatteliteInfoUI correctly
    By greumatt in forum Symbian C++
    Replies: 3
    Last Post: 2008-12-30, 08:57
  2. how to create a new project correctly?? could you help me please!
    By badgunnokia in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-05-07, 03:32
  3. Subproject in CW 2.8
    By MiKeL in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2005-03-11, 21:01
  4. Replies: 1
    Last Post: 2004-04-19, 02:09
  5. sound does not run correctly...
    By shahzad73 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2003-04-02, 12:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •