✓Mixing C and C++

General questions regarding the usage of CodeLite
JoshuaBehrens
CodeLite Curious
Posts: 3
Joined: Wed Jun 25, 2014 7:11 pm
Genuine User: Yes
IDE Question: c++
Contact:

✓Mixing C and C++

Post 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
Last edited by JoshuaBehrens on Thu Jun 26, 2014 1:06 pm, edited 1 time in total.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Mixing C and C++

Post 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
Make sure you have read the HOW TO POST thread
JoshuaBehrens
CodeLite Curious
Posts: 3
Joined: Wed Jun 25, 2014 7:11 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Mixing C and C++

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Mixing C and C++

Post 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
Make sure you have read the HOW TO POST thread
JoshuaBehrens
CodeLite Curious
Posts: 3
Joined: Wed Jun 25, 2014 7:11 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Mixing C and C++

Post by JoshuaBehrens »

Aaah. I guess I didn't look right otherwise I would have seen this :oops:

- Joshua
Post Reply