error LNK2016: Absolute symbol '@comp.id' used as target of REL32relocation

A

ajtaylor

I have an set of unmanaged C++ libraries that I have been
successfully using in a C++/CLI assembly which is in turn used by some
other .NET code (ASP.NET/C#). The C++ makes a lot of use of Boost and
STL. This is all working in VS 2005

I moved to VS 2008 and compiled up Boost 1_36

I have subsequently applied SP1 to VS2008.

When I attempt to compile and link the C++/CLI I get the error

error LNK2016: Absolute symbol '@comp.id' used as target of REL32
relocation

I have searched on Google and not got much joy.

I have tried everything I can think of and am getting very frustrated.

Can anyone help me please?

Many thanks.
 
G

Giovanni Dicanio

I have an set of unmanaged C++ libraries that I have been
successfully using in a C++/CLI assembly which is in turn used by some
other .NET code (ASP.NET/C#). The C++ makes a lot of use of Boost and
STL. This is all working in VS 2005

I moved to VS 2008 and compiled up Boost 1_36

I have subsequently applied SP1 to VS2008.

When I attempt to compile and link the C++/CLI I get the error

error LNK2016: Absolute symbol '@comp.id' used as target of REL32
relocation

Have you tried a complete rebuild of all your DLLs and .EXE using VS2008
SP1?

Giovanni
 
A

ajtaylor

Have you tried a complete rebuild of all your DLLs and .EXE using VS2008
SP1?

Giovanni

I am going to try that this morning. Currently rebuilding Boost 1_36
with SP1.

I am not overly optimistic that will resolve it to be honest.

May have to go back to using VS 2005.
 
A

ajtaylor

I am going to try that this morning. Currently rebuilding Boost 1_36
with SP1.

I am not overly optimistic that will resolve it to be honest.

May have to go back to using VS 2005.

It seems I can make this error go away by removing my use of

#pragma unmanaged
#pragma managed

and

#ifdef _MANAGED
#pragma managed(push, off)
#endif

#ifdef _MANAGED
#pragma managed(pop)
#endif


The confusing thing is that I need to add these pragmas in VS 2005 as
I was getting all sorts of compile time and runtime errors mainly it
has to be said using the BOOST libs.

In the end I wrapped the boost #includes in these pragmas and my
problems went away.

Now in VS 2008 it seems that these are the cause of my LNK2016 errors.

I haven't done much testing of this code - will report back if have
any further errors.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top