May 25, 200323 yr Dunno really know if this here is overloading, but anyway. How can I 're'-define a function, e. g. having funct(a,:( and funct(a,b,c,d) at the same time.Just a redefinition likevoid funct (char a, char :({ bla bla}void funct (char a, char b, char c, char d){ even more bla}doesn't work for me. MinGW kicks out some errors like "previous declaration of funct" or something like that.Etienne :-wave
May 25, 200323 yr Try C++ not C for illegal re-definitions or what is it called "overloading?". If you want a function wth varibale parameter list try to define it with ..., but I don't recommend it. Chose different function-names and that's all, where is the problem?Arne Bartels
May 28, 200323 yr Yup what I wanted was several functions with different parameters but the same function name (e. g. like most of the GDI+ functions).>Chose different function-names and that's all, where is the>problem?Nah, no problem really, just wondered if it was possible in plain C to achieve the above.Thanks,Etienne :-wave
May 28, 200323 yr Hm, I just remembered that in plain C it is impossible to overlaod functions as fara as I know. But, if you write C-style functions in .cpp files, function overloading is possible. Since all compilers do C++ compilation if used with .cpp files it is C++, even if the function style is still C.Arne Bartels
May 28, 200323 yr Ok, thanks a lot, this might indeed work. :-) One dumb question though - how to tell the MinGW makefile to compile e. g. SDK.cpp instead of SDK.c? In the makefile there is specified GAU_NAME=SDK for example, without any file extension. Didn't really get it to compile SDK.cpp.Thanks again,Etienne :-wave
May 29, 200323 yr Have a look further down where GAU_NAME is really needed. Is there an extension? Fine, replace it.Arne Bartels
May 29, 200323 yr WHOOOPS *hiding in corner*I better should have had a deeper look once into makefile.Along with hundred thousand new warnings about conversion sutff (not too important for now), one error though I can't seem to get fixed:somegauge.o(.eh_frame+0x11):somegauge.cpp: undefined reference to `__gxx_personality_v0'Thanks man! ;-)Etienne :-wave
May 29, 200323 yr Maybe a library you forgot to add to the ADD_LIBS section? I have never seen this reference before. Is it a function you defined yourself?Arne Bartels
May 29, 200323 yr Hmmm, no.Seems to be just the result of changing to CPP. Also getting thousands of warnings about conversions now. That all with the overloaded functions commented out by the way.
May 29, 200323 yr Strange. Personally I prefer not to use "everything in one" file especially with cpp files. I posted an example of a splitted SDK sample recently here. To get it to work with GCC it needs a bit of work on the makefile, though.If I recall that right you need ADD_OBJS line like:ADD_OBJS=SDK.Attitude.o SDK.Control_Surfaces.o SDK.Fuel.o SDK.Fuel_Selector.o SDK.Temperature.o SDK.Wiskey.oI also changed $(GAU_NAME).o: $(GAU_DEPS) $(CC) $(CFLAGS) -o $@ -c $
Create an account or sign in to comment