473,783 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

c/pascal compiler differences

Hi,

I think I understand now a bit better what the difference is between a c
compiler and a pascal compiler.

For example:

When compiling source code with a pascal compiler. The pascal compiler will
simply stop when it is missing an implementation for a procedure or
whatever.

The c compiler however will simply continue compiling even if the
implementation for the headers/prototypes are missing.

The c linker will then report a big list of link errors.

Both methods have benefits and drawbacks. The pascal compiler is more
simple... it allows one to simply proceed from error to error until it
completely compiles and links.

The drawback of the c compiler might be the suspended error reporting...
it's a bit wacky... since one can not jump to the location where the stuff
is missing ?

or maybe one can... it's a bit wacky...

Though I can clearly see a benefit for a c compiler since it simply compiles
even though the implementation is completely missing.

One could later even make different implementations and simple re-use the
already compiled stuff and link against it.

So one can end up linking different kind of stuff against the same compiled
C file.

I think this is correct though I never really tried it.

Are there any good examples where this C/link freedom is used ?

Does a pascal compiler have the same link freedom ? ( meaning prototype
available but implementation missing )

I think not... ?

Bye,
Skybuck.
Nov 14 '05
28 2279

"Nicolai Hansen" <ni*@aub.dk> wrote in message
news:d9******** *************** **@posting.goog le.com...
This will compile, this will generate an object file, but this will
not generate an executable. It will say something like "LINKER ERROR:
unsatisfied external "void MyMethod()" in file test.c".
At a later time you can then make a file test2.c


If you take a look at a project directory that contains a built project you
will note that each unit has a .dcu file. This is the "object" file for the
unit. Using the command line compiler one can compile a discreet Delphi
unit.
Nov 14 '05 #21

"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news3.tilbu1 .nb.home.nl...
The whole point ofcourse is that in C one doesn't need any link directives

?

And what, pray tell, is the reason for a MAKE file? At some point the linker
has to be told what units to link together. It doesn't matter if one is
writing C or Delphi. Or have you found a compiler that somehow divines a
programmer's intentions regarding separately compiled units?
Nov 14 '05 #22

"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:c1******** *******@news20. bellglobal.com. ..

"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg******** **@news3.tilbu1 .nb.home.nl...
The whole point ofcourse is that in C one doesn't need any link
directives ?

And what, pray tell, is the reason for a MAKE file? At some point the linker has to be told what units to link together. It doesn't matter if one is
writing C or Delphi. Or have you found a compiler that somehow divines a
programmer's intentions regarding separately compiled units?


Ok I was just screwing around with D8 libraries naturally D8 is a piece a
shit and nothing is working...

But now that I tried using a library in delphi I can see how it might work
in D7 :)

procedure blabla; external 'somefricking.d ll';
begin

blabla;

end;

This might actually compile and build in delphi

actually I am pretty sure lol..

But this simple because this is just a dll...

But euhmm with the link directive it might work as well...

But wtf are .obj files ? :)

Does that include C generated files ?

Or delphi generated DCU's ?

Can I link a DCU file as well ? just like that... with the external stuff ?

Seeya.

Nov 14 '05 #23

"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:rZ******** *******@news20. bellglobal.com. ..

"Nicolai Hansen" <ni*@aub.dk> wrote in message
news:d9******** *************** **@posting.goog le.com...
This will compile, this will generate an object file, but this will
not generate an executable. It will say something like "LINKER ERROR:
unsatisfied external "void MyMethod()" in file test.c".
At a later time you can then make a file test2.c
If you take a look at a project directory that contains a built project

you will note that each unit has a .dcu file. This is the "object" file for the unit. Using the command line compiler one can compile a discreet Delphi
unit.


Can delphi do this ?

Some fricking unit 1

function bleh : string;
begin
result := 'bleh';
end;
some fricking main pascal/delphi program

{$LINK 'some fricking unit1.dcu'}

function bleh; external; // ?

begin

writeln( bleh )
readln;
end;

???? :)

Bye,
Skybuck.
Nov 14 '05 #24
"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:rZ******** *******@news20. bellglobal.com. ..

"Nicolai Hansen" <ni*@aub.dk> wrote in message
news:d9******** *************** **@posting.goog le.com...
This will compile, this will generate an object file, but this will
not generate an executable. It will say something like "LINKER ERROR:
unsatisfied external "void MyMethod()" in file test.c".
At a later time you can then make a file test2.c
If you take a look at a project directory that contains a built project

you will note that each unit has a .dcu file. This is the "object" file for the unit. Using the command line compiler one can compile a discreet Delphi
unit.


Wait don't tell me one has to use USES for that ?

DOH

Fuck the link directive..

Why can't I simply use this:

Uses
SomeFrickingObj ect.OBJ :) hehehehe
Nov 14 '05 #25

"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:rZ******** *******@news20. bellglobal.com. ..

"Nicolai Hansen" <ni*@aub.dk> wrote in message
news:d9******** *************** **@posting.goog le.com...
This will compile, this will generate an object file, but this will
not generate an executable. It will say something like "LINKER ERROR:
unsatisfied external "void MyMethod()" in file test.c".
At a later time you can then make a file test2.c
If you take a look at a project directory that contains a built project

you will note that each unit has a .dcu file. This is the "object" file for the unit. Using the command line compiler one can compile a discreet Delphi
unit.


Really man the link directive is crazy...

All these years I have been programming high up in clouds lol.. hehehehehe

YESSSsssss

Never having to worry or know what it is that delphi does when I press the
build button...

And now suddenly I am confronted with a link directive !

FUCK :)

Shame on you borland for not abstracting that :D LOLOLOLOLOLOLO
Nov 14 '05 #26
Bruce Roberts wrote:
"Nicolai Hansen" <ni*@aub.dk> wrote in message
This will compile, this will generate an object file, but this
will not generate an executable. It will say something like
"LINKER ERROR: unsatisfied external "void MyMethod()" in file
test.c". At a later time you can then make a file test2.c


If you take a look at a project directory that contains a built
project you will note that each unit has a .dcu file. This is
the "object" file for the unit. Using the command line compiler
one can compile a discreet Delphi unit.


And what has this got to do with comp.lang.c? Please restrict the
cross-posting of things that are off-topic on some groups. All
you have to do is religiously set follow-ups, as I have done.

--
Chuck F (cb********@yah oo.com) (cb********@wor ldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home .att.net> USE worldnet address!
Nov 14 '05 #27


Skybuck Flying wrote:
"Bruce Roberts" <be*@bounceitat tcanada.xnet> wrote in message
news:c1******** *******@news20. bellglobal.com. ..
"Skybuck Flying" <no****@hotmail .com> wrote in message
news:cg****** ****@news3.tilb u1.nb.home.nl.. .

The whole point ofcourse is that in C one doesn't need any link


directives
?

And what, pray tell, is the reason for a MAKE file? At some point the


linker
has to be told what units to link together. It doesn't matter if one is
writing C or Delphi. Or have you found a compiler that somehow divines a
programmer' s intentions regarding separately compiled units?

Ok I was just screwing around with D8 libraries naturally D8 is a piece a
shit and nothing is working...

But now that I tried using a library in delphi I can see how it might work
in D7 :)

procedure blabla; external 'somefricking.d ll';
begin

blabla;

end;

This might actually compile and build in delphi

actually I am pretty sure lol..

But this simple because this is just a dll...

But euhmm with the link directive it might work as well...

But wtf are .obj files ? :)

Does that include C generated files ?

Or delphi generated DCU's ?

Can I link a DCU file as well ? just like that... with the external stuff ?

Seeya.


None of this stuff has anything to do with the C language. It is all
specific to the brand of compiler you are using (Microsoft or Borland).
"obj" files are compiled (but not linked) created by Microsoft
compilers; "dcu" files are compiled (but not linked) created by Borland
Delphi compilers.

You would get more usefull info by checking in a Microsoft and/or
Borland newsgroup.

--
Ron Collins
Air Defense/RTSC/BCS

Nov 14 '05 #28
"Skybuck Flying" <no****@hotmail .com> writes:
Why can't I simply use this:

Uses
SomeFrickingObj ect.OBJ :) hehehehe


Ask in a Delphi newsgroup but please keep comp.lang.c out of this.
The intricacies of Delphi are totally unrelated to C.

[-- Followups properly redirected --]
Nov 14 '05 #29

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4393
by: Chris Gordon-Smith | last post by:
I am tying to call a Pascal function from C++, and vice versa. Does anyone know how to do this, or where detailed information on this topic can be found? For the C++ to Pascal call I have tried declaring the Pascal function as:- extern "C" void PASCALTESTFUNC1(); within my C++ code. However, the linker is giving me an unresolved
4
2324
by: Hans-Marc Olsen | last post by:
C++ is only good for writing a compiler of a much superior language like Pascal. So use your C++ to write a PASCAL compiler or BASIC and use this.
14
23437
by: digital | last post by:
hello anyone... pls explain me , how different between function and procedure for C/C++ and Pascal. Thankx......
2
2165
by: gwlemyre | last post by:
I am not a PASCAL programmer and I saw this piece of code. procedure Expression; Forward; procedure Factor; begin if Look = '(' then begin Match('('); Expression; Match(')'); end
6
6913
by: kkrish | last post by:
hi, I am working on an old program written in c.The program uses a function like this "unsigned long int far pascal ReadFile(char *buff,unsigned long int *size)" . Is this a PASCAL function CALL from C?Do I need to have Pascal installed in my system.This has been written in Turbo C 2.0 under
5
3665
by: dhruba.bandopadhyay | last post by:
I am trying to port an old Pascal DOS game to DOS C/C++. I am wondering if anyone is familar with the dos & crt Pascal units and whether there are C/C++ equivalent libraries. Maybe dos.c & crt.c? Below lists names of variables, functions, types & weird interrupt procedures found in Pascal. Am wondering what can be done to get around them for use in C/C++. dos.pas crt.pas
41
18222
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
7
5971
by: SMALLp | last post by:
Hy! I desperately need help! I need to make application that would accept Pascal code and check if it returns good results. My idea is (from a beginner point of view) to make application in python that would send code (text) to pascal compiler (Free pascal compiler that can be used from command prompt in windows) and it would return result and then application would show that result.
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.