Skip to content

Giving parameters meant for Optlink to other linkers caused errors #110

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Current supported platforms are Windows, using Win32 and Linux, using GTK.
dub.sdl:
name "main"
dependency "dwt" version="~>1.0.0"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
3 changes: 1 addition & 2 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ configuration "windows-win32" {
excludedSourceFiles \
"org.eclipse.swt.win32.win32.x86/src/org/eclipse/swt/internal/mozilla/*"

lflags `+$DWT_PACKAGE_DIR\org.eclipse.swt.win32.win32.x86\lib\` platform="x86-dmd"
lflags `/exet:nt/su:console:4.0` platform="x86-dmd"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why shouldn't this flag be located here?

Copy link
Author

@torhus torhus Oct 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I set lflags to "/subsystem:windows:4" platform="x86_omf" in my application's dub.sdl, DUB hands both of these flags to Optlink, which then fails. I'm not sure that the dub.sdl for a library should specify linker flags for the executable in any case.

My dub.sdl is here. This is the output of dub build -a=x86 -c=windows -v, just the last part:

Linking...
dmd -of.dub\build\windows-debug-windows-x86.x86_omf-dmd_v2.098.1-dirty-E19EE96DF69DD1F2F42225F25FAEFD6B\MonsterBrowser.exe .dub\build\windows-debug-windows-x86.x86_omf-dmd_v2.098.1-dirty-E19EE96DF69DD1F2F42225F25FAEFD6B\MonsterBrowser.obj C:\Users\Tor\AppData\Local\dub\packages\dwt-19f219e\dwt.dub\build\windows-win32-debug-windows-x86.x86_omf-dmd_v2.098.1-dirty-1834BE915F39DAC157FE4B93801A334D\dwt.lib C:\Users\Tor\AppData\Local\dub\packages\dwt-19f219e\dwt.dub\build\library-debug-windows-x86.x86_omf-dmd_v2.098.1-dirty-D97C1206C6747F5F1023630810528EC0\dwt_base.lib C:\Users\Tor\AppData\Local\dub\packages\undead-1.1.7\undead.dub\build\library-debug-windows-x86.x86_omf-dmd_v2.098.1-dirty-0DAFEBC2AD885CF5A0EC9F5909572A39\undead.lib advapi32.lib comctl32.lib comdlg32.lib gdi32.lib kernel32.lib msimg32.lib ole32.lib oleacc.lib oleaut32.lib opengl32.lib shell32.lib shlwapi.lib user32.lib usp10.lib olepro32.lib -L/rc:misc\mb.res -L/subsystem:windows:4 -L/exet:nt/su:console:4.0 -L+C:\Users\Tor\AppData\Local\dub\packages\dwt-19f219e\dwt\org.eclipse.swt.win32.win32.x86\lib\ -m32 -g
OPTLINK (R) for Win32 Release 8.00.17
Copyright (C) Digital Mars 1989-2013 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
OPTLINK : Error 9: Unknown Option
+"C:\Users\Tor\AppData\Local\dub\packages\undead-1.1.7\undead.dub\build\library-debug-windows-x86.x86_omf-dmd_v2.098.1-dirty-0DAFEBC2AD885CF5A0EC9F5909572A39\undead.lib"+"advapi32.lib"+"comctl32.lib"+"comdlg32.lib"+"gdi32.lib"+"kernel32.lib"+"msimg32.lib"+"ole32.lib"+"oleacc.lib"+"oleaut32.lib"+"opengl32.lib"+"shell32.lib"+"shlwapi.lib"+"user32.lib"+"usp10.lib"+"olepro32.lib"+phobos+user32+kernel32/co/noi/rc:misc\mb.res/subsystem:windows:4/exet:nt/su:console:4.0+C:\Users\Tor\AppData\Local\dub\packages\dwt-19f219e\dwt\org.eclipse.swt.win32.win32.x86\lib;

                                                                                                                                                                                                                                                                                                                                                                                                                                                                           ^

:4.0
Warning 2: File Not Found :4.0
Error: linker exited with status 1
FAIL .dub\build\windows-debug-windows-x86.x86_omf-dmd_v2.098.1-dirty-E19EE96DF69DD1F2F42225F25FAEFD6B\ MonsterBrowser executable
dmd failed with exit code 1.

lflags `+$DWT_PACKAGE_DIR\org.eclipse.swt.win32.win32.x86\lib\` platform="x86_omf"
libs "olepro32" platform="x86"
libs \
"advapi32" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet1"
dependency "dwt" path="../../../../../../" version="*"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet10"
dependency "dwt" path="../../../../../../" version="*"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet107"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet108"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet109"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet111"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet115"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet118"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet119"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet122"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet127"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet128"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet130"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet130a"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet132"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet133"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet134"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet136"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet138"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet14"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet140"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet142"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet143"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet144"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet146"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet147"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet15"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet150"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet152"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet153"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet16"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet162"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet163"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet165"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet169"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet170"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet174"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet184"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet189"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet190"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet193"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet195"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet2"
dependency "dwt" path="../../../../../../" version="*"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet20"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet206"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet207"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
dub.sdl:
name "snippet208"
dependency "dwt" path="../../../../../../"
lflags "/subsystem:console:4" platform="x86_omf"
libs \
"atk-1.0" \
"cairo" \
Expand Down
Loading