• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

Liner Error

I have the linker error: Unable to open name.DFM, I don´t knowwhat to do...anyone knows?
0
luisanaz
Asked:
luisanaz
  • 5
  • 5
  • 2
  • +1
3 Solutions
 
Jaime OlivaresSoftware ArchitectCommented:
what are you using?  C++ builder or Visual C++.net?
DFM is a delphi backup file. Are you sure your compiler supports this kind of file?
0
 
luisanazAuthor Commented:
I´m using C++ builder
0
 
luisanazAuthor Commented:
Is only read
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
Jaime OlivaresSoftware ArchitectCommented:
you mean the dmf  file is readonly? maybe you can change it manually from the windows explorer.
0
 
luisanazAuthor Commented:
I meant that I have a program that is only read, when I try to run it, I have the linker error... asking for DFM, I don´t have any idea what to do about it...
0
 
Jaime OlivaresSoftware ArchitectCommented:
do you have a linker error at runtime? that sounds contradictory.
0
 
luisanazAuthor Commented:
Uhm.. no... (sorry about my english) I have none error or warning when I compile units, but when I make the project I have the linker error, not at runtime
0
 
Jaime OlivaresSoftware ArchitectCommented:
It is a strange error, appears to be a bug in Borland C++ as explained here:
http://qc.borland.com/wc/qcmain.aspx?d=55346

but I suggest you to move this question the the Borland C++ Topic, you have specified Visual C++.NET
0
 
luisanazAuthor Commented:
How can I move the question?
0
 
Jaime OlivaresSoftware ArchitectCommented:
the question has been moved.
0
 
kode99Commented:
DFM files contain the information that is used to draw a form.  So the settings for the components,  sizes and locations etc are in this file.  So you will not be able to compile a program without the needed DFM files.

You should probably do a search for the file,  hopefully it is just not in the right place and not actually missing.  Normally it would be in the same directory as the source code files.

You could also look for the backup version of the file which would be '<name>.~dfm'.  If you cannot find the original this file may be enough to get you going as it is revision prior to the last save.  Just take out the '~' and try it.  I would suggest making a backup of everything before you do this.



0
 
Jose ParrotGraphics ExpertCommented:
Hi,
You can create new DFM files, if you don't find them, as per kode99 directions.
A suggestion to do that follows.

1. Create a new project. By default, it begins with Unit1, showing Form1.
2. By looking at your original include file, say Unit1.h, you can discover what are the components of such Unit.
Lets imagine that your original Unit1.h is:

class TForm1 : public TForm
{
__published:      // IDE-managed Components
      TEdit *Edit1;
      TListBox *ListBox1;
      TButton *Button1;
      TButton *Button2;
      TEdit *Edit2;
      TEdit *Edit3;
      void __fastcall Button1Click(TObject *Sender);
      void __fastcall Button2Click(TObject *Sender);
private:      // User declarations
public:            // User declarations
      __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------

This include file tells us that Unit1 has the following components: three TEdit, two TButton and one TListBox.
3. Create, in your new Form1, these components, by clicking in the menus at the tabs Standard, Additional, etc. then in the Form. Arrange the layout as you think adequate for the application.
4. Rename the components (Form, buttons, Edits, etc.) to have the same names of your original Unit1.h file, if they are different to the default names. You should rename them in the Object Inspector, in the Name property, not directly in Unit1.h. Don't edit directly your new Unit1.h in the IDE-managed Components section.
5. Copy from original Unit1.cpp  code into the new Unit1.cpp of your project. In my example: the code for
void __fastcall TForm1::Button1Click(TObject *Sender), and so on.
6. Repeat such procedure for each Unit.

That way, you have the same .cpp files, almost the same .h files and new .dfm files.
Of course, your job will be easy if the original code maintains default names and the application has few components.

Don't forget to save each file you create to reuse it in case of wrong coding.

Hope this helps...

Jose
0
 
kode99Commented:
Really hope there is a backup copy of the dfm in question somewhere.  Even a copy that is several revisions old would probably be much easier to start from.

If you have a exe file of the project you can use a resource editor to get  the dfm information out of it.  Here is a free open source editor written in Delphi,  

http://www.wilsonc.demon.co.uk/d10resourceeditor.htm

Porbably worth a try before reverse engineering the dfm by hand,  that can be pretty tedious.  If there were complex components involved it may take quite a bit of work to get it right.  A simple form with basic controls like edits and buttons would be quick to do though.


0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now