Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Including DesignIntf results in "Unable to open include file"....


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 20 - Last Post: Jul 17, 2014 2:54 AM Last Post By: Mohammad Alsharif
Stefan Brummel

Posts: 2
Registered: 11/21/09
Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 2, 2012 7:45 AM
Hi,

I#m creating my component build in XE now in XE2.
But I always getting an error with these includes:
#include <propsys.hpp>
#include <design.DesignIntf.hpp>
#include <design.DesignEditors.hpp>
[code}
 
I already found that if I'm checking the file, (select the file name and press ctrl-enter) that it is pointing to the .pas file.
When I then add the path with \design\DesignIntf.hpp, then the file is found but still i will get these error with the next time the include has to be opened by another hpp file
 
What am i doing wrong here. Why is XE2 not finding these *.hpp files
 
 
thx a lot
 
Stefan
 
complete code:

//---------------------------------------------------------------------------
#ifndef TGambitBarCodePropH
#define TGambitBarCodePropH

//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>

#include <propsys.hpp>
#include <DesignIntf.hpp>
#include <DesignEditors.hpp>

//---------------------------------------------------------------------------
// ClassProperty von der Barcodeklasse
class PACKAGE TGamBitBarcodeProperty : public TClassProperty
{
public :
__fastcall TGamBitBarcodeProperty(
const Designintf::_di_IDesigner ADesigner, int APropCount);

__fastcall virtual ~TGamBitBarcodeProperty(void);
virtual TPropertyAttributes __fastcall GetAttributes (void);
};

#endif
{code}

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Including DesignIntf results in "Unable to open include file"....
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 2, 2012 9:37 AM   in response to: Stefan Brummel in response to: Stefan Brummel
Stefan wrote:

I#m creating my component build in XE now in XE2.
But I always getting an error with these includes:

You prefixed the .hpp filenames with "design." when you should have used
"design\" or "design/" instead. A better option is to not specify the folder
in the #include at all. Specify just the filenames by themselves and then
make sure that the "$(BDS)\include\windows\vcl\design" folder is included
in the Includes search path of the Project Options.

--
Remy Lebeau (TeamB)
Stefan Brummel

Posts: 2
Registered: 11/21/09
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 2, 2012 12:01 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
You prefixed the .hpp filenames with "design." when you should have used
"design\" or "design/" instead. A better option is to not specify the folder
in the #include at all. Specify just the filenames by themselves and then
make sure that the "$(BDS)\include\windows\vcl\design" folder is included
in the Includes search path of the Project Options.

This was helpful, the problem was that I was given the following path
$(BDS)\include\vcl\design

Just blind in adding all these paths :-)

thx a lot compiled now my Component in XE2
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 18, 2014 3:02 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy wrote:
... and then make sure that the "$(BDS)\include\windows\vcl\design" folder is included
in the Includes search path of the Project Options.

That worked with one include error when I had the library exist but the path wasn't included, but now I can't find the other header file in my path at all!
I am trying to run a project built using XE3 on XE5, I am getting many errors but I think that most of them are just resulting from this one:

[bcc32 Error] AVTBitMap.h(13): E2209 Unable to open include file 'PvApi.h'

which corresponds to the line of code:
#include <PvApi.h>

any idea how I can solve this error?

Thanks in advance
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 18, 2014 9:57 AM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Mohammad Alsharif wrote:
[bcc32 Error] AVTBitMap.h(13): E2209 Unable to open include file 'PvApi.h'

That is not an Embarcadero header file. It is a third-party header file from Allied Vision Technologies (AVT). If you have that API installed, you likely do not have the IDE/project's Includes path set up correctly so the compiler can find the API's files.

--
Remy Lebeau (TeamB)
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 20, 2014 7:12 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
That is not an Embarcadero header file. It is a third-party header file from Allied Vision Technologies (AVT). If you have that API installed, you likely do not have the IDE/project's Includes path set up correctly so the compiler can find the API's files.

I did exactly what you suggested, I installed the header file and added it's path to the "include path" in the "C++ shared options", this solved the error but created two more errors that I think are related to the system itself:

[bcc32 Error] AVTConnector.h(9): E2209 Unable to open include file 'windows'
[bcc32 Error] AVTConnector.h(19): E2209 Unable to open include file 'winsock'

Even though I can open both "Winapi.Windows" and "Winapi.Winsock" by clicking Ctrl+Enter on each folder! Any idea why they can't be included?

Thanks a lot
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 20, 2014 1:10 PM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Hello Mohammad,

[bcc32 Error] AVTConnector.h(9): E2209 Unable to open include file
'windows'
[bcc32 Error] AVTConnector.h(19): E2209 Unable to open include
file 'winsock'

The correct filenames are windows.h and winsock.h, respectively. Sounds
like AVTConnector.h is dropping the extensions in its #include statements,
eg:

#include <windows>
#include <winsock>


That will not work. The extensions are needed:

#include <windows.h>
#include <winsock.h>


--
Remy Lebeau (TeamB)
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 29, 2014 5:51 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
The correct filenames are windows.h and winsock.h, respectively. Sounds
like AVTConnector.h is dropping the extensions in its #include statements,

Hi Remy and thanks for your answer. Your above suggestion solved this problem but now I have 16 errors having the same structure as:

[ilink32 Error] Error: Unresolved external 'PvVersion' referenced from C:\USERS\OILPAS\DESKTOP\SA HELLWIG\AVTCAM\DEBUG_BUILD\MAIN.OBJ

It is important to mention that I added the corresponding library, but now I am getting an error each time I call a Method declared in this library. So how
can the compiler see the library but not seeing the Methods declared in it?

Thanks a lot
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 30, 2014 10:09 AM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Mohammad wrote:

It is important to mention that I added the corresponding library, but
now I am getting an error each time I call a Method declared in this
library. So how can the compiler see the library but not seeing the
Methods declared in it?

You are not getting compiler errors, you are getting linker errors. Two
different beasts. The compiler sees the methods and creates reference symbols
to them that the linker is then not able to resolve when creating the final
EXE file. Either the project does not actually have a reference to the relevant
library/package (that affects the linker, not the compiler), or else the
compiler and linker are not agreeing on the exact decoration/mangling of
the symbols for the methods.

--
Remy Lebeau (TeamB)
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2014 12:46 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Either the project does not actually have a reference to the relevant
library/package (that affects the linker, not the compiler),

How can I check if I referenced it correctly? I included the needed header file, what to do more?

or else the compiler and linker are not agreeing on the exact decoration/mangling of
the symbols for the methods.

So how can I know if they agree or not? if not, how can I make them agree on the symbols?

But after adding #pragma link "PvAPI" to my code, it gave me only one error which is:
[ilink32 Error] Fatal: Unable to open file 'PVAPI.OBJ'

Thanks a lot again and in advance

Edited by: Mohammad Alsharif on Jul 1, 2014 3:23 AM

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Including DesignIntf results in "Unable to open include file"....[Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2014 9:44 AM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Mohammad wrote:

How can I check if I referenced it correctly? I included the needed
header file, what to do more?

Of course. A header file is only used by the compiler. The linker uses
library references in the project to resolve function/method calls that the
compiler generates. You need to add the relevant .lib file to the project.
Assuming the API consists of a DLL, it probably shipped with a .lib for
VisualStudio, which will not work in C++Builder. But you can use C++Builder's
command-line IMPLIB tool to create a new .lib file from the DLL.

--
Remy Lebeau (TeamB)
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....[Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2014 11:34 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
... But you can use C++Builder's
command-line IMPLIB tool to create a new .lib file from the DLL.

Could you explain me please how to do it?
Yes indeed, I added the .lib and it didn't work.

Thanks
Alex Belo

Posts: 626
Registered: 10/8/06
Re: Including DesignIntf results in "Unable to open include file"....[Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 1, 2014 10:24 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

You need to add the relevant .lib file to the project.

In CB2007 (I don't know about recent versions) adding lib to project is
not enough: I have to add path explicitly to the lib paths in project
options because for unknown reason IDE does not add paths of added libs
to linker's command line.

--
Alex
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 16, 2014 2:34 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
That is not an Embarcadero header file. It is a third-party header file from Allied Vision Technologies (AVT). If you have that API installed, you likely do not have the IDE/project's Includes path set up ?>correctly so the compiler can find the API's files.

After including the header file and linking to it, I got this error:

[ilink32 Error] Error: 'C:\...my path...\PVAPI.LIB' contains invalid OMF record, type 0x21 (possibly COFF)

I have been reading that what is needed is the Borland OMF format. So what can be done at this point?

Thanks a lot
Alex Belo

Posts: 626
Registered: 10/8/06
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 16, 2014 3:57 AM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Mohammad Alsharif wrote:

[ilink32 Error] Error: 'C:\...my path...\PVAPI.LIB' contains invalid
OMF record, type 0x21 (possibly COFF)

I have been reading that what is needed is the Borland OMF format. So
what can be done at this point?

If this lib is simple import of dll's interface when you can try
coff2omf utility. Or use implib ("implib PVAPI.LIB PVAPI.dll").

Otherwise (if lib is set of coff .obj modules) you can not link or
convert it to omf. (I knew one converter but never used it myself: too
complicated and unreliable IMHO). You can

--
Alex
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 16, 2014 4:06 AM   in response to: Alex Belo in response to: Alex Belo
Alex Belo wrote:
If this lib is simple import of dll's interface when you can try
coff2omf utility. Or use implib ("implib PVAPI.LIB PVAPI.dll").
I tried both of them:
implib PvAPI.LIB PvAPI.dll
Coff2Omf PvAPI.LIB PvAPI.dll

but each of them has created this error:
[bcc32 Error] main.cpp(32): E2141 Declaration syntax error

Otherwise (if lib is set of coff .obj modules)
how can I find out if it is a set of coff .obj modules or not?

Thanks a lot

Edited by: Mohammad Alsharif on Jul 16, 2014 4:11 AM
Alex Belo

Posts: 626
Registered: 10/8/06
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 16, 2014 4:19 AM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Mohammad Alsharif wrote:

I tried both of them:
implib PvAPI.LIB PvAPI.dll
Coff2Omf PvAPI.LIB PvAPI.dll

but each of them has created this error:
[bcc32 Error] main.cpp(32): E2141 Declaration syntax error

:)

Coff2Omf and implib are command line utilities (see in your builder\bin
directory) to produce omf libs.

See also tdump utility to examine the results.

--
Alex
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 16, 2014 4:26 AM   in response to: Alex Belo in response to: Alex Belo
Alex Belo wrote:
Coff2Omf and implib are command line utilities (see in your builder\bin
directory) to produce omf libs.
So how to use them? isn't it as simple as write the line of code in the program?

Thanks
Alex Belo

Posts: 626
Registered: 10/8/06
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 16, 2014 4:55 AM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Mohammad Alsharif wrote:

So how to use them?

Run command prompt and run coff2omf without parameters to see help:

D:>coff2omf
COFF to OMF Converter Version 1.0.0.74 Copyright (c) 1999, 2000 Inprise
Corporation
Syntax: COFF2OMF [options] InputFile OutputFile
-h, -? Display help
-q Quiet mode
-v Verbose mode
-r Remove (delete) output file if empty
-lib:xx Specify options for OMF import library generation:
ms - Allow entries that have MS C++ name mangling (default: no)
st - Normalize names instead of aliasing MS stdcall mangling
ca - Don't perform MS cdecl aliasing (default is to alias)

Convert lib:

coff2omf pvapi.lib pvapi_omf.lib

Add created pvapi_omf.lib to your project.

--
Alex
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 16, 2014 10:55 AM   in response to: Mohammad Alsharif in response to: Mohammad Alsharif
Hello Mohammad,

After including the header file and linking to it, I got this error:

[ilink32 Error] Error: 'C:\...my path...\PVAPI.LIB' contains invalid
OMF record, type 0x21 (possibly COFF)

That typically means the API comes with an import .lib file for a DLL, and
the .lib file is meant for Visual Studio. To static link to that DLL in
C++Builder, you would have to use C++Builder's command-line IMPLIB tool to
create a new compatible .lib file from the DLL, then add that .lib file to
your project instead of the original .lib file.

--
Remy Lebeau (TeamB)
Mohammad Alsharif

Posts: 36
Registered: 6/29/14
Re: Including DesignIntf results in "Unable to open include file"....  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 17, 2014 2:54 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy and Alex,

you would have to use C++Builder's command-line IMPLIB tool to
create a new compatible .lib file from the DLL, then add that .lib file to
your project instead of the original .lib file.

This is exactly what I did, but the surprising part is that library got corrupted afterwards,
now all the methods used in my codes which are declared in this library don't work and
will give errors of this structure:

[ilink32 Error] Error: Unresolved external 'PvCameraListEx' referenced from C:\USERS\OILPAS\DESKTOP\64\IMPLIB\AVTCAM - COMPILING\DEBUG_BUILD\AVTCONNECTOR.OBJ

Any ideas?
Thanks for your answers.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02