Bug 18764 – -g makes OPTLINK fail to find symbols

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2018-04-15T15:19:57Z
Last change time
2024-12-13T18:58:23Z
Assigned to
No Owner
Creator
Jonathan Marler
Moved to GitHub: dmd#19424 →

Attachments

IDFilenameSummaryContent-TypeSize
1686d2d1.omf.libDirectX Library OMF Formatapplication/octet-stream1536

Comments

Comment #0 by johnnymarler — 2018-04-15T15:19:57Z
Created attachment 1686 DirectX Library OMF Format Optlink failed to find symbols when passing `-g` to dmd. Note that the only difference in the link command when passing `-g` is it adds the `/co` option to OPTLINK (NOTE: not sure what this option means for OPTLINK). To reproduce. clone the direct-x binding repository: git clone https://github.com/evilrat666/directx-d Create the following file: --- issue.d import directx.d2d1; int main() { //auto result = D2D1CreateDevice(null, null, null); ID2D1Factory direct2dFactory; auto options = D2D1_FACTORY_OPTIONS(D2D1_DEBUG_LEVEL_WARNING); auto result = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, &options, cast(void**)&direct2dFactory); return 0; } --- Download the attached directx omf library (converted from the COFF library). Compilation/Link should work with the following: dmd -I=<path-to-directx-d-repo> d2d1.omf.lib issue.d Example: did -I=..\directx-d\src d2d1.omf.lib issue.d Now perform the same compilation but add `-g`, and you should get the following linker error: OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www.digitalmars.com/ctg/optlink.html issue.obj(issue) Error 42: Symbol Undefined _D2D1CreateDevice@12 issue.obj(issue) Error 42: Symbol Undefined _D2D1CreateDeviceContext@12 Error: linker exited with status 2
Comment #1 by robert.schadek — 2024-12-13T18:58:23Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19424 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB