Open Bug 1246338 Opened 8 years ago Updated 2 years ago

LNK2001: unresolved external symbol "int __cdecl NS_GetRealPort(class nsIURI *)" (?NS_GetRealPort@@YAHPAVnsIURI@@@Z)

Categories

(Core :: Networking, defect, P5)

45 Branch
defect

Tracking

()

People

(Reporter: devan.shah14, Unassigned)

Details

(Whiteboard: [necko-would-take])

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:46.0) Gecko/20100101 Firefox/46.0
Build ID: 20160128004012

Steps to reproduce:

Using the firefox-sdk from FF 45 Beta (https://ftp.mozilla.org/pub/firefox/releases/45.0b3/win32/en-US/firefox-45.0b3.sdk.zip) I am including the #include "nsNetUtil.h" this header contains unimplemented function. Which is causing linker errors for the unimplemented elements: 

Error: 
LNK2001: unresolved external symbol "int __cdecl NS_GetRealPort(class nsIURI *)" (?NS_GetRealPort@@YAHPAVnsIURI@@@Z)



Actual results:

Error: LNK2001: unresolved external symbol "int __cdecl NS_GetRealPort(class nsIURI *)" (?NS_GetRealPort@@YAHPAVnsIURI@@@Z)



Expected results:

No linker error
OS: Unspecified → Windows Server 2008
Hardware: Unspecified → x86
Whiteboard: [necko-would-take]
Severity: normal → critical
Is there an update on when this bug will be looked at.
Flags: needinfo?(mcmanus)
this doesn't impact a tier one platform so its on a itch scratching basis.
Flags: needinfo?(mcmanus)
OS: Windows Server 2008 → Unspecified
Hardware: x86 → Unspecified
I would assume that using the Firefox SDK failing to compile because of an linker error would be critical as this was a regression, after inline functions in nsNetUtil.h were moved to a cpp file nsNetUtil.cpp, the SDK was not usable as the implemented functions were missing from the SDK libs. https://bugzilla.mozilla.org/show_bug.cgi?id=905127
Severity: critical → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Some additional information on this issues:

unresolved external symbol "int __cdecl NS_GetRealPort(class nsIURI *)" (?NS_GetRealPort@@YAHPAVnsIURI@@@Z) is being caused by the fact that function NS_GetRealPort is being used in firefox-sdk\include\nsPromptUtils.h from the NS_GetAuthHostPort function (*aPort = NS_GetRealPort(uri);), since this function is not implemented it throws this error, same issues with function NS_GetDefaultPort. 

Sample example to reproduce this issue:

Code snippitt from the nsPromptUtils.h provided by Firefox SDK
#include "nsNetUtil.h"

inline void
NS_GetAuthHostPort(nsIChannel* aChannel, nsIAuthInformation* aAuthInfo,
                   bool aMachineProcessing, nsCString& aHost, int32_t* aPort)
{
  nsCOMPtr<nsIURI> uri;
  nsresult rv = aChannel->GetURI(getter_AddRefs(uri));

  uri->GetAsciiHost(aHost);
  *aPort = NS_GetRealPort(uri);
}

I was able to implement the NS_GetRealPort and NS_GetDefaultPort in the nsPromptUtils.h header file to get rid of the linker error. However issues should be fixed with change in compile time so that function implementations are available.
OS: Unspecified → All
Hardware: Unspecified → All
Bulk change to priority: https://bugzilla.mozilla.org/show_bug.cgi?id=1399258
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.