"C:\TEMP\ccbwtgb.o [Warning]In function main
[Linker error] undefined reference to
`opendir
[Linker error] undefined reference to
`readdir
[Linker error] undefined reference to
`closedir
any idea's?
BR Kurt
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think that I have my library path set-up correctly since this is the only program where I have experienced this problem, but can you give me a hint on what to check regarding this set-up? I am running DEV-C++ 4.9.5.0. I don’t know about the exact version of my MinGW 3.2. compiler - which version should it be and where can I see the version number.
BR Kurt.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
C++ Includes: C:\sdk\Dev-Cpp\include\c++\3.2
C:\SDK\DEV-CPP\include
Note that I am running version 3.2 of gcc. Your lib paths and include paths which are specific to the version will be different if you are not running 3.2
BlakJak :]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Guys.
I am having a slight problem with this piece of code:
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <sys/types.h>
#include <stddef.h>
#include <dirent.h>
#include <stdio.h>
using namespace std;
int main(void) {
DIR *directory;
struct dirent *entries;
directory=opendir("./");
printf("Directory Contents:\n\n");
while((entries=readdir(directory)))
puts(entries->d_name);
closedir(directory);
return 0;
}
When i Compile I get a linker error like:
"C:\TEMP\ccbwtgb.o [Warning]In function main
[Linker error] undefined reference to
`opendir
[Linker error] undefined reference to
`readdir
[Linker error] undefined reference to
`closedir
any idea's?
BR Kurt
I cut'n'paste the code and it compiled fine. I am using the latest MinGW 3.2.
Have you got your library paths set up correctly?
BlakJak :]
Hi BlakJak.
I think that I have my library path set-up correctly since this is the only program where I have experienced this problem, but can you give me a hint on what to check regarding this set-up? I am running DEV-C++ 4.9.5.0. I don’t know about the exact version of my MinGW 3.2. compiler - which version should it be and where can I see the version number.
BR Kurt.
Hi BlakJak.
Please tell me which version you have and where to check the exact version on the MinGW compiler. (I am running DEV-C++ 4.9.5.0).
Could you also please tell me how to check the set-up libary path? I think mine is OK.
To check your version go to a DOS prompt and type g++ --version (note the double '-')
Your library paths are under
Tools->CompilerOptions->Directories->xxxx
My xxxx's are setup as:
Binaries: C:\SDK\DEV-CPP\Bin
C:\sdk\Dev-Cpp\lib\gcc-lib\mingw32\3.2
Libraries: c:\sdk\dev-cpp\lib
C includes: C:\SDK\DEV-CPP\include
C++ Includes: C:\sdk\Dev-Cpp\include\c++\3.2
C:\SDK\DEV-CPP\include
Note that I am running version 3.2 of gcc. Your lib paths and include paths which are specific to the version will be different if you are not running 3.2
BlakJak :]