d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Linker Error
Add Reply New Topic New Poll
Member
Posts: 1,358
Joined: Dec 30 2012
Gold: 0.10
Mar 20 2013 12:35pm
Getting the error LNK1302: only support linking safe .netmodules; unable to link ijw/native .netmodule

I started getting this error after I compiled a C# project.

Did some searching and came up with this on msdn http://msdn.microsoft.com/en-us/library/9x035d1s(v=vs.110).aspx

I compiled with the commands it told me to try and I'm still getting the same error.

This only happens when I compile a project using the libcurl library. If i compile a normal console application without the library it runs just fine.



This post was edited by SelfTaught on Mar 20 2013 12:37pm
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Mar 20 2013 03:08pm
I'm not personally familiar with the error, but from the sound of it you're trying to add a native "unmanaged" dll (from C, C++, etc) into your c# project. it's complaining because C#.NET isn't native; it's managed. why are you doing this? If you're trying to get info from urls, use the .NET classes to do it. eg: HttpWebRequest

there is some way to add native code like that, but i've never done it. google around for marshalling examples

/edit: but if you insist on it, looks like there's a C# version you can use:

http://stackoverflow.com/questions/2540580/libcurl-in-c-sharp-and-net

This post was edited by carteblanche on Mar 20 2013 03:12pm
Member
Posts: 1,358
Joined: Dec 30 2012
Gold: 0.10
Mar 20 2013 07:25pm
Quote (carteblanche @ Mar 20 2013 01:08pm)
I'm not personally familiar with the error, but from the sound of it you're trying to add a native "unmanaged" dll (from C, C++, etc) into your c# project. it's complaining because C#.NET isn't native; it's managed. why are you doing this? If you're trying to get info from urls, use the .NET classes to do it. eg: HttpWebRequest

there is some way to add native code like that, but i've never done it. google around for marshalling examples

/edit: but if you insist on it, looks like there's a C# version you can use:

http://stackoverflow.com/questions/2540580/libcurl-in-c-sharp-and-net


That's the weird thing, is that I didn't try building C# with the libcurl c++ library.. That would just be retarded lol.

I have no idea what I need to change in my settings and properties to fix this..
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Mar 20 2013 08:29pm
one way to fix this would be to use the C++ library and then load your functions from the library into your project. i forgot how to do this though i havent needed to do it in a long time.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll