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

GCC Native Ext. Build Not Working on Windows #30

Closed
piboistudios opened this issue Mar 5, 2020 · 2 comments
Closed

GCC Native Ext. Build Not Working on Windows #30

piboistudios opened this issue Mar 5, 2020 · 2 comments

Comments

@piboistudios
Copy link

piboistudios commented Mar 5, 2020

I'm really not sure what domain this problem falls within or if any (maybe something I can fix on my own), but I have a native library,

take these two Makefiles:
Makefile.win:

all: odbc.dll
    @:

odbc.dll: odbc.obj
    gcc -shared -mwindows -o odbc.dll odbc.obj -lodbc32

odbc.obj: odbc.c
    gcc -c -mwindows odbc.c -o odbc.obj -lodbc32

.PHONY: all

and Makefile.msvc:

all: odbc.dll
    @:

odbc.dll: odbc.obj
    cl /LD odbc.obj /link /OUT:odbc.dll /LIBPATH:"C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x86" odbc32.lib

odbc.obj: odbc.c
    cl /c odbc.c 

.PHONY: all

Both of them work, they both produce "odbc.dll"; Makefile.msvc also produces exp and lib files.

For the GCC approach, I used dumpfile /EXPORTS odbc.dll > odbc.exports and created a DEF file to then create a LIB/EXP file from using the Microsoft lib tool.

This works for GCC, so end result after building I end up with the same files:

  • odbc.dll
  • odbc.lib
  • odbc.exp

The problem is, odbc.dll cannot be loaded by ammer_odbc.hdll (presumably that's where this failure happens). I get this error: src\module.c(321) : FATAL ERROR : Failed to load library ammer_odbc.hdll

Does anyone have experience using GCC built DLLs with Ammer in Windows? I know other platforms require GCC, so I imagine it has to be possible on windows as well.

@piboistudios
Copy link
Author

I'm a C/C++ rookie, in this case I am going to assume that because I installed HL via binaries, it was probably built via the MSVC toolchain.

If I built it via GCC I imagine this should work. Anywho, closing for now.

@Aurel300
Copy link
Owner

Aurel300 commented Mar 5, 2020

I don't think that a different compiler framework should cause a DLL to not work properly. However, a version mismatch might be the cause? Anyway, I think these types of issues might be resolved when I get CI setup (#24).

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