User forums > Using Code::Blocks

2 functions in diffrent c files that have the same name

<< < (3/4) > >>

BlueHazzard:

--- Quote from: erezz on November 05, 2013, 08:02:54 am ---Not sure that I understand your explanation. Note that I am a c::b user, not a developer, so I don't understand the internals of CodeCompletion plugin.

I think that it's legit to have a project that its output is multiple binaries where each binary is originated from a C file, and those C files may have functions with the same name. For a user that clicks b.c::foo1() and the IDE jump to d.c::foo1(), this is very not intuitive and strange. Still, sounds like a bug to me.

Erez

--- End quote ---

well, he said that a entry in the cc database will be overwritten from a other with the same name. This is legit, because C::B isn't made to generate multiple exe in one project (the makefile feature is simply a compatibility feature , i don't think it is thought to be used on daily use, because you won't need a IDE if you use makefiles), and  there won't be multiple entries with the same name, because it won't compile.
The right way to build multiple exe is to use the workspace feature: One workspace and multiple project files, for every exe one... Probably in the future it will be possible to use multiple workspaces at the same time..
But anyway C::B is open source so you can modify and contribute if you want.

greetings

dmoore:

--- Quote from: BlueHazzard on November 05, 2013, 02:25:29 pm ---well, he said that a entry in the cc database will be overwritten from a other with the same name. This is legit, because C::B isn't made to generate multiple exe in one project (the makefile feature is simply a compatibility feature , i don't think it is thought to be used on daily use, because you won't need a IDE if you use makefiles), and  there won't be multiple entries with the same name, because it won't compile.

--- End quote ---

This is a little overstated. What you said is normal use but its perfectly possible to use targets to generate multiple executables.

@OP: As others have said, I think this is expected behavior because CC only keeps only one copy of each function spec per project (what does that look like in the symbol browser?). It would probably be possible to support multiple function specs (as non-unique keys) but that's quite a bit of work for what is for most users a corner case.

erezz:

--- Quote from: BlueHazzard on November 05, 2013, 02:25:29 pm ---
--- Quote from: erezz on November 05, 2013, 08:02:54 am ---Not sure that I understand your explanation. Note that I am a c::b user, not a developer, so I don't understand the internals of CodeCompletion plugin.

I think that it's legit to have a project that its output is multiple binaries where each binary is originated from a C file, and those C files may have functions with the same name. For a user that clicks b.c::foo1() and the IDE jump to d.c::foo1(), this is very not intuitive and strange. Still, sounds like a bug to me.

Erez

--- End quote ---

well, he said that a entry in the cc database will be overwritten from a other with the same name. This is legit, because C::B isn't made to generate multiple exe in one project (the makefile feature is simply a compatibility feature , i don't think it is thought to be used on daily use, because you won't need a IDE if you use makefiles), and  there won't be multiple entries with the same name, because it won't compile.
The right way to build multiple exe is to use the workspace feature: One workspace and multiple project files, for every exe one... Probably in the future it will be possible to use multiple workspaces at the same time..
But anyway C::B is open source so you can modify and contribute if you want.

greetings


--- End quote ---

Thanks for the answer. I didn't know that c::b is limited to 1 binary per project. I hope this will be fixed in the future.

I guess that many programmers have a project with one big binary and many unit tests (each unit test is a stand-alone binary), so creating a project per unit test is problematic. In my case, I will need to have ~50 projects in my workspace.

BTW - even people that use custom Makefiles need an IDE...

Thanks,
Erez

scarphin:

--- Quote from: erezz on November 05, 2013, 02:41:11 pm ---
Thanks for the answer. I didn't know that c::b is limited to 1 binary per project. I hope this will be fixed in the future.

I guess that many programmers have a project with one big binary and many unit tests (each unit test is a stand-alone binary), so creating a project per unit test is problematic. In my case, I will need to have ~50 projects in my workspace.

BTW - even people that use custom Makefiles need an IDE...

Thanks,
Erez

--- End quote ---

Did you try to use targets (which are like different builds under the same project) to accomplish what you are trying to do? That would be a better option imo.

oBFusCATed:

--- Quote from: erezz on November 05, 2013, 02:41:11 pm ---I didn't know that c::b is limited to 1 binary per project. I hope this will be fixed in the future.

--- End quote ---
It is not, it is limited to 1 binary per target and anyone telling you something else hasn't tried to open the codeblocks*.cbp projects in our repo.
You can have multiple targets per project.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version