1. Sokol Wrapper Build Issue

Hi all,

I came across the "sokol" libraries and I think they'd be neat to use with Euphoria. Of course I need to make the wrappers first. However I am having trouble building 'sokol_app' It keeps coming up with these errors when I try to build it under mingw/gcc.

sokol app file: https://github.com/floooh/sokol/blob/master/sokol_app.h

Using OpenEuphoria 4.1.0 Beta 2 Windows 11 Pro

Errors: https://ibb.co/whDc3MbK

//Sokol_app.c file 
#define SOKOL_DLL 
 
#define SOKOL_APP_IMPL 
 
#define SOKOL_GLCORE 
 
#define SOKOL_NO_ENTRY 
 
#include "sokol_app.h" 

gcc -c sokol_app.c - this builds/compiles fine 
gcc -shared -o sokol_app.dll sokol_app.o - this is what causes the errors to appear 

new topic     » topic index » view message » categorize

2. Re: Sokol Wrapper Build Issue

Icy_Viking said...

I came across the "sokol" libraries and I think they'd be neat to use with Euphoria.

Neat! I will definitely dig into this further. I love little libraries like these.

Icy_Viking said...

However I am having trouble building 'sokol_app' It keeps coming up with these errors when I try to build it under mingw/gcc.

sokol app file: https://github.com/floooh/sokol/blob/master/sokol_app.h

Using OpenEuphoria 4.1.0 Beta 2 Windows 11 Pro

Errors: https://ibb.co/whDc3MbK

These are all part of the Windows GDI library:

You need to tell GCC to link with that library when making your DLL, like this:

gcc -shared -o sokol_app.dll sokol_app.o -lgdi32 

That being said, I'm not sure the sokol_app library is going to work this way. It wants to call a function named sokol_main within your C code, and you can't have a "main" function in a DLL. I can dig into it more to see how it implements this and look for a work-around.

-Greg

new topic     » goto parent     » topic index » view message » categorize

3. Re: Sokol Wrapper Build Issue

ghaberek said...
Icy_Viking said...

I came across the "sokol" libraries and I think they'd be neat to use with Euphoria.

Neat! I will definitely dig into this further. I love little libraries like these.

Icy_Viking said...

However I am having trouble building 'sokol_app' It keeps coming up with these errors when I try to build it under mingw/gcc.

sokol app file: https://github.com/floooh/sokol/blob/master/sokol_app.h

Using OpenEuphoria 4.1.0 Beta 2 Windows 11 Pro

Errors: https://ibb.co/whDc3MbK

These are all part of the Windows GDI library:

You need to tell GCC to link with that library when making your DLL, like this:

gcc -shared -o sokol_app.dll sokol_app.o -lgdi32 

That being said, I'm not sure the sokol_app library is going to work this way. It wants to call a function named sokol_main within your C code, and you can't have a "main" function in a DLL. I can dig into it more to see how it implements this and look for a work-around.

-Greg

Thanks Greg, adding the "lgdi32" worked. Also, the '#define SOKOL_NO_ENTRY' is used for when there is no main, to help build DLL.

new topic     » goto parent     » topic index » view message » categorize

4. Re: Sokol Wrapper Build Issue

Icy_Viking said...

Thanks Greg, adding the "lgdi32" worked.

Glad to hear.

Icy_Viking said...

Also, the '#define SOKOL_NO_ENTRY' is used for when there is no main, to help build DLL.

I noticed that after poking around a bit more. Hopefully that's all you need to make it usable!

-Greg

new topic     » goto parent     » topic index » view message » categorize

5. Re: Sokol Wrapper Build Issue

ghaberek said...
Icy_Viking said...

Thanks Greg, adding the "lgdi32" worked.

Glad to hear.

Icy_Viking said...

Also, the '#define SOKOL_NO_ENTRY' is used for when there is no main, to help build DLL.

I noticed that after poking around a bit more. Hopefully that's all you need to make it usable!

-Greg

Well I have finished wrapping the main sokol libraries. https://github.com/gAndy50/EuSokol

The DLLs are built and the Euphoria programs compile without issue. No examples yet. I'm a bit unsure on how to make some examples as the sokol libraries are pretty struct heavy. You'll also need to use the 64-bit version of Euphoria, just an FYI.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu