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 » StringParse missing declaration (Errors while compiling / missing libraries ...)
StringParse missing declaration [message #59827] Thu, 27 April 2023 21:33 Go to next message
dschoni is currently offline  dschoni
Messages: 15
Registered: January 2021
Location: Switzerland
Promising Member
I've managed to install TheIDE on Linux (Ubuntu 22.04 LTS).
Everything works fine, until I want to use SystemInfo functions.

As soon, as I get any function like this:
#elif defined(PLATFORM_POSIX)

bool GetDriveSpace(String drive, 
	//uint64 &totalBytes,	// To determine the total number of bytes on a disk or volume, use IOCTL_DISK_GET_LENGTH_INFO.
	uint64 &freeBytesUser, 	// Total number of free bytes on a disk that are available to the user who is associated with the calling thread.
	uint64 &totalBytesUser, // Total number of bytes on a disk that are available to the user who is associated with the calling thread.
	uint64 &totalFreeBytes)	// Total number of free bytes on a disk.
{
	freeBytesUser = totalBytesUser = totalFreeBytes = 0;
	
	StringParse space = Sys("df -T");
	if (space == "")
		return false;
	
	while (drive != space.GetText())
		;
	space.MoveRel(-10);	space.GoBeginLine(); 
	space.GetText();	space.GetText();	// Jumps over device path and filesystem
	totalBytesUser = 1024*space.GetUInt64();
	space.GetText();						// Jumps over used space
	freeBytesUser  = totalFreeBytes = 1024*space.GetUInt64();
	return true;
}


I've got errors:
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (409): error: 'StringParse' was not declared in this scope
 (): 409 |         StringParse space = Sys("df -T");
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (410): error: 'space' was not declared in this scope; did you mean 'splice'?
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (413): error: 'space' was not declared in this scope; did you mean 'splice'?
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (415): error: 'space' was not declared in this scope; did you mean 'splice'?
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (427): error: 'StringParse' was not declared in this scope
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (428): error: 'info' was not declared in this scope
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (432): error: 'info' was not declared in this scope
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (436): error: 'info' was not declared in this scope
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (439): error: 'info' was not declared in this scope
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (451): error: aggregate 'GetDriveInformation(Upp::String, Upp::String&, Upp::String&, int&, Upp::String&)::statfs buf' has incomplete type and cannot be defined
/home/sd/Tech/Linux/upp/MyApps/FolderTree/main.cpp (452): error: invalid use of incomplete type 'struct GetDriveInformation(Upp::String, Upp::String&, Upp::String&, int&, Upp::String&)::statfs'


The same code works fine on Windows, because "StringParse" is not used there. But I have no idea, how to change the code.

How to solve this?

Best Regards
Daniel
Re: StringParse missing declaration [message #59828 is a reply to message #59827] Thu, 27 April 2023 22:57 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1092
Registered: August 2007
Senior Contributor
Hello Daniel,

StringParse function is a part of Functions4U package, which should have been automatically installed if you already installed SysInfo package, using UppHub.

What you should do to use SysInfo package:

1) Add the SysInfo package to your project (using TheIDE)
2) Include SysInfo header in your h or cpp file:
#include <SysInfo/SysInfo.h>

3) Don't forget to add
using namespace Upp;
to your cpp file OR call your functions with Upp:: namespace, e.g.
Upp::StringParse

Best regards,
Oblivion


[Updated on: Thu, 27 April 2023 23:02]

Report message to a moderator

Re: StringParse missing declaration [message #59829 is a reply to message #59828] Thu, 27 April 2023 23:17 Go to previous message
dschoni is currently offline  dschoni
Messages: 15
Registered: January 2021
Location: Switzerland
Promising Member
Thank you very much, this works! Smile

Best Regards
Daniel

A step more on the road to get the things done ...
Previous Topic: Assist++ : Parse error
Next Topic: Linux Mint installation issue
Goto Forum:
  


Current Time: Fri Apr 26 23:36:25 CEST 2024

Total time taken to generate the page: 0.07352 seconds