Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Released] libMy - Datapackaging library  (Read 31842 times)

0 Members and 1 Guest are viewing this topic.

Haikarainen

  • Guest
[Released] libMy - Datapackaging library
« Reply #15 on: October 01, 2011, 04:05:26 am »
Ohwell, The library is finally released after a bumpy ride of ma-thumb-up-ma-ass.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10783
    • View Profile
    • development blog
    • Email
[Released] libMy - Datapackaging library
« Reply #16 on: November 13, 2011, 12:48:29 pm »
Quote from: "Haikarainen"
Currently having some problems with static linkage of boost libraries for static libmy-libraries :S


Is this still the case or did you resolve it?

Since you don't provide any build script and I've absolutly no idea how to use dll.a and dll.def files, I made my own VS2010 project, which compiled libMy to a static library. That worked fine but trying to use it in my test application throws out some linker errors with boost (debug and release).
So it sounds the same as your problem...

Code: [Select]
1>libMy.lib(Package.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""class boost::system::error_category const & __cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ)".

1>libMy.lib(Package.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""class boost::system::error_category const & __cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ)".

1>libMy.lib(Package.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""class boost::filesystem3::file_status __cdecl boost::filesystem3::detail::status(class boost::filesystem3::path const &,class boost::system::error_code *)" (?status@detail@filesystem3@boost@@YA?AVfile_status@23@AEBVpath@23@PEAVerror_code@system@3@@Z)".

1>libMy.lib(Package.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""bool __cdecl boost::filesystem3::detail::create_directories(class boost::filesystem3::path const &,class boost::system::error_code *)" (?create_directories@detail@filesystem3@boost@@YA_NAEBVpath@23@PEAVerror_code@system@3@@Z)".

1>libMy.lib(Package.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""private: static class std::codecvt<wchar_t,char,int> const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(void)" (?wchar_t_codecvt_facet@path@filesystem3@boost@@CAAEAPEBV?$codecvt@_WDH@std@@XZ)".

1>libMy.lib(Package.obj) : error LNK2001: Nicht aufgelöstes externes Symbol ""void __cdecl boost::filesystem3::path_traits::convert(char const *,char const *,class std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class std::allocator<wchar_t> > &,class std::codecvt<wchar_t,char,int> const &)" (?convert@path_traits@filesystem3@boost@@YAXPEBD0AEAV?$basic_string@_WU?$char_traits@_W@std@@V?$allocator@_W@2@@std@@AEBV?$codecvt@_WDH@5@@Z)".


"Nicht aufgelöstes externes Symbol" = "unresolved (external) symbol"

I've compiled the boost libraries and set the paths to the boost and the lib folder. Added in debug mode: "libMy-d.lib;libboost_system-vc100-mt-gd-1_47.lib;libboost_filesystem-vc100-mt-gd-1_47.lib" and in release mode: "libMy.lib;libboost_system-vc100-mt-1_47.lib;libboost_filesystem-vc100-mt-1_47.lib" but it doesn't link...

Any idea?
I've compiled libMy as x64 but used the standard script for boost, so I don't know if boost got x64 libraries too and if that could matter...

Or can you give an example of how to use dll.a and dll.def files (in Visual Studio)?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
[Released] libMy - Datapackaging library
« Reply #17 on: November 13, 2011, 03:18:36 pm »
I'm wondering how it's going with encryption? I'd love to use the library with my project but I'll need encryption as well :wink:

Though will download boost today and try your library out.

How do you think this look? :)
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10783
    • View Profile
    • development blog
    • Email
[Released] libMy - Datapackaging library
« Reply #18 on: November 13, 2011, 03:33:10 pm »
Defently encryption would be awesome! =)

Boost x64 is compiling... so haven't tested if it'll run with it, but I certaintly hope so. ;-)

@Groogy: hehe it needs a bit more white/lighter color around the black "lib", otherwise it difusses to much with the background.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
[Released] libMy - Datapackaging library
« Reply #19 on: November 13, 2011, 03:44:21 pm »


Now then? Edit: Added smooth = true to the logo textures as the aliasing on them annoyed me. The picture above does not contain the change.

Anyway I won't compile x64 and I was kind of annoyed that there were not at least makefiles with the project but no biggie, Netbeans will take care of that for me.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10783
    • View Profile
    • development blog
    • Email
[Released] libMy - Datapackaging library
« Reply #20 on: November 13, 2011, 03:51:49 pm »
Yep, one can now clearly see it.  :)
@Edit: Aliasing is (nearly) never that nice...

Just wanted to try the x64, it worked now quiet good for SFML and Thor. Hopefully it will work for boost & libMy too.

Btw it says, it's possible to load the SFML resourcess directly, but is it only for those resources or can I also load a text/XML file directly, without extracting it seperatly?
@Groogy: you display "Parsing config data" was that loaded from the libMy package?[/b]
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
[Released] libMy - Datapackaging library
« Reply #21 on: November 13, 2011, 04:03:22 pm »
Nothing there is loaded from libMy as of yet but eventually all of the data there will be loaded from a package file in libMy. I want encryption so that a unique serial key is used to unlock the resources. But in developer mode of course there won't be any encryption(As it is now plugins/mods will be supported and the editor will compile everything into a package for a developer without a serial key) :P
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10783
    • View Profile
    • development blog
    • Email
[Released] libMy - Datapackaging library
« Reply #22 on: November 13, 2011, 04:47:20 pm »
Ah okay, so I'll have to find it out myself...

Btw: YES! I did it!  :lol:
Managed to link libMy x64 staticly.
I'm really getting used to this linking stuff. But why can't the compiles give you a usefull error. All those linking errors are so cryptic...

What I had to do:
- Compile boost for x64 (bjam --toolset=msvc-10.0 address-model=64 --build-type=complete stage)
- Create & setup a project for libMy libraries
- Use Multithread (/MT) instead of Multithread DLL (/MD) for libMy and SFML project.
- Link with libboost_system-vc100-s-1_47.lib & libboost_filesystem-vc100-s-1_47.lib;libMy.lib
- Defining SFML_STATIC

If someone is interessted in the project file or the binaries, just let me know! =)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Richy19

  • Full Member
  • ***
  • Posts: 190
    • View Profile
[Released] libMy - Datapackaging library
« Reply #23 on: November 14, 2011, 03:33:00 am »
What exactly are its dependencies on boost?
Would it be possible to make it use zlib?

Haikarainen

  • Guest
[Released] libMy - Datapackaging library
« Reply #24 on: November 14, 2011, 07:20:12 am »
Quote from: "Richy19"
What exactly are its dependencies on boost?
Would it be possible to make it use zlib?


EDIT; Actually it depends on boost for filesystem(checking dirs, creating dirs etc) as well.

boost/crc.hpp

No probably not, since its my own custom format and it will support only that.


This thread seems to have exploded lately, I haven't forgot about the project but  I'm kinda busy with another one. Encryption is the nr 1 priority for this lib now tho since I'm gonna use it in the other project myself.

Groogy; I'd appreciate it if you dont tamper with the logo for public releases, hope you understand. I can provide more logo's later.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
[Released] libMy - Datapackaging library
« Reply #25 on: November 14, 2011, 08:24:49 am »
Quote from: "Haikarainen"

Groogy; I'd appreciate it if you dont tamper with the logo for public releases, hope you understand. I can provide more logo's later.


No problem, I'll switch back. My project will be on a private repo so there's no rush for me on getting this part working and correct right now.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Canadadry

  • Hero Member
  • *****
  • Posts: 1081
    • View Profile
[Released] libMy - Datapackaging library
« Reply #26 on: November 14, 2011, 07:34:48 pm »
Hi,

    Your project seems really interesting but cant you get ride of boost ? I'd like to build it for my platform (mac) but building with it is really annoying.

    You can use this lib to encrypt : http://www.aescrypt.com/ it's really simple to use.

good luck.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10783
    • View Profile
    • development blog
    • Email
[Released] libMy - Datapackaging library
« Reply #27 on: November 14, 2011, 10:43:12 pm »
Quote
This thread seems to have exploded lately, I haven't forgot about the project but I'm kinda busy with another one. Encryption is the nr 1 priority for this lib now tho since I'm gonna use it in the other project myself.


Hmmm... I think it would be better if you first 'unbug' the library. ;-)

I've found two issues probably both compiler dependend:

Package.cpp:85:
Code: [Select]
// At the moment
if(strcmp(firstcheck, "MPF") != 0){
// But should acutally be
if(strncmp(firstcheck, "MPF", 3) != 0){
// Since the read function of a stream doesn't (always) add a zero delimiter.
// Maybe it would work too with
firstcheck = new char[4];
// 3 chars + 1 delemiter


Package.cpp:95:
Code: [Select]
char idsplitter;
// My compiler returns an error in line 98 because idsplitter is not initialized
char idsplitter = ' ';


And I would suggest to implement a better file-/pathname handling. It took me a while to understand, that I've to use "./" to use the current path...
Also path and filename are kinda too close related to understand how one relates to the filename in the package and the other to the path of the file on the harddrive.

Additionally it would be great to get an build script or so... ;-)
And yep boost independens would be nice.

Now I even managed to load a text file out of the package!
I like it (after the hill I had to climb to get here)!  :lol:
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Haikarainen

  • Guest
[Released] libMy - Datapackaging library
« Reply #28 on: November 15, 2011, 07:19:52 am »
Quote from: "eXpl0it3r"
Quote
This thread seems to have exploded lately, I haven't forgot about the project but I'm kinda busy with another one. Encryption is the nr 1 priority for this lib now tho since I'm gonna use it in the other project myself.


Hmmm... I think it would be better if you first 'unbug' the library. ;-)

I've found two issues probably both compiler dependend:

Package.cpp:85:
Code: [Select]
// At the moment
if(strcmp(firstcheck, "MPF") != 0){
// But should acutally be
if(strncmp(firstcheck, "MPF", 3) != 0){
// Since the read function of a stream doesn't (always) add a zero delimiter.
// Maybe it would work too with
firstcheck = new char[4];
// 3 chars + 1 delemiter


Package.cpp:95:
Code: [Select]
char idsplitter;
// My compiler returns an error in line 98 because idsplitter is not initialized
char idsplitter = ' ';


And I would suggest to implement a better file-/pathname handling. It took me a while to understand, that I've to use "./" to use the current path...
Also path and filename are kinda too close related to understand how one relates to the filename in the package and the other to the path of the file on the harddrive.

Additionally it would be great to get an build script or so... ;-)
And yep boost independens would be nice.

Now I even managed to load a text file out of the package!
I like it (after the hill I had to climb to get here)!  :lol:


Thank you! This is the kind of response I was looking for! I actually never really used this except for debugging and making sure everything worked, So this is a really good thing you're doing. Please continue if you don't mind, I really need testers for this right now ;) I'll fix the bugs and try to get a script going.

Silvah

  • Guest
[Released] libMy - Datapackaging library
« Reply #29 on: November 15, 2011, 04:41:25 pm »
Quote from: "eXpl0it3r"
Code: [Select]
// At the moment
if(strcmp(firstcheck, "MPF") != 0){
// But should acutally be
if(strncmp(firstcheck, "MPF", 3) != 0){
Actually, it should be
Code: [Select]
if(memcmp(firstcheck, "MPF", 3) != 0){ to emphasize it's really a binary comparison.


Can I nitpick some more? ;)

So, why on Earth earlier in the same function it's
Code: [Select]
char* firstcheck;
firstcheck = new char[3];
and not the vastly simpler
Code: [Select]
char firstcheck[3];?

Why there are so much unadorned new[] and delete[]s in the code? Familiarize yourself with RAII and classes like std::vector or boost::scoped_array. It'll make the code simpler, easier to read and write, and more correct. Are you sure there are not memory leaks? I'm not. Given that there are so many ways for things to go wrong, I wouldn't dare to ignore RAII.

Why all the loop counters are of type int, not container::size_type (in most cases the same as std::size_t)? You not only have to cast to silence a warning about comparison between signed (int) and unsigned (size_t), you also make the code not work for all sizes larger than INT_MAX. On some common platforms, size_t is in fact larger than int, so the code may crash in a funny way.

Why all the std::strings are passed to functions by value? Pass by a reference to a constant, you'll get rid of unnecessary copying. It's very common idiom, so everyone will understand what you mean.

Why you're returning after throwing an exception? These returns are unreachable, throw already changes the control flow so much you probably are in a completely different function now, so the returns will have no chance to get executed.

Why I'm nitpicking on such issues? On this forum it's Nexus's job to do that, not mine ;)
Anyway, it's a nice library, keep on working on it, even though it uses it's own format instead of something widely supported. Could you document the details about the package's binary structure?