Page 1 of 1

✓Mixing C and C++

Posted: Wed Jun 25, 2014 7:16 pm
by JoshuaBehrens
I just had the following problem:

I have file.c and file.cpp in my project. So they have the same name with a different extension. Both gets compiled to file.o so one is overriding the other. Is their an option that distinguish file.c from file.cpp like file.c.o and file.cpp.o(there is one in codeblocks)? I know (and I actually did) renaming solves the problem. But I guess it is major problem when you want to mix c++ and c and it took me several hours to recognize this.

Thanks in advance

- Joshua

Re: Mixing C and C++

Posted: Wed Jun 25, 2014 10:21 pm
by eranif
Which version of codelite are you using?
codelite 6.0 always does that (appends the .o to the file name)

Please provide the information as described here:
http://forums.codelite.org/viewtopic.php?f=3&t=804

Eran

Re: Mixing C and C++

Posted: Thu Jun 26, 2014 2:18 am
by JoshuaBehrens
I am using 5.4, nothing selfcompiled. I just used a download package with mingw environment and I am running it on a Windows 7 64bit but I don't target 64bit. Didn't knew there was already a new version.

- Joshua

Re: Mixing C and C++

Posted: Thu Jun 26, 2014 8:33 am
by eranif
IIRC, there is also a flag to enable this functionality for 5.4.
Settings -> build settings -> compilers -> <your compiler> -> Advanced

'Object name same as file name' (or something similar)

Eran

Re: Mixing C and C++

Posted: Thu Jun 26, 2014 1:05 pm
by JoshuaBehrens
Aaah. I guess I didn't look right otherwise I would have seen this :oops:

- Joshua