如何安装在Windows的C套餐 [英] How do I install C packages on windows

查看:93
本文介绍了如何安装在Windows的C套餐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须使用LU分解方法在C,以适应一个简单的模型的一些数据(模拟)什么,我需要做的是<一个例子href=\"http://stackoverflow.com/questions/3519959/computing-the-inverse-of-a-matrix-using-lapack-in-c\">here:

I have to use LU decompostion to fit a simple model to some data (simulated) in C. An example of what I need to do is here:

不过,我坚持一个更为基本的问题:我怎么用C安装软件包,并呼吁他们在我的code

However, I'm stuck with a more basic problem: how do I install packages in C and call them in my code?

我用C新我已经习惯了R.但是我有这个assingment做一下矩阵求逆,LU解耦,并教授一些测试使用LAPACK易事(这样的建议,我不需要code自己的LU分解等)。但我不知道如何安装包,并把它在我的code,以便使用LAPACK的功能。

I'm new in C and I'm used to R. But I have this assingment to do some tests about Matrix inversion, LU decomposision and the professor suggested using Lapack to easy things (thus, I don't need to code myself the LU decomposition etc.). But I don't know how to install the package and call it in my code, in order to use the functions of LAPACK.

我有一个Windows 7 64位,我使用的编译器code块8.02

I have a windows 7 64 bits and I'm using compiler Code Blocks 8.02

感谢您的帮助。

推荐答案

通常你不安装在这个意义上C库。通常情况下,在Windows中你有三种类型的文件。头文件,通常在.H结束,动态库和.dll,最有可能的一些链接文件(通常,.LIB,某或东西)。链接器和编译器将需要能够在某个地方找到这些文件。通常你设置包括目录路径和库目录路径。

Normally you don't "install" C libraries in that sense. Normally, in Windows you have three types of files. The header files, typically ending in .h, the dynamic library, .dll, and most likely some linker files (typically, .lib, .a or something). The linker and compiler will need to be able to find these files somewhere. Normally you set the include directory paths, and library directory paths.

例如。比方说,你下载了一个名为foo库,并且你它解压到C:\\富。
在该文件夹, libfoo.a中 foo.dll foo.h中居住。在code :: Blocks的你将有指向包括目录路径C:C \\富和库路径:\\富,以便链接器和编译器知道去哪里找这些文件。既然你链接到的foo的库,还必须设置 -lfoo 或类似的东西在链接器命令行。这是GCC的语法,但我认为,code :: Blocks的在后台使用GCC编译器反正。

E.g. Let's say you downloaded a library called foo, and you extract it to C:\foo. In that folder, libfoo.a, foo.dll and foo.h reside. In Code::Blocks you will have to point include directory path to C:\foo and library path to C:\foo so that the linker and compiler know where to look for these files. Since you're linking against the foo library, you will also have to set -lfoo or something similiar in linker command line. This is GCC syntax, but I think Code::Blocks uses GCC compiler behind the scenes anyways.

在C code,可刚的#include&LT; foo.h中方式&gt; ,编译器会帮您找到它。

In the C code you can just #include <foo.h> and the compiler will find it for you.

这篇关于如何安装在Windows的C套餐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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