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 library name to def files #74

Closed
wants to merge 1 commit into from
Closed

Add library name to def files #74

wants to merge 1 commit into from

Conversation

MangoFizz
Copy link

@MangoFizz MangoFizz commented Nov 16, 2020

I was getting this error when cross compiling using MinGW under Debian.

/usr/bin/x86_64-w64-mingw32-ld: ../../win32/vorbis.def:3: syntax error
/usr/bin/x86_64-w64-mingw32-ld:../../win32/vorbis.def: file format not recognized; treating as linker script
/usr/bin/x86_64-w64-mingw32-ld:../../win32/vorbis.def:2: syntax error
collect2: error: ld returned 1 exit status

According to the Microsoft C++ Docs, the the name of the DLL must be after LIBRARY statement.
https://docs.microsoft.com/en-us/cpp/build/exporting-from-a-dll-using-def-files

@sezero
Copy link
Contributor

sezero commented Nov 18, 2020

LIBRARY lines can actually be removed: Tested such a build under VS2017 a patch is inlined below:

diff --git a/win32/vorbis.def b/win32/vorbis.def
index 884f8f0..37c0d47 100644
--- a/win32/vorbis.def
+++ b/win32/vorbis.def
@@ -1,6 +1,6 @@
 ; vorbis.def
 ; 
-LIBRARY
+
 EXPORTS
 _floor_P
 _mapping_P
diff --git a/win32/vorbisenc.def b/win32/vorbisenc.def
index 79af064..40a3e39 100644
--- a/win32/vorbisenc.def
+++ b/win32/vorbisenc.def
@@ -1,6 +1,5 @@
 ; vorbisenc.def
 ;
-LIBRARY
 
 EXPORTS
 vorbis_encode_init
diff --git a/win32/vorbisfile.def b/win32/vorbisfile.def
index 4dc5549..a8a8446 100644
--- a/win32/vorbisfile.def
+++ b/win32/vorbisfile.def
@@ -1,6 +1,6 @@
 ; vorbisfile.def
 ;
-LIBRARY
+
 EXPORTS
 ov_clear
 ov_open

The LIBRARY line can be removed from ogg.def in the ogg project, too.

@MangoFizz
Copy link
Author

Understood, thanks!

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

Successfully merging this pull request may close these issues.

2 participants