Link Error - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Link Error

p3aulp3aul Posts: 5Member
I create a program in Delphi and got it to work fine. I ported it over to C++ Builder and after the usual quirks and glitches, I got it past the compiler with no errors, but then I got this link error:

[ILINK32 Error] Fatal: Unable to open file ''
No hint as to which file failed to open!
Here are the includes:

[code][color=Red]#include
#pragma hdrstop

#include "Unit1.h"
#include
#include [/color][/code]
Any help will surely be appreciated!
Paul

Comments

  • LundinLundin Posts: 3,711Member
    Why are you including vcl.h twice?

    Also, C++ standard requires the syntax

    #include
    using namespace std;
  • p3aulp3aul Posts: 5Member
    : Why are you including vcl.h twice?
    :
    : Also, C++ standard requires the syntax
    :
    : #include
    : using namespace std;
    I didn't see that. I'm using Codegear RAD Studio and it put in in by default. I didn't know about the using namespace std.

  • p3aulp3aul Posts: 5Member
    Well I still don't what the problem is. I put the same code in an old copy of C++ Builder 3 that I had and it works just fine!

    : Why are you including vcl.h twice?
    :
    : Also, C++ standard requires the syntax
    :
    : #include
    : using namespace std;

  • luckyboyluckyboy Posts: 105Member
    I know it is a very bad idea
    could you uninstall C++Builder, restart windows, reinstall it.
    you have to do that only if you can't compile your program right after widows restart

    also, i always use math.h, it works fine, i believe it is not the cause;

  • LundinLundin Posts: 3,711Member
    With the information provided, it is impossible to tell, really. Double includes of vcl.h seem fishy, if Borland didn't include header guards in that h-file, you would get linker errors. But I doubt they do such newbie errors in their library files.

    math.h is not the cause, I just pointed out that it was incorrect C++ syntax. It works just because Borland added non-standard compiler extensions. Borland in particular are infamous for their historically poor support for standard C++ #include syntax, you had to use the old .h syntax til they finally fixed it somewhere around Builder vers 3 and 4. They still support the non-standard syntax though.
  • luckyboyluckyboy Posts: 105Member
    : math.h is not the cause, I just pointed out that it was incorrect
    : C++ syntax. It works just because Borland added non-standard
    : compiler extensions. Borland in particular are infamous for their
    : historically poor support for standard C++ #include syntax, you had
    : to use the old .h syntax til they finally fixed it somewhere around
    : Builder vers 3 and 4. They still support the non-standard syntax
    : though.

    i didn't get the point, since the first version i worked with was CBuilder 6.0 and the free one Borland 5.0 that supports OWL programming rather than VCL, and both of them supports C++ standard syntax as i think.
    any way you can include math.h, or cmath ---- iostream.h, or iostream
    all works fine, for Microsoft VC++ you can include conio.h but for borland you can include both conio.h, and conio
    i don't know the difference, but i think Borland introduced many files without .h to accommodate any style

    thanx for clarification about versions 3 and 4
    and i think including vcl.h twice is just a print mistake
    and yes Borland supports include gaurd headers, :-)
Sign In or Register to comment.