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

Add install commands for C wrapper library #109

Open
HurricanePootis opened this issue Feb 22, 2024 · 10 comments
Open

Add install commands for C wrapper library #109

HurricanePootis opened this issue Feb 22, 2024 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@HurricanePootis
Copy link

HurricanePootis commented Feb 22, 2024

Describe the Bug

Whenever I enable the CMake flag -DVPKEDIT_BUILD_LIBC, I get the following error here. Here is the one for clang.

This is on the latest release 4.1.0.

To Reproduce

#!/bin/bash

git clone --recursive https://github.com/craftablescience/VPKEdit.git
cd VPKEdit
cmake -B build -S ./ -DCMAKE_BUILD_TYPE=Release -DVPKEDIT_BUILD_LIBC=ON
cmake --build build

Operating System

Arch Linux

@HurricanePootis HurricanePootis added the bug Something isn't working label Feb 22, 2024
@craftablescience
Copy link
Owner

Sorry, I guess I forgot to define that for Linux... one sec

@craftablescience
Copy link
Owner

Should be fixed now, lmk if there's any other issues

@HurricanePootis
Copy link
Author

HurricanePootis commented Feb 22, 2024

A lot of the errors have been fixed, but I am now getting this new error

/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp: In function ‘std::size_t writeStringToBuffer(std::string_view, char*, std::size_t)’:
/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp:17:22: error: ‘memcpy’ is not a member of ‘std’; did you mean ‘wmemcpy’?
   17 |                 std::memcpy(buffer, str.data(), bufferLen);
      |                      ^~~~~~
      |                      wmemcpy
/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp:21:14: error: ‘memcpy’ is not a member of ‘std’; did you mean ‘wmemcpy’?
   21 |         std::memcpy(buffer, str.data(), str.length());
      |              ^~~~~~
      |              wmemcpy
/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp: In function ‘std::size_t writeVectorToBuffer(const std::vector<std::byte>&, unsigned char*, std::size_t)’:
/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp:28:22: error: ‘memcpy’ is not a member of ‘std’; did you mean ‘wmemcpy’?
   28 |                 std::memcpy(buffer, vec.data(), bufferLen);
      |                      ^~~~~~
      |                      wmemcpy
/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp:31:14: error: ‘memcpy’ is not a member of ‘std’; did you mean ‘wmemcpy’?
   31 |         std::memcpy(buffer, vec.data(), vec.size());
      |              ^~~~~~
      |              wmemcpy
/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp: In function ‘VPKEdit_StringArray_t convertStringVector(const std::vector<std::__cxx11::basic_string<char> >&)’:
/home/hurricane/vpkedit/src/vpkedit/src/libc/Helpers.cpp:39:22: error: ‘memcpy’ is not a member of ‘std’; did you mean ‘wmemcpy’?
   39 |                 std::memcpy(array.data[i], stringVec[i].c_str(), stringVec[i].length());
      |                      ^~~~~~
      |                      wmemcpy

@craftablescience
Copy link
Owner

Pushed a commit that should fix that, I'm also going to add this target to CI so it tells me when its broken lol

@HurricanePootis
Copy link
Author

It builds now! I just got one more question: libvpkeditc.so ain't installed whenever invoking the install command, and are there any header files for the library? I am asking because I am going to be packaging this in the AUR as a split-package with vpkedit.

@craftablescience
Copy link
Owner

libvpkeditc.so ain't installed whenever invoking the install command

I'll look into fixing this, in the meantime header files are under include/vpkeditc

@HurricanePootis
Copy link
Author

Also, one more thing (sorry), the resulting library is named liblibvpkeditc.so in the build/ directory.

@craftablescience
Copy link
Owner

I think I can fix this, I'll have to pull out my Linux machine to test it though. I'm playing Donut County rn, I'll get to that in about an hour probably

@HurricanePootis
Copy link
Author

HurricanePootis commented Feb 22, 2024

lol enjoy your donut county 🍩🍩🍩🍩

@craftablescience
Copy link
Owner

craftablescience commented Feb 22, 2024

thx! I fixed the duplicated lib in the name, but I'm not sure how to get the install command to work. It's probably super simple and I'm dumb, but I'm stopping here for the night

@craftablescience craftablescience changed the title Building c library fails on Linux Add install commands for C wrapper library Apr 21, 2024
@craftablescience craftablescience added enhancement New feature or request and removed bug Something isn't working labels Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants