Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / unresolved externals error

Author
Message
Ondrej
16
Years of Service
User Offline
Joined: 18th Apr 2008
Location: Slovakia
Posted: 19th Apr 2008 10:23
I need add to my code this line, because i use objects c++, e.g. fin.open, fin.read atc.:


but compiler always report error:
warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
fatal error LNK1120: 2 unresolved externals

How can i resolve this?thx
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 19th Apr 2008 17:47
Use the search facility on "libcmt.lib". You should find a thread or two on this subject.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
bobba
16
Years of Service
User Offline
Joined: 10th Apr 2008
Location:
Posted: 28th Apr 2008 18:34
you cannot use #include <iostream> with dark basic, you must use dbtext and other comands instead
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 28th Apr 2008 19:01
Quote: "you cannot use #include <iostream> with dark basic, you must use dbtext and other comands instead"


Says who? iostream deals with input and output true. But it also deals with file streams which I've used in preference to the GDK commands due to familiarity. No, you can't use them to get input and echo to the screen because the output for GDK isn't standard. But you can use it to output to stdout and other files.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Apr 2008 19:06
Hi Lilith, how do you make linking with iostream possible in your DarkGDK stuff?

I'm running into that linking issue we hear about, and my search have been coming up blank ... seems like some old threads might of got purged Who knows.

Anyways, I'm trying to make a routine that simply APPENDS a text file, and it LOOKS like the DarkGDK routines do not have a decent way to append to an existing file.... Or am I missing something?

Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 28th Apr 2008 19:38
Does it compile without error if you compile it in Release mode? If so, then you're running into the problem that exists only in Debug mode. You have to set /Project/Properties/C++/Code Generation/Runtime Library to /MT instead of /MTd. I'm using fstream for my Grid class, which is a child of my Bitmap class, to write out my configuration. I'm using <fstream> but it's not that different from <iostream>.

The GDK libraries don't appear to have a debug version so you apparently can't compile it in combination with the libraries that do. So you essentially tell the compiler to use the non-debug libraries for the traditional libraries.

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Apr 2008 19:46

Login to post a reply

Server time is: 2024-09-29 19:20:10
Your offset time is: 2024-09-29 19:20:10