Reply by Steven G. Johnson October 6, 20082008-10-06
On Oct 5, 9:56&#2013266080;am, "climatechange" <anamikasing...@yahoo.co.in> wrote:
> When i compile the test test_main.c in the tests folder of FFTW I get an > error saying > > adatta@imaa-caribou /usr/src/fftw-2.1.5/tests > $ g++ test_main.c
You need to link with the FFTW library (not to mention the other object files in the FFTW test suite) in order for this to work. Better yet, just use the Makefile supplied with FFTW -- running './ configure && make' will compile the test program for you. See also question 3.14 in the FFTW faq. This is all basic stuff about compiling and linking programs, not specific to FFTW and certainly not specific to DSP. If you have further questions, you should ask on a Unix programming newsgroup. Regards, Steven G. Johnson
Reply by Randy Yates October 5, 20082008-10-05
"climatechange" <anamikasingh85@yahoo.co.in> writes:

> Hi, > > When i compile the test test_main.c in the tests folder of FFTW I get an > error saying > > adatta@imaa-caribou /usr/src/fftw-2.1.5/tests > $ g++ test_main.c > [...]
Try using gcc (the C compiler) instead of g++ (the C++ compiler). -- % Randy Yates % "She's sweet on Wagner-I think she'd die for Beethoven. %% Fuquay-Varina, NC % She love the way Puccini lays down a tune, and %%% 919-577-9882 % Verdi's always creepin' from her room." %%%% <yates@ieee.org> % "Rockaria", *A New World Record*, ELO http://www.digitalsignallabs.com
Reply by climatechange October 5, 20082008-10-05
Hi,

When i compile the test test_main.c in the tests folder of FFTW I get an
error saying

adatta@imaa-caribou /usr/src/fftw-2.1.5/tests
$ g++ test_main.c
test_main.c:25:22: fftw-int.h: No such file or directory
In file included from test_main.c:33:
test_main.h:87: warning: `compute_error_complex' initialized and declared
`exter
n'
test_main.h:87: error: `fftw_complex' was not declared in this scope
test_main.h:87: error: `A' was not declared in this scope
test_main.h:87: error: expected primary-expression before "int"
test_main.h:88: error: `fftw_complex' was not declared in this scope
test_main.h:88: error: `B' was not declared in this scope
test_main.h:88: error: expected primary-expression before "int"
test_main.h:88: error: expected primary-expression before "int"
test_main.h:88: error: initializer expression list treated as compound
expressio
n
test_main.h:90: error: `fftw_direction' does not name a type
test_main.h:94: error: `fftw_direction' has not been declared
test_main.h:94: error: ISO C++ forbids declaration of `dir' with no type
test_main.h:95: error: `fftw_direction' has not been declared
test_main.h:96: error: ISO C++ forbids declaration of `dir' with no type
test_main.h:98: error: `fftw_direction' has not been declared
test_main.h:99: error: ISO C++ forbids declaration of `dir' with no type
test_main.c: In function `size parse_size(char*)':
test_main.c:74: error: `fftw_die' undeclared (first use this function)
test_main.c:74: error: (Each undeclared identifier is reported only once
for eac
h function it appears in.)
test_main.c: At global scope:
test_main.c:103: error: `FFTW_ESTIMATE' was not declared in this scope
test_main.c:104: error: `FFTW_MEASURE' was not declared in this scope
test_main.c: In function `void test_speed(int)':
test_main.c:226: error: `FFTW_FORWARD' undeclared (first use this
function)
test_main.c:231: error: `FFTW_IN_PLACE' undeclared (first use this
function)
test_main.c:236: error: `FFTW_BACKWARD' undeclared (first use this
function)
test_main.c: In function `void test_speed_nd(size)':
test_main.c:269: error: `FFTW_FORWARD' undeclared (first use this
function)
test_main.c:270: error: `FFTW_IN_PLACE' undeclared (first use this
function)
test_main.c:276: error: `FFTW_BACKWARD' undeclared (first use this
function)
test_main.c: At global scope:
test_main.c:293: error: redefinition of `double compute_error_complex'
test_main.h:87: error: `double compute_error_complex' previously defined
here
test_main.c:293: error: `fftw_complex' was not declared in this scope
test_main.c:293: error: `A' was not declared in this scope
test_main.c:293: error: expected primary-expression before "int"
test_main.c:294: error: `fftw_complex' was not declared in this scope
test_main.c:294: error: `B' was not declared in this scope
test_main.c:294: error: expected primary-expression before "int"
test_main.c:294: error: expected primary-expression before "int"
test_main.c:295: error: expected `,' or `;' before '{' token
test_main.c: In function `void test_all()':
test_main.c:329: error: `FFTW_USE_WISDOM' undeclared (first use this
function)
test_main.c:330: error: `fftw_check_memory_leaks' undeclared (first use
this fun
ction)
test_main.c: In function `void testnd_correctness_both(size, int, int,
int)':
test_main.c:408: error: `FFTW_FORWARD' undeclared (first use this
function)
test_main.c:409: error: `FFTW_BACKWARD' undeclared (first use this
function)
test_main.c: At global scope:
test_main.c:489: error: `fftw_direction' does not name a type
test_main.c: In function `void test_timer_paranoid()':
test_main.c:517: error: `fftw_time' undeclared (first use this function)
test_main.c:517: error: expected `;' before "start_t"
test_main.c:521: error: `start_t' undeclared (first use this function)
test_main.c:521: error: `fftw_get_time' undeclared (first use this
function)
test_main.c:527: error: `end_t' undeclared (first use this function)
test_main.c:528: error: `fftw_time_diff' undeclared (first use this
function)
test_main.c:528: error: `fftw_time_to_sec' undeclared (first use this
function)
test_main.c: In function `void test_timer()':
test_main.c:552: error: `fftw_time' undeclared (first use this function)
test_main.c:552: error: expected `;' before "begin"
test_main.c:559: error: `start' undeclared (first use this function)
test_main.c:559: error: `fftw_get_time' undeclared (first use this
function)
test_main.c:566: error: `FFTW_TIME_REPEAT' undeclared (first use this
function)
test_main.c:567: error: `begin' undeclared (first use this function)
test_main.c:571: error: `end' undeclared (first use this function)
test_main.c:573: error: `fftw_time_diff' undeclared (first use this
function)
test_main.c:573: error: `fftw_time_to_sec' undeclared (first use this
function)
test_main.c:581: error: `FFTW_TIME_LIMIT' undeclared (first use this
function)
test_main.c:637: error: `FFTW_TIME_MIN' undeclared (first use this
function)
test_main.c: In function `void handle_option(char, char*)':
test_main.c:748: error: `fftw_die' undeclared (first use this function)
test_main.c:753: error: `FFTW_MEASURE' undeclared (first use this
function)
test_main.c:757: error: `FFTW_ESTIMATE' undeclared (first use this
function)
test_main.c:761: error: `FFTW_NO_VECTOR_RECURSE' undeclared (first use
this func
tion)
test_main.c:765: error: `FFTW_USE_WISDOM' undeclared (first use this
function)
test_main.c:772: error: `FFTW_SUCCESS' undeclared (first use this
function)
test_main.c:772: error: `fftw_import_wisdom_from_file' undeclared (first
use thi
s function)
test_main.c:787: error: `fftw_version' undeclared (first use this
function)
test_main.c:790: error: `fftw_real' undeclared (first use this function)
test_main.c:820: error: `fftw_check_memory_leaks' undeclared (first use
this fun
ction)
test_main.c: In function `int main(int, char**)':
test_main.c:990: error: `FFTW_USE_WISDOM' undeclared (first use this
function)
test_main.c:994: error: `fftw_export_wisdom_to_string' undeclared (first
use thi
s function)
test_main.c:995: error: `fftw_die' undeclared (first use this function)
test_main.c:997: error: `fftw_forget_wisdom' undeclared (first use this
function
)
test_main.c:998: error: `FFTW_SUCCESS' undeclared (first use this
function)
test_main.c:998: error: `fftw_import_wisdom_from_string' undeclared (first
use t
his function)
test_main.c:1000: error: `fftw_free' undeclared (first use this function)
test_main.c:1005: error: `fftw_export_wisdom_to_file' undeclared (first
use this
 function)
test_main.c:1012: error: `fftw_check_memory_leaks' undeclared (first use
this fu
nction)
test_main.c:1014: error: `fftw_print_max_memory_usage' undeclared (first
use thi
s function)
fftw-int.h is unedr fftw folder. I am not sure what is wrong.

Can anyone please take a look and help?

Regards
Ana