okay so here's the little piece of code that would be useful in a sudoku program that i'm making...
this function leftover is simply extracting the set minus of two arrays. i don't know if logic's been having any problem but i think its pretty simple clear.
oh, and i'm using dev c++
and this is c++ code, not c

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
	 int all[9]={1,2,3,4,5,6,7,8,9},alf[4]={1,4,7,6},lo[9]; 

/*initialized alf too just to see if lo gets filled with the leftover 6 nos from the all, ie with nos other than 1,4,7,6*/


	 int i=0,j=0,k=0,p=0;




/*so basically lo = all=alf; then i would randomly pick an element from lo to fill the individual cell....ok that all was short story to give some intro to my problem, and what i'm doing here and why*/


	 while(j<9)
	 {i=0;          k=0;
	 while(k<4)
	 {
           if(alf[k]!=all[j])
	   {
	   i++;
	   }
	   k++;
	 }  //end of inner while

if(i==4)
{
		  lo[p]=all[j];  //storing element not already present in leftover array
		  p++;
}
j++;
}//end of outer while

int g=0;

while(g<p)
{
cout<<lo[g]<<endl; //to just see if the other 6 nos are infact coming in the lo, so printing lo
}

getch();
return 0;
}

now the errors am getting are:

cannot find -lobjc
ld returned 1 exit status

in the compile log, this is the detailed thing its displaying:

Compiler: Default compiler
Executing g++.exe...
g++.exe "c:\Users\ronnieaka\Desktop\Dynamic Folder\Projects\st proj\sud\leftover.cpp" -o "c:\Users\ronnieaka\Desktop\Dynamic Folder\Projects\st proj\sud\leftover.exe" -ansi -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -lobjc -g3
C:\Dev-Cpp\Bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot find -lobjc
collect2: ld returned 1 exit status

Execution terminated

lobjc is the Objective-C library. You do not need it in C++, so remove it from the list of included libraries and that error should go away. Edward has not used Dev C++ in ages though. You will need to figure out where to make that change. Probably in the project settings somewhere. ;)

yeah but how do i know what to remove, u have seen the header files

now conio.h i seeked out from google and its an extension in borland c++ and one shouldn't include it when working in dev
so instead of clrscr() i used system(cls) with stdlib included but still getting that stupid error

Go to Project -> Project Options

It opens a dialog box, go to parameters, under linker look for -lobjc
When you find it delete it. That parameter was not found by the compiler.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.