I'm trying to use a C library in my C++ Project. The C library is PhysFS (a cross platform file management lib). But whenever I try to compile the PhysFS code I'll get warnings. Like this:
[Warning] In function `int appendDirSep(char **)':
320 ANSI C++ forbids implicit conversion from `void *' in assignment
Now I don't really care so much about warnings but the problem is that the code still won't compile, I'll get an error like this at the end of my compiler output:
physfs.o: No such file or directory.
Does that make any sense? There weren't any errors? Now I know you're probably ready to blame PhysFS but I've seen this sort of problem happen before with other C libraries. Does anybody know why this is happening, and how to fix it without having to rewrite the lib itself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Problem is your library is using the implicit conversion from void to other types. Ansi C++ does not like this and the G++ compiler is bombing out at the warning. I believe there is an option to continue to compile on warnings but I do not know what it is.
The alternative is to use C only. Obviously this option is valid if you are not using C++ language structures.
Try changing the file extensions from .CPP to .C. Also make sure all C++ options are switched off in DEV-C++.
Let me know if it helps.
BlakJak :]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah thats what I've been doing (messing with various compiler flags), As far as .cpp and .c goes all the C++ parts of my project have .cpp extensions and C parts have .c extensions.
I've come up with a few quick fixes but I'd still much rather compile the C and C++ parts together in one big lumpy project.
The fix: Just stash all the C parts off into a seperate project compile it as a static (or dynamic) lib, and then link it to the C++ parts. Thankfully I can get away with doing this C parts don't use the C++ parts.
But still if you know whats going on with those ca-razzy warnings let me know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to use a C library in my C++ Project. The C library is PhysFS (a cross platform file management lib). But whenever I try to compile the PhysFS code I'll get warnings. Like this:
[Warning] In function `int appendDirSep(char **)':
320 ANSI C++ forbids implicit conversion from `void *' in assignment
Now I don't really care so much about warnings but the problem is that the code still won't compile, I'll get an error like this at the end of my compiler output:
physfs.o: No such file or directory.
Does that make any sense? There weren't any errors? Now I know you're probably ready to blame PhysFS but I've seen this sort of problem happen before with other C libraries. Does anybody know why this is happening, and how to fix it without having to rewrite the lib itself.
Problem is your library is using the implicit conversion from void to other types. Ansi C++ does not like this and the G++ compiler is bombing out at the warning. I believe there is an option to continue to compile on warnings but I do not know what it is.
The alternative is to use C only. Obviously this option is valid if you are not using C++ language structures.
Try changing the file extensions from .CPP to .C. Also make sure all C++ options are switched off in DEV-C++.
Let me know if it helps.
BlakJak :]
Try playing with the compiler Options, like "Inhibit al Warning messages". Maybe that will help....
stephan
Yeah thats what I've been doing (messing with various compiler flags), As far as .cpp and .c goes all the C++ parts of my project have .cpp extensions and C parts have .c extensions.
I've come up with a few quick fixes but I'd still much rather compile the C and C++ parts together in one big lumpy project.
The fix: Just stash all the C parts off into a seperate project compile it as a static (or dynamic) lib, and then link it to the C++ parts. Thankfully I can get away with doing this C parts don't use the C++ parts.
But still if you know whats going on with those ca-razzy warnings let me know.