Discussion:
[omniORB] VS 2005 - OmniOrb 4.1.4 Linker Issue
jklein at rockwellcollins.com ()
2010-04-23 04:32:09 UTC
Permalink
Howdy,

I'm trying to build an application that is a mix between managed and
unmanaged C++ with Visual Studio 2005 and omniOrb 4.1.4. This has been a
trying task to say the least. Of course, all the CORBA stuff is done
within non-managed code.

I'm down to a few linker warnings (I only list two as all the other are
duplicates). The application seems to run when I run it on the machine I
compiled it on within visual studio, but when I move it to another
machine, it crashes instantly. I don't even insatiate any of the
non-managed code unless a user clicks a button. Also, I'm moved all the
DLLs to the other machine.

I'm assuming this is due to these linker warnings.

Removed.obj : warning LNK4248: unresolved typeref token (0100001C) for
'CORBA._objref_IDLType'; image may not run
Removed.obj : warning LNK4248: unresolved typeref token (01000017) for
'omniIdentity'; image may not run

I translate my IDL with the following:

omniidl -bcxx -Wba -Wbh=.h -Wbs=.cpp -Wbd=.cpp

PreProcessor flags

WIN32;_DEBUG;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4;_CRT_SECURE_NO_WARNINGS

Or better this:

/Od /I "C:\snapshots\..Removed.." /I
"C:\omniorb\omniORB-4.1.4\include\omniORB4" /I "C:\snapshots\..Removed.."
/I "C:\omniorb\omniORB-4.1.4\include" /D "WIN32" /D "_DEBUG" /D
"__WIN32__" /D "__x86__" /D "_WIN32_WINNT=0x0400" /D "__NT__" /D
"__OSVERSION__=4" /D "_CRT_SECURE_NO_WARNINGS" /D "_UNICODE" /D "UNICODE"
/FD /EHa /MDd /Yu"stdafx.h" /Fp"Debug\..Removed...pch" /Fo"Debug\\"
/Fd"Debug\vc80.pdb" /W3 /nologo /c /Zi /clr /TP /errorReport:prompt /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll"
/FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll"

Linked Libs

ws2_32.lib mswsock.lib advapi32.lib omniORB414_rtd.lib
omniDynamic414_rtd.lib omnithread34_rtd.lib

Or better this:

/OUT:"C:\snapshots\..Removed...exe" /INCREMENTAL /NOLOGO
/LIBPATH:"C:\omniOrb\omniORB-4.1.4\lib\x86_win32" /MANIFEST
/MANIFESTFILE:"Debug\..Removed...exe.intermediate.manifest" /DEBUG
/ASSEMBLYDEBUG /PDB:"c:\snapshots\..Removed...pdb" /SUBSYSTEM:WINDOWS
/ENTRY:"main" /MACHINE:X86 /FIXED:No /ERRORREPORT:PROMPT ws2_32.lib
mswsock.lib advapi32.lib omniORB414_rtd.lib omniDynamic414_rtd.lib
omnithread34_rtd.lib


I thought about static linking, but that is not an option with the /clr
option.

I've heard others mention similar things, but none have been answered.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100422/1ff64297/attachment.htm
Sampo Ahokas
2010-04-23 14:27:33 UTC
Permalink
Post by jklein at rockwellcollins.com ()
I'm trying to build an application that is a mix between managed and
unmanaged C++ with Visual Studio 2005 and omniOrb 4.1.4. This has been
a trying task to say the least. Of course, all the CORBA stuff is done
within non-managed code.
I thought about static linking, but that is not an option with the
/clr option.
We have been doing something similar, but with static linking. It's been
a while, but I believe you only need to modify the omniORB Makefiles to
use the /MD runtime for building static libraries. Then the linking
inside a mixed mode C++/CLI assembly works just fine.

I also vaguely recall a related, rather obscure crash/error in WinForms
GUI apps, which happened only with VS2005 build... VS2008 fixed it, but
there was a workaround for VS2005 as well. Post more details if you keep
encountering it and I can try to check if its the same issue...

Best regards,
Sampo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100423/62232557/attachment.htm
Obermaier, Stephen J (IS)
2010-04-23 18:13:29 UTC
Permalink
Have you actually tried running the application? Those warnings are not
as dire as they sound. It simply means that you are referencing these
data types in MSIL code, but the data type is only defined in the native
(non-managed) module. This will not prevent the application from
running correctly, but if you want to eliminate the warnings, refer to
http://msdn.microsoft.com/en-us/library/h8027ys9.aspx.





Steve O.



From: omniorb-list-***@omniorb-support.com
[mailto:omniorb-list-***@omniorb-support.com] On Behalf Of
***@rockwellcollins.com
Sent: Thursday, April 22, 2010 6:32 PM
To: omniorb-***@omniorb-support.com
Subject: [omniORB] VS 2005 - OmniOrb 4.1.4 Linker Issue




Howdy,

I'm trying to build an application that is a mix between managed and
unmanaged C++ with Visual Studio 2005 and omniOrb 4.1.4. This has been a
trying task to say the least. Of course, all the CORBA stuff is done
within non-managed code.

I'm down to a few linker warnings (I only list two as all the other are
duplicates). The application seems to run when I run it on the machine I
compiled it on within visual studio, but when I move it to another
machine, it crashes instantly. I don't even insatiate any of the
non-managed code unless a user clicks a button. Also, I'm moved all the
DLLs to the other machine.

I'm assuming this is due to these linker warnings.

Removed.obj : warning LNK4248: unresolved typeref token (0100001C) for
'CORBA._objref_IDLType'; image may not run
Removed.obj : warning LNK4248: unresolved typeref token (01000017) for
'omniIdentity'; image may not run

I translate my IDL with the following:

omniidl -bcxx -Wba -Wbh=.h -Wbs=.cpp -Wbd=.cpp

PreProcessor flags

WIN32;_DEBUG;__WIN32__;__x86__;_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=
4;_CRT_SECURE_NO_WARNINGS

Or better this:

/Od /I "C:\snapshots\..Removed.." /I
"C:\omniorb\omniORB-4.1.4\include\omniORB4" /I
"C:\snapshots\..Removed.." /I "C:\omniorb\omniORB-4.1.4\include" /D
"WIN32" /D "_DEBUG" /D "__WIN32__" /D "__x86__" /D "_WIN32_WINNT=0x0400"
/D "__NT__" /D "__OSVERSION__=4" /D "_CRT_SECURE_NO_WARNINGS" /D
"_UNICODE" /D "UNICODE" /FD /EHa /MDd /Yu"stdafx.h"
/Fp"Debug\..Removed...pch" /Fo"Debug\\" /Fd"Debug\vc80.pdb" /W3 /nologo
/c /Zi /clr /TP /errorReport:prompt /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll" /FU
"c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll"
/FU "c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.XML.dll"

Linked Libs

ws2_32.lib mswsock.lib advapi32.lib omniORB414_rtd.lib
omniDynamic414_rtd.lib omnithread34_rtd.lib

Or better this:

/OUT:"C:\snapshots\..Removed...exe" /INCREMENTAL /NOLOGO
/LIBPATH:"C:\omniOrb\omniORB-4.1.4\lib\x86_win32" /MANIFEST
/MANIFESTFILE:"Debug\..Removed...exe.intermediate.manifest" /DEBUG
/ASSEMBLYDEBUG /PDB:"c:\snapshots\..Removed...pdb" /SUBSYSTEM:WINDOWS
/ENTRY:"main" /MACHINE:X86 /FIXED:No /ERRORREPORT:PROMPT ws2_32.lib
mswsock.lib advapi32.lib omniORB414_rtd.lib omniDynamic414_rtd.lib
omnithread34_rtd.lib


I thought about static linking, but that is not an option with the /clr
option.

I've heard others mention similar things, but none have been answered.

Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100423/6c4f842f/attachment.htm
jklein at rockwellcollins.com ()
2010-04-23 21:31:37 UTC
Permalink
I don't know how to respond to list-servers, hope this works.

Sampo,

I have a buddy that is also doing almost the same thing I am, except he is
using VS2008. He still gets the same linker warnings, but it runs on other
machines without issues. So maybe 2005 is the bad guy here. I checked all
his options and hey are almost identical, except he is missing
_WIN32_WINNT=0x0400;__NT__;__OSVERSION__=4.

Maybe if I can get a license of VS2008, my issues will go away. :( It
really would be nice if happen to recall if you was able to fix the crash
as I don't know if I can get a license.

Steve,

Yes. As I described, it seems to run on the machine that I compiled it on,
but crashes on others. I installed the .NET 2.x framework and the 2005
Visual C++ runtime that Microsoft says to on those machines to no avail.

All,

I've tried doing the debug and release mode builds. Both with the same
issues.

Thanks,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100423/84ab725c/attachment.htm
jklein at rockwellcollins.com ()
2010-04-24 00:21:46 UTC
Permalink
FYI,

I installed VS2010 Express and just did a simple test. (Of course, I was
forced to install a ton of updates on the target machine) I was able to
compile and run on the target. So yeah, it does seem like a VS2005 issue.
I'm starting to think that VS2010 Express will meet my requirements for
this application, so maybe all is good.

Thanks,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20100423/9a0c6566/attachment.htm
Loading...