Board index » cppbuilder » Unable to find xxx.obj when using my control in a project

Unable to find xxx.obj when using my control in a project

I am having problems with my control when it links when using it in a test
application.

My package is set up as follows:
Contains:
  About
        About.cpp
        SNCAboutBox
  SNCAboutComponent.cpp
  SNC Package.cpp

SNCAboutComponent is just a wrapper component that has a function to call
the about box which is contained in About.cpp and SNCAboutBox is the dfm
information.
I have create library checked. When I do a build it does produce the lib
file. But, when I look at it with tlib, the information from about.cpp does
not show up.
If I install it as a component, and then put it into a test project form,
then it says it can't find About.obj when it links. It doesn't look for the
other two files, only this one. If  I put about.obj into the directory of
the project every thing works fine. I tried manually putting it into the lib
file with tlib, but it still can't find the file about.obj.
I have seen a couple of posts where it was suggested to put #pragma link
"about" in the file but that did not help either.
Is it possible that because it is a form that it is treating it differently?
I thought that this was the purpose of controls to package all this stuff
up?

Any help would be greatly appreciated
Brian Moravecky

 

Re:Unable to find xxx.obj when using my control in a project


Hi,

Do you have the PACKAGE macro at the declaration of every class that's in
About.cpp? In other words what do you have (probably in About.h):

class TWhatever...

- or -

class PACKAGE TWhatever...?

If you don't have PACKAGE, try adding it.

Regards,
novios

Re:Unable to find xxx.obj when using my control in a project


It wasn't in about.h. I put it in the class in about.h and did a build. Did
not make a difference.

Thanks for the suggestion, I'm still looking
Brian Moravecky

Re:Unable to find xxx.obj when using my control in a project


Figured out that it needs
#pragma package(smart_init) in the about .cpp to make it link the same as
the other files in the package.

Brian Moravecky

Quote
"novios" <nov...@abv.bg> wrote in message news:3d4ba2ea_1@dnews...
> Hi,

> Do you have the PACKAGE macro at the declaration of every class that's in
> About.cpp? In other words what do you have (probably in About.h):

> class TWhatever...

> - or -

> class PACKAGE TWhatever...?

> If you don't have PACKAGE, try adding it.

> Regards,
> novios

Other Threads