Jump to content

Compiler Error

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Kyle Joseph Klouzal

Kyle Joseph Klouzal

    Newbie

  • Members
  • PipPip
  • 13 posts
OK guy's you've done a tremendous job helping me out so far so hopefully you can help me here!

I've already tried to make a post on the developers website but they seem uninterested in helping me solve this problem.
Here's the link to that if you want to dive right in,
The Game Creators - Forum - View Thread

I'm making a windows forms application for a multiplayer word game and I can't get the networking library to work with a windows forms application. :( This is frustrating me since I cannot continue further without starting to implement these functions.
I'm trying to use a plugin called DarkNet for networking functionality(I can PM it to you if you think it will help).
Unfortunately DarkNet is not managed code so I'm having some trouble linking it.
DarkNet comes with a .dll file but I haven't a clue how to use one, that may be my only option here I'm not sure.

This is my progress so far:

Additional-Dependencies = ptrustm.lib mikenet.lib ws2_32.lib
Ignore-Specific Library: msvcprt;libcmt;atls

Now when I compile I only get 1 linker error, but it makes no sense:
1>AcroGame.obj : error LNK2001: unresolved external symbol "void __clrcall `eh vector destructor iterator'(void *,unsigned int,int,void (__clrcall*)(void *))" (??_M@$$FYMXPAXIHP6MX0@Z@Z)

1>D:\Libraries\Documents\Visual Studio 2008\Projects\AcroGame\Release\AcroServer.exe : fatal error LNK1120: 1 unresolved externals
(Read into the post from the link above to see more information)

Thanks guys I've been going at this for a few days now

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
From what I can recall you must add the mixed-code C runtime to run both managed and native code libraries, which may be including msvcmrt.lib or /clr switch for the MSVC compiler.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
Kyle Joseph Klouzal

Kyle Joseph Klouzal

    Newbie

  • Members
  • PipPip
  • 13 posts
adding msvcmrt.lib to additional includes and it compiles but instantly crashes
An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module.


Additional information: The type initializer for '<Module>' threw an exception.
Debug Output:
'AcroGame.exe': Loaded 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll'

First-chance exception at 0x77671ae6 in AcroGame.exe: 0xC0000005: Access violation reading location 0xb761a239.

First-chance exception at 0x73a9ce49 in AcroGame.exe: 0xC0000005: Access violation writing location 0xb761a23a.

A first chance exception of type 'System.AccessViolationException' occurred in AcroGame.exe

A first chance exception of type '<CrtImplementationDetails>.ModuleLoadException' occurred in AcroGame.exe

First-chance exception at 0x74d8b9bc in AcroGame.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..

An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module.


Additional information: The type initializer for '<Module>' threw an exception.

I'm almost certian the problem is that I cant set /MT because it's not compatable with /clr so the compiler says, and I tried to disable /clr but it needs that to build the forms, I'm at a loss for what to do

#4
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
  • Location:Vancouver, Eh! Cleverness: 200
Ah, I've looked through the thread you have linked. I've no experience with MSVC or managed code, however it looks like you are trying to insert two runtimes.

If you look here:
C Run-Time Libraries (CRT)

Doing /MT and /clr will include two versions of the C runtime library, and will definitely cause issues. Maybe you should remove all dependencies and ignores, such as a new project, and add the /clr (maybe just the switch, leaving ignores and includes alone for the CRT) and then add the necessary .lib for the DarkNet plugin.

I assume this would provide the runtime to run both the managed application you have, and the unmanaged program under one runtime.

Maybe these resources will help:
Mixed (Native and Managed) Assemblies (has a guide to port to /clr switch)

Maybe somebody here with more MSVC knowledge can provide better insight.

Alexander.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#5
Kyle Joseph Klouzal

Kyle Joseph Klouzal

    Newbie

  • Members
  • PipPip
  • 13 posts
Ah, thank you Alexander, those links clarified what I was doing with all the includes and excludes, but no matter how I switch it up I get this demon!
A first chance exception of type '<CrtImplementationDetails>.ModuleLoadException' occurred in msvcm90.dll

First-chance exception at 0x75bab9bc in AcroGame.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000..

An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module.

If I remove the #include to <fullinclude/mikenet.h> it compiles and runs...without networking functionality ^.^*
Again, I can PM you or upload to the main post a copy of DarkNet if anyone thinks looking at the code will help figure out whats happening.. :)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users