简体   繁体   English

如何在Windows中编译Gnu C

[英]How can I compile Gnu C in windows

Too those who know how, this may be a stupid question, but I'll be asking it anyway because I need some pointers. 对那些知道如何的人来说,这可能是一个愚蠢的问题,但是无论如何我都会问这个问题,因为我需要一些指针。

The library I'm trying to compile is the SPro toolkit for speech signal processing which is written in (for lack of a better description) Gnu C++ 我正在尝试编译的库是用于语音信号处理的SPro工具包,它是用Gnu C ++编写的(出于缺乏更好的描述)

It's a library written for unix and I want to compile it in windows. 这是为Unix编写的库,我想在Windows中进行编译。 As much as an object exercise in porting code from, as anything. 尽可能多地利用对象来移植代码。

Toward that end I have installed code::blocks and a MinGW compiler. 为此,我安装了code :: blocks和MinGW编译器。 I read that I could also use cgywn and that this would be introducing a layer interpreting the gnu c before executing it natively, but let me leave that to the side for the moment. 我读到我也可以使用cgywn,这将在本地执行gnu c之前引入一个解释gnu c的层,但现在让我将其放在一边。

The first issue I ran into was that the #includes need a little love - ok no problem with that. 我遇到的第一个问题是#include需要一点爱-没关系。

But now I find that 但是现在我发现

scopy.c|462|error: 'SIZEOF_SHORT' undeclared (first use in this function)|

I also installed visual Studio C++ and get the same. 我还安装了Visual Studio C ++并获得了相同的结果。

I gather that SIZEOF_CHAR, SIZEOF_SHORT, SIZEOF_LONG, SIZEOF_FLOAT and SIZEOF_DOUBLE would be declared, in a header or somewhere. 我收集到将在标头或某处声明SIZEOF_CHAR,SIZEOF_SHORT,SIZEOF_LONG,SIZEOF_FLOAT和SIZEOF_DOUBLE。

Unfortunalty I don't have any idea where, so have no idea what to include to have access to the definitions. 不幸的是,我不知道在哪里,所以也不知道要包含哪些内容才能访问这些定义。

What should I include? 我应该包括什么?

Do I need to define these constants myself as I am in a different environment? 我是否在其他环境中需要自己定义这些常量?

Also I may be barking up the wrong tree, any help is appreciated. 另外,我可能在错误的树上吠叫,我们将不胜感激。

#define SIZEOF_SHORT sizeof(short)
#define SIZEOF_CHAR sizeof(char)

Repeat for all other types. 对所有其他类型重复此操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 GNU g++ 仅编译标准 C++? - How can I compile only standard C++ with GNU g++? 如何获取我的makefile来编译/链接旧的和较新的GCC / GNU库? C ++ - How can I get my makefile to compile/link older and newer GCC/GNU libraries? C++ 如何在Windows上为ARM编译C ++库 - How can i compile a c++ library for ARM on windows 静态构建Qt之后,我无法在Windows 7上编译/链接应用程序(GNU分配器错误) - After building Qt statically, I can't get to compile / link an application on Windows 7 (GNU allocator error) 如何为 Windows 编译 lsqlite3? - How can I compile lsqlite3 for Windows? 如何在Windows平台上的PHP中编译C / C ++代码? - How can I compile C/C++ code in PHP on the Windows platform? 我在 Windows 上构建了一个 C++ 程序,如何为 MacOS 编译可执行文件? - I built a C++ program on Windows, how can I compile an executable for MacOS? 我如何用openmp编译C ++? (在Windows 10中使用g ++) - How can i compile c++ with openmp? (using g++ in windows 10) 我如何在(64位)Windows上编译c ++以制作64位exe? - How can I compile c++ on (64bit) windows to make a 64bit exe? 如何创建单个 vim 正则表达式 map 来编译和运行 c++ 程序在 Z0F4137ED1502B58545D6083AA2 中 - How can I Create single vim regular expression map to compile and run c++ program in windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM