473,386 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Debugging code

Hi! New to the forum, wondering if anyone could help me?

I'm getting this error when trying to compiler the following code on Cygwin...

header.h:14: warning declaration does not declare anything
header.h:14 warning: no semi-colon at end of struct or union
header.h:14 error: parse error before '[' token
header.h:16 parse error before '}' token for the following lines of code:

12 typedef struct
13 {
14 char[BUFSIZE] filename;
15 long size;
16 } FINDFILE;

I'm running -std=c99 -Wall and -Werror

Any thoughts???
xxsKoot
Nov 24 '06 #1
7 1880
Banfa
9,065 Expert Mod 8TB
char[BUFSIZE] filename;

should be

char filename[BUFSIZE];
Nov 24 '06 #2
DOH! *slap*

ok next question: what is the makefile file extension?? (mak??) notepad seems to be saving it as Makefile.mak.txt... i've tried Makefile.txt and Makefile.exe... are these Make commands ok:

C99 = gcc -std=c99
FLAGS = -Wall -Werror -pedantic

mp3search.exe : mp3search.o globals.o fucts.o
$(C99) $(FLAGS) -o mp3search.exe mp3search.o globals.o fucts.o

mp3search.o : mp3search.c header.h
$(C99) $(FLAGS) -c -o mp3search.o mp3search.c

globals.o : globals.c header.h
$(C99) $(FLAGS) -c -o globals.o globals.c

fucts.o : fucts.c header.h
$(C99) $(FLAGS) -c -o fucts.o fucts.c
Nov 25 '06 #3
Banfa
9,065 Expert Mod 8TB
ok next question: what is the makefile file extension?? (mak??) notepad seems to be saving it as Makefile.mak.txt... i've tried Makefile.txt and Makefile.exe... are these Make commands ok:
Actually anything you want to use but *.mak and *.mk are common, makefile. (i.e. no extension) is also common.

In notepad you need to switch the file type to all files before saving otherwise notepad adds a .txt

C99 = gcc -std=c99
FLAGS = -Wall -Werror -pedantic

mp3search.exe : mp3search.o globals.o fucts.o
$(C99) $(FLAGS) -o mp3search.exe mp3search.o globals.o fucts.o

mp3search.o : mp3search.c header.h
$(C99) $(FLAGS) -c -o mp3search.o mp3search.c

globals.o : globals.c header.h
$(C99) $(FLAGS) -c -o globals.o globals.c

fucts.o : fucts.c header.h
$(C99) $(FLAGS) -c -o fucts.o fucts.c
these look ok to me.
Nov 25 '06 #4
thanks, how about this one:


DIR *dirp1;
struct dirent *dp1;

dirp1 = opendir(searchStart);

then there is a perror check which is returning NULL, even though the same directory pathway(searchStart) is opening fine in another file...
Nov 25 '06 #5
Scratch that (too late to edit)

what does opendir: too many open files mean?? that I've run out of memory to store file pointers??
Nov 25 '06 #6
Okay, opendir is throwing the error because the for(dp1 = readdir(dirp1) ; ...) statement only seems to be reading the first file ("."). I've got an if-then-continue statement in, yet it doesnt seem to read past this point...

Any thoughts?
Nov 25 '06 #7
Banfa
9,065 Expert Mod 8TB
You realise that the readdir statement is in the initialisation expression and is therefore on executed once before the loop starts running?

To read all the dirs I guess (because I can't see your code) that you will be needing to call readdir for every iteration of the loop.
Nov 25 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Dmitri Shvetsov | last post by:
Hi All, Did somebody see the situation when the VS refuses to debug the Web Service at all? I can't catch why, the initially created Web Service can be debugged very easy but after some changes...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
8
by: razael1 | last post by:
I am putting debugging messages into my program by putting blocks that look like this: #ifdef DEBUG errlog << "Here is some information"; #endif All these #ifdef blocks make the code bulky and...
5
by: phnimx | last post by:
Hi , We have developed a number of plug-in .NET Library Components that we typically deploy with our various applications by installing them into the GAC. Each of the applications contains an...
5
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
2
jwwicks
by: jwwicks | last post by:
C/C++ Programs and Debugging in Linux This tutorial will give you a basic idea how to debug a program in Linux using GDB. As you are aware Visual Studio doesn’t run on Linux so you have to use...
33
by: fmassei | last post by:
Hello! I made a short piece of code that I find very useful for debugging, and I wanted to ask you if it is correct, somehow acceptable or if I simply reinvented the wheel. To deal with some bad...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.