Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Build single execution file? 1

Status
Not open for further replies.

inetd

Technical User
Jan 23, 2002
115
HK
How to build single execution file when I have included some .hpp file?

I have unchecked the "Use dynamic RTL" in Linker tab and unchecked the "Build with runtime package" in Packages tab.
However I got the linker error "Unresolved external '__fastcall Filectrl:DirectoryExists(const System AnsiString)' referenced from ......

My project has included Filectrl.hpp and Inifiles.hpp. I think this is why I got the error.

Thanks.
 
You need to include a lib-file to your project. I think it is vcl50x.lib but I am not sure about that
 
I have found vclx50.lib in the lib folder but how can I include it from my project?

Thanks.
 
in the menu Project\Options\Packages
add ";Vclx50" to the runtime packages textbox

OR

in the "Project manager" right click the exe file choose add and browse to the lib file vclx50.lib and dblclick it


either way works, the second method shows the lib in your project manager. I don't know which way is correct (theoretically spoken).
 
try deleting the lib files and the objs found in the project directory that you have saved your project in.
then recompile. I have to do this once in a while.
when you recompile these files are rebuilt and sometimes it clears theses errors. The lib files from the bcb packadge
should take care of themselves. dont delete any thing that came from borland. only those that are created when you compile.
 
I still can't make the single exe file with including FileCtrl.hpp.
 
are you adding the filectrl.hpp reference yourself and if so
will it compile without the reference and without the function call.
 
Yes, I had included the filectrl.hpp myself and call some functions like FileExists(), DirectoryExists() that are in filectrl.hpp.

How can I fix this problem?

Thanks.
 
I really dont think you need to add this file
manually when in the bcb environment. try removing the
include statement and compile again.

My experience is that filectrl.h is included by way of
vcl.h. My interpretation may be wrong but I have never had to include this file.

My default compile option for everything I do is to compile without the dynamic rtl and without the runtimes.
 
Well, I had tried before and I still can't make a single exe file.
If I do not include the filectrl.hpp, the compiler said that "Call to undefined function 'DirectoryExists'". My program needs this function call that is defined in filectrl.hpp.
I had read the bcb help and the example of DirectoryExists has also included the filectrl.hpp.
 
I just did the following project. It seemed to work.
The help topic lists this function as

Unit
FileCtrl

Category
file management routines

extern PACKAGE bool __fastcall DirectoryExists(constSystem::
AnsiString Name);

notice that the filectrl is listed as part of a unit Filectrl. I usually take this as meaning that the particular header file is added by some other header.
'ie' vcl.h. the program below wouldnt work without the
hpp file added. you might add this in the project header file. I learned something. Thanks. I really couldn't tell you why your project doesnt work.

Good Luck

// this seems to work.
#include <vcl.h>

#include <Filectrl.hpp>
#pragma hdrstop

#include &quot;Unit1.h&quot;

#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;

__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
if (DirectoryExists (&quot;C:\\windows&quot;))
ShowMessage (&quot;test&quot;);
}

 
Thanks butthread.
It works after adding the filectrl.hpp into the header file.

 
I think we stumbled into the solution.
I'm glad we could help.

tomcruz.net
 
I saw your comments and I tried to do it and it worked, so I think that you should do this:

1.-Uncheck the &quot;Use dynamic RTL&quot;
2.-Uncheck the &quot;Build with run time packages&quot;
3.-Add the Vclx50.lib to your project pressing Shift + F11 search the file and double click
4.-Include the FileCtrl.hpp
5.-And compile your program

if it fails try re-installing your BCB.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top