Author Topic: Problems including c files into a codeblocks project  (Read 6168 times)

Offline Austromancy

  • Single posting newcomer
  • *
  • Posts: 1
Problems including c files into a codeblocks project
« on: October 02, 2024, 01:21:18 pm »
Hi! how are you doing. I know this may not be entirely C related but i'm having trouble with a bmp editor project while using codeblocks.

Context: This is a group project i made alongside 2 friends, all the functions work and its ready to be submited as a codeblocks project, but the delivery format specifies that we can only submit the following files (the names to the right correspond to the name of our files):

-group_functions.h / (in our project) funciones_grupo.h

-group_functions.c / funciones_grupo.c

-member1_functions.h / funciones_perez.h

-member1_functions.c / funciones_perez.c

-member2_functions.h / funciones_larriba.h

-member2_functions.c / funciones_larriba.c

-member3_functions.h / funciones_rios.h

-member3_functions.c / funciones_rios.c

in wich functions.h has to include the two files of each member.

While trying to test our project to see if it works, we created a new codeblocks project and included all these files into it.

All good at this point, but here is the problem: to mantain a same logic throughout the project, we made some "generic" structures. For example, one of these structures is called t_pixel, wich stores 3 unsigned int variables. Of course, a great number of our functions rely on these structures to work.

At first we decided to copy these structures into each and every one of our member.h files, but when we compiled we received a "conflicting types for..." error, so we decided to move all these structures to funciones_rios.h and include this file into the other member.h file. But now we receive a "unknown type name t_pixel" for example. What should we do so that funciones_perez and funciones_larriba can use the generic structures without causing a conflicting type error.

Here is a link to a drive folder that contains these files for a better picture of my problem.

https://drive.google.com/file/d/1H9FSaXQpHM8GxUQSUimAHrJwU0v6khgC/view?usp=sharing

Any kind of help would be greatly apreciated. Apologies for my english, it is not my first language.

Cheers!

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1644
Re: Problems including c files into a codeblocks project
« Reply #1 on: October 02, 2024, 01:42:31 pm »
General programming is OT here.

Online stahta01

  • Lives here!
  • ****
  • Posts: 7699
    • My Best Post
« Last Edit: October 02, 2024, 11:25:53 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org