Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: out-of-line definition of 'Get_Free_Memory_Size' does not match any declaration in 'System_Info' on FreeBSD #11

Open
Martinfx opened this issue Jan 30, 2025 · 2 comments

Comments

@Martinfx
Copy link

Hi,
i have a problem with compilation on FreeBSD 14.2 amd64:
Are you going to make a new tag ?

/home/maxfx/Documents/aqemu/src/System_Info.cpp:2728:19: error: out-of-line definition of 'Get_Free_Memory_Size' does not match any declaration in 'System_Info'
 2728 | void System_Info::Get_Free_Memory_Size(int& allRAM, int& freeRAM)
      |                   ^~~~~~~~~~~~~~~~~~~~
/home/maxfx/Documents/aqemu/src/System_Info.cpp:2751:19: error: use of undeclared identifier 'getpagesize'
 2751 |   int page_size = getpagesize();
      |                   ^

@Martinfx
Copy link
Author

diff --git a/src/System_Info.cpp b/src/System_Info.cpp
index cc7fbd1..01de7d1 100644
--- a/src/System_Info.cpp
+++ b/src/System_Info.cpp
@@ -2722,10 +2722,11 @@ QStringList System_Info::Get_Host_CDROM_List()
#ifdef Q_OS_FREEBSD

#include <sys/sysctl.h>
+#include <unistd.h>
#include
#include

-void System_Info::Get_Free_Memory_Size(int& allRAM, int& freeRAM)
+void System_Info::Get_Free_Memory_Size(size_t& allRAM, size_t& freeRAM)
{
size_t all_ram = 0, free_ram = 0, cached_mem = 0;
size_t len = sizeof(all_ram);

@GermanAizek
Copy link
Contributor

@Martinfx, Thanks for the contribution.

I am not particularly active, I can include your patch in the repository, and you will also be listed in the contributors list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants