可以用C prgm调用用其他语言编写的程序 [英] Can v call procedures written in other languages from a C prgm

查看:73
本文介绍了可以用C prgm调用用其他语言编写的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

只是想知道,如果有IDE提供编译器,那么
语言如C,ADA,C ++等。可以调用程序用这些C prgms编写的
C ++或ADA中的
可能是由某些编译器指令告诉的,

这个程序不同编译器用于生成

..exe文件。

谢谢,

Shailu,

PS :据我所知,在Ada语言中有一个使用编译指示的选项,

这是编译器指令,它告诉使用C编译器我们

可以调用C程序来自Ada prgm。

Hello All,
Just wanted to know, if there is IDE which provides compilers for diff
languages like C, ADA, C++ etc. Can v call the procedures written in
C++ or ADA,
from these C prgms may be, by some compiler directives to tell, that
for this procedure a different compiler is to be used to produre the
..exe file.
thanks,
Shailu,
PS : As I know, in Ada language there is an option of using pragmas,
which are compiler directives, which tells to use C compiler and we
can call the C procedures from Ada prgm.

推荐答案

sh***********@sify.com 写道:
sh***********@sify.com writes:
只是想知道,如果有IDE为diff提供编译器/> C,ADA,C ++等语言。可以用这些C prgms来调用用C ++或ADA编写的程序,b一些编译器指令要告诉,对于这个过程,将使用不同的编译器来生成
.exe文件。
Just wanted to know, if there is IDE which provides compilers for diff
languages like C, ADA, C++ etc. Can v call the procedures written in
C++ or ADA,
from these C prgms may be, by some compiler directives to tell, that
for this procedure a different compiler is to be used to produre the
.exe file.




你的问题超出了comp.lang.c的范围,它只讨论了标准的C编程语言,包括标准的C / /
库。与人们期望的很多

相比,这是一个非常狭窄的话题。


为了您的方便,下面的列表包含的主题不是

on-topic for comp.lang.c,并建议您浏览新闻组

如果您对这些主题有疑问。在发布到任何这些新闻组之前,请务必遵守正确的
网络礼节。特别是,你应该阅读小组的章程和常见问题,如果有的话(常见问题是

来自 www.faqs.org 和其他来源)。如果那些人没有回答你的问题,那么你应该浏览至少两周

的近期文章,以确保你的问题还没有。

已被回答。


*特定于操作系统的问题,例如如何清除屏幕,

访问网络,列出目录中的文件,或者阅读

管道子进程的输出。这些问题应该是针对特定于操作系统的新闻组,例如

comp.os.ms-windows.programmer.misc,comp.unix.programmer或者

comp.os.linux.development.apps。


*编译器特有的问题,例如安装问题和

标题的位置文件。在

编译器特定的新闻组中询问这些,例如gnu.gcc.help或

comp.os.ms-windows.programmer.misc。有关编写

编译器的问题在comp.compilers中是合适的。


*特定于处理器的问题,例如关于

汇编的问题和机器代码。 x86问题适用于
comp.lang.asm.x86,嵌入式系统处理器问题可能适用于comp.arch.embedded中的


*特定于ABI的问题,例如如何将汇编

代码连接到C.这些问题都是处理器和

特定于操作系统的问题,通常应该是在特定操作系统中询问

新闻组。


*算法,除了有关

算法的C实现的问题。 如何在C中实现算法X?关于算法的C实现不是一个问题,它是一个

的源代码请求。新闻组comp.programming和

comp.theory可能是合适的。


*使C与其他语言互操作。对于这种互操作,C没有

设施。这些问题应该直接指向系统或编译器特定的新闻组。 C ++

具有与C互操作的功能,因此请考虑

comp.lang.c ++来解决这些问题。


* C标准,而不是标准C.关于

的问题C标准最好在comp.std.c中询问。


* C ++。请不要将有关C ++

的问题发布或交叉发布到comp.lang.c.在C ++新闻组中询问C ++问题,例如comp.lang.c ++或comp.lang.c ++。版本的



*测试帖子。请在一个用于测试的新闻组中进行测试,

,例如alt.test。


news.groups.questions是一个讨论适当的好地方

给定主题的新闻组。


-

如果不是新的C标准则不会给'静态'这个词一个新的含义

。"

- C99上的Peter Seebach



Your question is outside the domain of comp.lang.c, which discusses
only the standard C programming language, including the standard C
library. This is a remarkably narrow topic compared to what many
people expect.

For your convenience, the list below contains topics that are not
on-topic for comp.lang.c, and suggests newsgroups for you to explore
if you have questions about these topics. Please do observe proper
netiquette before posting to any of these newsgroups. In particular,
you should read the group''s charter and FAQ, if any (FAQs are
available from www.faqs.org and other sources). If those fail to
answer your question then you should browse through at least two weeks
of recent articles to make sure that your question has not already
been answered.

* OS-specific questions, such as how to clear the screen,
access the network, list the files in a directory, or read
"piped" output from a subprocess. These questions should be
directed to OS-specific newsgroups, such as
comp.os.ms-windows.programmer.misc, comp.unix.programmer, or
comp.os.linux.development.apps.

* Compiler-specific questions, such as installation issues and
locations of header files. Ask about these in
compiler-specific newsgroups, such as gnu.gcc.help or
comp.os.ms-windows.programmer.misc. Questions about writing
compilers are appropriate in comp.compilers.

* Processor-specific questions, such as questions about
assembly and machine code. x86 questions are appropriate in
comp.lang.asm.x86, embedded system processor questions may
be appropriate in comp.arch.embedded.

* ABI-specific questions, such as how to interface assembly
code to C. These questions are both processor- and
OS-specific and should typically be asked in OS-specific
newsgroups.

* Algorithms, except questions about C implementations of
algorithms. "How do I implement algorithm X in C?" is not a
question about a C implementation of an algorithm, it is a
request for source code. Newsgroups comp.programming and
comp.theory may be appropriate.

* Making C interoperate with other languages. C has no
facilities for such interoperation. These questions should
be directed to system- or compiler-specific newsgroups. C++
has features for interoperating with C, so consider
comp.lang.c++ for such questions.

* The C standard, as opposed to standard C. Questions about
the C standard are best asked in comp.std.c.

* C++. Please do not post or cross-post questions about C++
to comp.lang.c. Ask C++ questions in C++ newsgroups, such
as comp.lang.c++ or comp.lang.c++.moderated.

* Test posts. Please test in a newsgroup meant for testing,
such as alt.test.

news.groups.questions is a good place to ask about the appropriate
newsgroup for a given topic.

--
"It wouldn''t be a new C standard if it didn''t give a
new meaning to the word `static''."
--Peter Seebach on C99



" Ben Pfaff" < bl*@cs.stanford.edu>写了

"Ben Pfaff" <bl*@cs.stanford.edu> wrote
只是想知道,如果有IDE为C语言,ADA,C ++等语言提供编译器。可以调用写的程序在C ++或ADA中,从这些C prgms中可以通过一些编译器指令告诉,对于这个过程,将使用不同的编译器来生成
。 exe文件。
Just wanted to know, if there is IDE which provides compilers for diff
languages like C, ADA, C++ etc. Can v call the procedures written in
C++ or ADA,
from these C prgms may be, by some compiler directives to tell, that
for this procedure a different compiler is to be used to produre the
.exe file.



你的问题不在comp.lang.c的范围之内,它只讨论标准的C编程语言,包括标准的C
库。



Your question is outside the domain of comp.lang.c, which discusses
only the standard C programming language, including the standard C
library.



不,不是。有关如何调用函数的问题属于调用者的

组。因此,如果有人询问如何从Visual Basic调用一个C函数,那么

属于Visual Basic。如何调用用其他语言编写的函数
来自C的
属于这里。


不幸的是,答案并不是很好。这样做没有标准的

设施。然而,几乎每个平台都使用链接的目标文件构建

可执行文件,有时还有一种方法可以将另一种语言编译为C链接的.o或.obj文件。例如,大多数装配商

都会这样做。


No it isn''t. Questions about how to call a function belong in the caller''s
group. So if someone asks how to call a C function from Visual Basic that
belongs in Visual Basic. How to call functions written in other languages
from C belongs here.

Unfortunately there isn''t a very good answer. There are no standard
facilities for doing so. However virtually every platform builds the
executable out of linked object files, and sometimes there is a way of
compiling another language to a C linkable .o or .obj file. Most assemblers
will do this, for example.


Malcolm< ma ***** @ 55bank.freeserve.co.uk>潦草地写下:
Malcolm <ma*****@55bank.freeserve.co.uk> scribbled the following:
" Ben Pfaff" < bl*@cs.stanford.edu>写了
"Ben Pfaff" <bl*@cs.stanford.edu> wrote
>只是想知道,如果有IDE为diff提供编译器
>语言如C,ADA,C ++等。可以调用
>中写的程序。 C ++或ADA,
>从这些C prgms可能,通过一些编译器指令来告诉,
>对于此过程,将使用不同的编译器来生成
> .exe文件。
你的问题超出了comp.lang.c的范围,它只讨论标准的C编程语言,包括标准的C
库。
> Just wanted to know, if there is IDE which provides compilers for diff
> languages like C, ADA, C++ etc. Can v call the procedures written in
> C++ or ADA,
> from these C prgms may be, by some compiler directives to tell, that
> for this procedure a different compiler is to be used to produre the
> .exe file.
Your question is outside the domain of comp.lang.c, which discusses
only the standard C programming language, including the standard C
library.

组。因此,如果有人询问如何从Visual Basic中调用属于Visual Basic的C函数。如何调用用其他语言编写的函数来自C语言属于这里。


No it isn''t. Questions about how to call a function belong in the caller''s
group. So if someone asks how to call a C function from Visual Basic that
belongs in Visual Basic. How to call functions written in other languages
from C belongs here.



不幸的是,答案并不是很好。这样做没有标准的设施。然而,几乎每个平台都是从链接的目标文件构建
可执行文件,有时还有一种方法可以将另一种语言编译为C链接的.o或.obj文件。例如,大多数装配工都会这样做。


Unfortunately there isn''t a very good answer. There are no standard
facilities for doing so. However virtually every platform builds the
executable out of linked object files, and sometimes there is a way of
compiling another language to a C linkable .o or .obj file. Most assemblers
will do this, for example.




所以答案是这取决于实施,对吧?


-

/ - Joona Palaste(pa*****@cc.helsinki.fi)-------------芬兰 - ------- \

\ - http://www.helsinki.fi/~palaste ---------------------规则! -------- /

赚钱快!不要喂它!

- Anon



So the answer is "it depends on the implemenation", right?

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Make money fast! Don''t feed it!"
- Anon


这篇关于可以用C prgm调用用其他语言编写的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆