Make nsTArray available to XULRunner apps

RESOLVED FIXED

Status

RESOLVED FIXED
13 years ago
3 years ago

People

(Reporter: bent.mozilla, Assigned: bent.mozilla)

Tracking

({fixed1.8.1})

1.8 Branch
x86
Windows XP
fixed1.8.1

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Right now I get the following link errors when using nsTArray:

unresolved external symbol "__declspec(dllimport) public: unsigned int __thiscall nsTArray_base::Length(void)const " (__imp_?Length@nsTArray_base@@QBEIXZ)
unresolved external symbol "__declspec(dllimport) protected: __thiscall nsTArray_base::nsTArray_base(void)" (__imp_??0nsTArray_base@@IAE@XZ)
unresolved external symbol "__declspec(dllimport) protected: void __thiscall nsTArray_base::ShiftData(unsigned int,unsigned int,unsigned int,unsigned int)" (__imp_?ShiftData@nsTArray_base@@IAEXIIII@Z)
unresolved external symbol "__declspec(dllimport) protected: int __thiscall nsTArray_base::EnsureCapacity(unsigned int,unsigned int)" (__imp_?EnsureCapacity@nsTArray_base@@IAEHII@Z)
unresolved external symbol "__declspec(dllimport) protected: void __thiscall nsTArray_base::IncrementLength(unsigned int)" (__imp_?IncrementLength@nsTArray_base@@IAEXI@Z) referenced in function "public: int * __thiscall nsTArray<int>::AppendElements<int>(int const *,unsigned int)" (??$AppendElements@H@?$nsTArray@H@@QAEPAHPBHI@Z)

I'm linking xpcom.lib and xul.lib and MOZILLA_INTERNAL_API is defined. I'm not sure if this is an issue on the trunk.

Comment 1

13 years ago
Try linking to xpcomglue_s.lib in addition to xpcom.lib.  You shouldn't need to link to xul.lib.
(In reply to comment #1)
> Try linking to xpcomglue_s.lib in addition to xpcom.lib.  You shouldn't need to
> link to xul.lib.
> 
I'm using unfrozen interfaces so I hadn't tried xpcomglue_s.lib, but I still get the same unresolved externals (in addition to several others... is nsAutoLock not part of the glue?!?). Could I be missing some defines?
And I guess I should mention that this same code + linkage strategy worked fine when I was using nsVoidArray.
Okay, at the advice of bsmedberg I added nsTArray to xpcom/build/dlldeps.cpp and things work properly now. Seems that MSVC was stripping those symbols from the libs because they weren't being used. Patch in a sec.
OS: All → Windows XP
Hardware: All → PC
Created attachment 224746 [details] [diff] [review]
patch v1.0

Adds some nsTArray calls to dlldeps.cpp so that msvc won't strip nsTArray symbols from export libs.
Assignee: nobody → bent.mozilla
Status: NEW → ASSIGNED
Attachment #224746 - Flags: first-review?(benjamin)
Attachment #224746 - Flags: first-review?(benjamin) → first-review?(darin)

Updated

13 years ago
Attachment #224746 - Flags: first-review?(darin) → first-review+
Comment on attachment 224746 [details] [diff] [review]
patch v1.0

I always forget to request branch approval...
Attachment #224746 - Flags: approval-branch-1.8.1?(darin)

Updated

13 years ago
Attachment #224746 - Flags: approval-branch-1.8.1?(darin) → approval-branch-1.8.1+
fixed on trunk and branch
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Keywords: fixed1.8.1
Resolution: --- → FIXED
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.