Re: Module import failing after $ dub add mypackage

2021-07-16 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jul 16, 2021 at 04:54:18PM +, Scotpip via Digitalmars-d-learn wrote: [...] > I simply need a fast binary serialisation lib to read and write a > large list of structs to local disk - it's not for inter-app > communication. The struct is simple and only contains primitive D data >

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread Mike Parker via Digitalmars-d-learn
On Friday, 16 July 2021 at 17:14:12 UTC, Mike Parker wrote: I haven't had occasion to make use of any serialization libraries myself, but you can start here: https://wiki.dlang.org/Serialization_Libraries Also: https://code.dlang.org/search?q=serialization

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread Mike Parker via Digitalmars-d-learn
On Friday, 16 July 2021 at 16:54:18 UTC, Scotpip wrote: Yup - I have it running now but the code does seem to be a bit neglected and I'm seeing a depreciation warning too. I chose it because it's much the most downloaded serialisation package and is used in a couple of other popular packages.

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread Mike Parker via Digitalmars-d-learn
On Friday, 16 July 2021 at 16:44:31 UTC, Scotpip wrote: Again, if this helps anyone my current setup is to have a single main() in app.d. I changed the main() in my sandboxes to runSandbox(), and I import and run from app.d rather than directly. Or with a couple of keystrokes I can switch to

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread Scotpip via Digitalmars-d-learn
On Friday, 16 July 2021 at 16:42:50 UTC, Mike Parker wrote: I did encounter some missing symbols, though (`ntohl` and `ntohs`) as msgpack-d isn't linking with Ws2-32.lib. I added `pragma(lib, "Ws2_32")` to the top of the file to resolve it. (And I filed an issue:

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread Scotpip via Digitalmars-d-learn
On Friday, 16 July 2021 at 15:42:32 UTC, rikki cattermole wrote: ``$ dub build`` inside of ``myproject`` should work. Thanks - that was helpful. For anyone else with this issue I've figured out what went wrong. I had more than one main() function in the project - I was using the others as

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread Mike Parker via Digitalmars-d-learn
On Friday, 16 July 2021 at 15:31:49 UTC, Scotpip wrote: I'm completely stuck till I can get this fixed, so any help would be very much appreciated! I used the example from the readme at: https://code.dlang.org/packages/msgpack-d which I pasted into the generated `app.d`. And all the

Re: Module import failing after $ dub add mypackage

2021-07-16 Thread rikki cattermole via Digitalmars-d-learn
On 17/07/2021 3:31 AM, Scotpip wrote: In dub.sdl I see: ```dependency "msgpack-d" version="~>1.0.3"``` In dub.selections.json I see: ``` { "fileVersion": 1, "versions": {     "msgpack-d": "1.0.3" } } ``` Okay, its been added to your dub project. So far so good. When I

Module import failing after $ dub add mypackage

2021-07-16 Thread Scotpip via Digitalmars-d-learn
Another newbie question I'm afraid. Trying to import and use my first package from the registry. I installed D from the Windows dmd-2.097.0.exe I created the project with ```$ dub init myproject``` In the project root I've run: ``` $ dub add msgpack-d Adding dependency msgpack-d ~>1.0.3