Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » I'm having a problem including a library
icon3.gif  I'm having a problem including a library [message #60560] Sat, 04 May 2024 03:33 Go to next message
Mountacir is currently offline  Mountacir
Messages: 49
Registered: November 2021
Member
I added an include folder using build methods, it contains a header file that i included like this: #include "libCore.h"
libCore.h has a lots of includes that looks like this: "include/core/somefile.h"
All those header files are not found, even though they are in "include/core/" folder.

I'm really confused, any help is appreciated

Thanks!
Re: I'm having a problem including a library [message #60561 is a reply to message #60560] Sat, 04 May 2024 08:39 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
I think, you should create it as a package.
Re: I'm having a problem including a library [message #60562 is a reply to message #60561] Sat, 04 May 2024 16:32 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3377
Registered: August 2008
Senior Veteran
Oh yes.

In addition, please remember that for including all includes properly, you should have to set them in Select main package/Assembly setup/Package nests, like in this screenshot:

index.php?t=getfile&id=6927&private=0

You can see that, even though 'Reference' is an official package, as 'upp', both have to be set with the full path.
  • Attachment: img.jpg
    (Size: 74.97KB, Downloaded 203 times)


Best regards
Iñaki
Re: I'm having a problem including a library [message #60563 is a reply to message #60561] Sat, 04 May 2024 19:30 Go to previous messageGo to next message
Mountacir is currently offline  Mountacir
Messages: 49
Registered: November 2021
Member
Quote:
I think, you should create it as a package.


I have tried to create it as a package but the same issue.
Thank you

[Updated on: Sat, 04 May 2024 19:32]

Report message to a moderator

Re: I'm having a problem including a library [message #60564 is a reply to message #60562] Sat, 04 May 2024 19:33 Go to previous messageGo to next message
Mountacir is currently offline  Mountacir
Messages: 49
Registered: November 2021
Member
Quote:
Oh yes.

In addition, please remember that for including all includes properly, you should have to set them in Select main package/Assembly setup/Package nests, like in this screenshot:


Thank you for the screenshot, but i have those set correctly.
Re: I'm having a problem including a library [message #60565 is a reply to message #60560] Sat, 04 May 2024 19:45 Go to previous messageGo to next message
Mountacir is currently offline  Mountacir
Messages: 49
Registered: November 2021
Member
Let me explain more,

I add the "include" and "src" folders to internal includes using the Package organizer.
Here is an example of how my package folder looks like:

index.php?t=getfile&id=6929&private=0

I include a header file like this: #include "core/core.h"
"core/core.h" file contains this include: #include "include/core/Type.h"

If i try to build it i get an error that "include/core/Type.h" file is not found.
But TheIDE don't show any errors (red triangle) for "include/core/Type.h" if open "core/core.h" file

all the other header files contain includes like "include/folder/file.h" or "src/folder/file.h"
Re: I'm having a problem including a library [message #60566 is a reply to message #60565] Sun, 05 May 2024 10:38 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3377
Registered: August 2008
Senior Veteran
Hello Mountacir

Personally, I use internal includes only when integrating in U++ libraries developed externally, in many cases compiled using CMake.
In summary, it is my last resource...

Programming in U++, I advice you absolutely to follow U++ criteria. Good or bad, they let you do the things easily.

If you can, send in a zip all the structure and I will try to make them work.


Best regards
Iñaki
Re: I'm having a problem including a library [message #60567 is a reply to message #60560] Sun, 05 May 2024 15:26 Go to previous messageGo to next message
omari is currently offline  omari
Messages: 268
Registered: March 2010
Experienced Member
Hi,

instead of addeding the include folder using build methods, you should add the folder containing the "include" directory, in order to be able to use includes like this: "include/core/somefile.h".


regards
omari.
Re: I'm having a problem including a library [message #60570 is a reply to message #60565] Fri, 10 May 2024 06:30 Go to previous message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 221
Registered: June 2011
Experienced Member
Quote:
I include a header file like this: #include "core/core.h"
"core/core.h" file contains this include: #include "include/core/Type.h"


If I'm reading what you're saying correctly, I'm guessing it's from current directory so you're effectively trying to include "core/include/core/Type.h" which doesn't exist.

I think from core/core.h you should be doing #include "Type.h" since that's already in the core directory. "core/Type.h" may also work because include is already internal.

**EDIT** otherwise if you want to retain your naming scheme then you may need to hoist core.h out of the core directory up one level. Another way may just be to add . to internal includes - this is the easiest change.

[Updated on: Fri, 10 May 2024 08:34]

Report message to a moderator

Previous Topic: creating an gui to visualize and calculate Forward kinematics
Next Topic: U++ and Python
Goto Forum:
  


Current Time: Sun Jul 21 02:29:54 CEST 2024

Total time taken to generate the page: 0.02080 seconds