Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: mrguo on October 15, 2020, 03:50:21 am

Title: Is there a way to set a object file name base on the full name of the source ?
Post by: mrguo on October 15, 2020, 03:50:21 am
There are two source files with a same basename in a same directory, such as : "a.cc" and "a.cu", like the sources of mxnet , During the building, there are two object files with a same name "a.o" might generate and overwrite each other, then, a lot of "undefined reference to" errors generated when try to link them together.

My questions : is there a way to set a object file name base on the full name of the source file ? in other words, can I set the C::B and let it compile the "a.cc" to "a.cc.o" and "a.cu" to "a.cu.o" , and link them together ? or is there a way to change the both $object and $link_objects command macros of C::B instead ?

Thanks!

Title: Re: Is there a way to set a object file name base on the full name of the source ?
Post by: stahta01 on October 15, 2020, 04:05:35 am
With an CB project open.

Project -> Properties
Tab: Project Settings
Checkbox: "Object Names Generation"

Tim S.
Title: Re: Is there a way to set a object file name base on the full name of the source ?
Post by: mrguo on October 15, 2020, 05:07:37 am
With an CB project open.

Project -> Properties
Tab: Project Settings
Checkbox: "Object Names Generation"

Tim S.

Great, it works!

Thank Tim very much ! and C::B is very nice !