Форум программистов, компьютерный форум CyberForum.ru

Ошибка `undefined reference to` - C++

Войти
Регистрация
Восстановить пароль
Другие темы раздела
C++ Найти количество элементов значение которых превышает среднее арифметическое всех элементов http://www.cyberforum.ru/cpp-beginners/thread775106.html
дан целочисленный массив из n элементов. Найти количество элементов значение которых превышает среднее арифметическое всех элементов Давайте темам осмысленные названия!
C++ Добавить строку в конец массива как добавить строку в конец массива string str (без использования list, векторов) ? http://www.cyberforum.ru/cpp-beginners/thread775092.html
C++ Система уравнений
Доброе утро! Помогите решить задание.
Как удалить все файлы в папке без WinAPI ? C++
Ну собственно дубль шапки: Как удалить все файлы в папке без WinAPI ? Тоесть на чистом C++ без BOOST, QT и пр и не на последнем стандарте, тоесть на 10-й студии?
C++ Консультация. Создать две подпрограммы. Массивы http://www.cyberforum.ru/cpp-beginners/thread775054.html
Добрый день! Учусь на заочном, в основном осваиваю Си самостоятельно. В процессе изучения возникают вопросы. В данный момент пытаюсь решить задачку. Условие: Создать две подпрограммы, одна формирует массив, а вторая вычисляет сумму компонентов массива, которые являются большими по значения заданного литера. Как я вижу решение: 1. Создать подпрограмму А. 2. Объявить массив....
C++ Найти максимальный элемент в массиве и подсчитать количество Найти максимальный по модулю элемент в массиве и подсчитать количество элементов, больших, чем полученное значение: include <iostream> include <cstring> using namespace std; int main() { int n, i, l; подробнее

Показать сообщение отдельно
-=ЮрА=-
Заблокирован
Автор FAQ
30.01.2013, 16:42     Ошибка `undefined reference to`
Ну и как говорят в одессе : "Ну и шо вы хотите с этим делать?"
Проеккт собирается ном, сам его код вот
miniaiff.h
Кликните здесь для просмотра всего текста
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
/*
 
    MiniAiff
    (c) 2003-2012 Stephan M. Bernsee
    [url]http://www.dspdimension.com[/url]
    
    Version 2.1.0
    11.06.2012
    
    Abstract: This is a super-mini implementation of AIFF file read and write functionality.
    The routines provided read sample data from an AIFF file and write sample data to another
    AIFF file. You don't have to worry about *anything*, these routines are as simple as they
    can be.
    
    All routines provided here are inherently cross-platform and are provided as MacOS X Universal
    Binaty and Windows 32 MSVC 6 static library calls.
    
    They provide a basis on which you can quickly test audio stuff, and functionality with
    which you can dump any data you choose to generate into an audio file. Be careful though
    when you are listening to data that have nothing to do with audio - they may harm your 
    ears and speakers if you listen to them at high volumes.
    
    Supports reading from all AIFF file formats (no compression).
    
    Below are the function prototypes and an explanation
 
 
 
    Version History:
    ===============
 
    Version 2.1.0
    11.06.2012
 
    Fixed issue with 24 bit files under 32 bit OS's
    Cleaned up interface & data types
 
 
    Version 2.0.2
    22.06.2011
 
    Removed static structs that would cause MT problems
 
 
    Version 2.0.1
    26.05.2009
 
    Removed inconsistencies in the API
 
 
    Version 2.0.0
    23.05.2009
 
    Got rid of calls to system specific file selection dialogs
    Changed the calls to be ANSI C compatible
    Fixed tons of bugs
 
    Version 1.5.0
    26.04.2005
    
    Added libMiniAiffLib.a (MiniAiff Xcode Carbon library). Made some minor changes and
    fixes.
 
 
    Version 1.4.0
    02.11.2003
    
    Added multi-channel support for mAiffReadData(). Added mAiffGetFilename() and
    mAiffPutFilename() on all supported platforms to overcome the need for nasty filename
    extraction on the Mac and to streamline operation. Make sure you include the COMdlg32.lib
    in your project when compiling for Windows, otherwise you will get a link error.
 
 
    Version 1.3.0
    18.08.2003
    
    Added mAiffAddData(). Very cool for doing OLA-type DSP algorithms because you can do it
    without all the output buffer bookkeeping.
 
 
    Version 1.2.2
    08.06.2003
    
    Fixed a bug evident when reading from 24bit files. Added new set of routines to support
    getting more information from a sound file (mAiffGetLowKey, mAiffGetHighKey, mAiffGetRootKey
    mAiffGetGain, mAiffGetDetune). These routines require an Instrument chunk being present
    in the file.
 
 
    Version 1.2.1
    04.06.2003
    
    Extended error checking for read and write routines.
 
 
    Version 1.2.0
    03.06.2003
    
    mAiffReadAppData() and mAiffWriteAppData() now correctly identify the MiniAiff application
    signature when reading or writing application specific data,
 
 
    Version 1.1.0
    23.05.2003
    
    Included support for sample rates other than 44.1kHz and for reading 8, 24 and 32 bit
    Files, mono and stereo. Included routines to analyze the format and return information.
    numFrames is no longer limited to a specific value.
 
 
    Version 1.0.0
    18.05.2003
    
    First release: Only 16bit, 44.1kHz, mono, uncompressed AIFF files are supported.
    For all numFrames variables, a maximum of 16384 frames are supported.
    
 
 
    Here is a list of return error codes:
    ====================================
 
    0,          // no error encountered during processing
    -1,         // processing is done
    -2,         // processing was cancelled
    -3,         // file structure is bad (wrong file type or format unsupported
    -4,         // error during read()
    -5,         // error during write()
    -6,         // internal error
    -7,         // Sample rate needs to be 44.1kHz
    -8,         // Only 16bit files are supported
    -9,         // Only mono files are supported
    -10,        // No data to process
    -108,       // Out of memory
 
 
 
*/
 
 
 
#ifdef __cplusplus
extern "C" {
#endif
    
 
//  -----------------------------------------------------------------------------------------
//  Returns a pointer to a string containing the current library version
//
const char *mAiffGetVersion(void);
//  -----------------------------------------------------------------------------------------
    
    
//  -----------------------------------------------------------------------------------------
//  Allocates an empty audio buffer to hold numChannels channels and numFrames frames
//  float audioBuffer[numChannels][numFrames]
//
float **mAiffAllocateAudioBuffer(int numChannels, int numFrames);
//  -----------------------------------------------------------------------------------------
    
    
//  -----------------------------------------------------------------------------------------
//  Destroys an audio buffer
//
void mAiffDeallocateAudioBuffer(float **audio, int numChannels);
//  -----------------------------------------------------------------------------------------
    
 
//  -----------------------------------------------------------------------------------------
//  Reads data from the position "startFrame" in the AIFF file specified in *filename,
//  either for numChannels channels or a single channel, 
//  converts it to the range [-1.0, +1.0) and returns it as float in data[0...numChannels][0...numFrames-1].
//  If an error occurs, mAiffReadData() returns a negative error code. If all
//  goes well, mAiffReadData() returns the number of frames actually read. If it returns
//  with 0, the end of the file has been reached or exceeded by your request.
//  If there are fewer channels in the file than you have requested in numChannels, the unused channel
//  data is set to zero. data[][] needs its first dimension to be numChannels elements
//
int mAiffReadData(char *filename, float **data, unsigned long startFrame, int numFrames, int numChannels);
int mAiffReadDataFromChannel(char *filename, float *data, unsigned long startFrame, int numFrames, int channel);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Opens and clears a new file for writing. If you do not call this function prior to writing
//  to an audio file with mAiffWriteData(), the data you write will be appended to the file.
//  If the file does not exist and you do not call mAiffInitFile() prior to calling mAiffWriteData()
//  writing to the file will fail.
//
int mAiffInitFile(char *filename, float sampleRate, int sampleSize, int numChannels);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Appends the data in data[0...numFrames-1] to the audio file specified with *filename.
//  If it completes successfully, it returns the actual number of frames appended to the file.
//  If it fails, it returns an error code.
//
int mAiffWriteData(char *filename, float **data, int numFrames, int numChannels);
//  -----------------------------------------------------------------------------------------
 
 
 
//  -----------------------------------------------------------------------------------------
//  Returns the number of sample frames contained in the specified file.
//  If it fails, it returns an error code.
//
int mAiffGetNumberOfFrames(char *filename);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Returns the number of audio channels contained in the specified file.
//  If it fails, it returns an error code.
//
int mAiffGetNumberOfChannels(char *filename);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Returns the wordlength of the audio data contained in the specified file. Possible
//  wordlengths are 8bit, 16bit, 24bit and 32bit.
//  If it fails, it returns an error code.
//
int mAiffGetWordlength(char *filename);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Returns the sample rate of the audio data contained in the specified file. Although
//  MiniAiff reads all sample rates, the files written will all be 44.1kHz at the moment.
//  If your original sound file wasn't recorded at 44.1kHz, you will experience a change
//  in pitch of your audio material.
//  If it fails, it returns an error code.
//
int mAiffGetSampleRate(char *filename);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Writes a chunk of data to an AIFF file's application specific chunk (APPL). No byte
//  reversing is carried out - this is rather experimental and should only be used if you know
//  what you're doing. It is great for saving settings or other stuff to a file.
//  An existing file with the same name will be overwritten.
//  Only one chunk of appspecific data per file is supported - each call to this function
//  initializes the file.
//  If it fails, it returns an error code.
//
int mAiffWriteAppData(char *filename, void *data, int numBytes);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Reads a chunk of data from an AIFF file's application specific chunk (APPL). No byte
//  reversing is carried out - this is rather experimental and should only be used if you know
//  what you're doing. It is great for loading settings or other stuff from a file.
//  If it fails, it returns an error code.
//
int mAiffReadAppData(char *filename, void *data, unsigned long start, int numBytes);
//  -----------------------------------------------------------------------------------------
 
 
//  -----------------------------------------------------------------------------------------
//  Return the specified information from an AIFF files' instrument chunk. If an error
//  occurs, an error code (s.a.) is returned. If no instrument chunk is present, the routines
//  return 0
//
int mAiffGetLowKey(char *filename);
int mAiffGetHighKey(char *filename);
int mAiffGetRootKey(char *filename);
int mAiffGetGain(char *filename);
int mAiffGetDetune(char *filename);
//  -----------------------------------------------------------------------------------------
 
 
#ifdef __cplusplus
}
#endif

Кликните здесь для просмотра всего текста
MiniAiffDemo.cpp
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <stdio.h>
#include <stdlib.h>
#include "MiniAiff.h"
 
 
#define CHUNK_SIZE 8192
 
int main(void)
{
    int ret = 0;
 
#ifdef MAC_VERSION
    char inFileName[] = "../../blerp.aiff";
#else
    char inFileName[] = "blerp.aiff";
#endif
    char outFileName[] = "out-blerp.aiff";
 
    printf("Running MiniAiff version %s\n(C) S.M.Bernsee - http://www.dspdimension.com\n\n", mAiffGetVersion());
 
    long channels = mAiffGetNumberOfChannels(inFileName);
    if (channels < 1) {
        printf("File is unreadable or missing, %s\n", inFileName);
        exit(-1);
    }
    float **data = mAiffAllocateAudioBuffer(channels, CHUNK_SIZE);;
 
    // Read from input file
    printf("Reading from input: %s\n", inFileName);
    ret = mAiffReadData(inFileName, data, 0, CHUNK_SIZE, channels);
    if (ret < 0) {
        printf("! Error reading input file %s - error #%d\n! Wrong format or filename\n", inFileName, ret);
        exit(-1);
    }
    printf("Done reading input file %s\n", inFileName);
 
    // Create output file
    long wordlength = mAiffGetWordlength(inFileName);
    float sampleRate = (float)mAiffGetSampleRate(inFileName);
    printf("Creating output (sampleRate = %f, wordlength = %d, channels = %d)\n", sampleRate, wordlength, channels);
    ret = mAiffInitFile(outFileName, sampleRate, wordlength, channels);
 
 
    // and write stuff to it
    printf("Writing to output: %s\n", outFileName);
    for (long c=0; c < 100; c++) {
        ret = mAiffWriteData(outFileName, data, CHUNK_SIZE, channels);
        printf("...%d written, returned %d\n", c, ret);
        if (ret < 0) {
            printf("! Error writing output file %s - error #%d\n! Wrong format or filename\n", outFileName, ret);
            break;
        }
        //      if (ret < 0) break; 
    }
 
    mAiffDeallocateAudioBuffer(data, channels);
 
    // That's all there is to it.
    printf("You're a cool dude now!\n");
    return 0;
}
Миниатюры
Ошибка `undefined reference to`   Ошибка `undefined reference to`  
 
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Рейтинг@Mail.ru