Solved

Liner Error

Posted on 2007-12-01
13
198 Views
Last Modified: 2013-11-17
I have the linker error: Unable to open name.DFM, I don´t knowwhat to do...anyone knows?
0
Comment
Question by:luisanaz
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
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
 

Author Comment

by:luisanaz
Comment Utility
I´m using C++ builder
0
 

Author Comment

by:luisanaz
Comment Utility
Is only read
0
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
you mean the dmf  file is readonly? maybe you can change it manually from the windows explorer.
0
 

Author Comment

by:luisanaz
Comment Utility
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
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
do you have a linker error at runtime? that sounds contradictory.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:luisanaz
Comment Utility
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
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
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
 

Author Comment

by:luisanaz
Comment Utility
How can I move the question?
0
 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
the question has been moved.
0
 
LVL 25

Assisted Solution

by:kode99
kode99 earned 200 total points
Comment Utility
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
 
LVL 18

Accepted Solution

by:
JoseParrot earned 300 total points
Comment Utility
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
 
LVL 25

Assisted Solution

by:kode99
kode99 earned 200 total points
Comment Utility
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

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now