#CRT

56 messages · Page 1 of 1 (latest)

amber prairieBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

hushed prawn
#

did you turn off linking of the crt?

#

I don't think so?

#

that just changes which version of the crt is used

#

why would you want to?

#

the problems up there are precisely because it's failing to link stuff that's defined in the crt

#

except you're using them, otherwise there'd be no linker errors

#

the linker will only import stuff you actually use

#

you use operator new. that's defined in the crt.
you use exceptions. the exception mechanism heavily relies on the crt.

#

you are probably using crt functionality that internally uses those

#

WriteConsole for example

#

if you use std::cout or smth

#

then you're using that

#

k^^

#

I mean

#

you can use heapalloc and stuff

#

but that's just what the crt uses internally as well

#

yeah well, the way things are packaged is not perfect and does not allow the linker to remove absolutely everything that's not necessarily used. that typically doesn't matter at all

#

I get it but I'm not sure that not linking the crt is a good option. you won't be able to use a lot of stuff

#

the crt does a lot you might not be aware of

#

for example, if your main function uses argc and argv, the crt provides those

#

no exceptions, no pure virtual functions, no dynamic_cast

#

well, you need to remove the .lib from your link dependencies

#

yeah, you want /NODEFAULTLIB

#

yes

#

yeah

#

you'll need to implement those yourself ofc

#

yes

#

wdym

#

you can't call free(), hot would that work?

#

k^^

#

well if you have your own free then yes

#

but the signature also doesn't match what the linker is searching for there

#

there are many different opetator new and delete functions

#

maybe, impossible to tell

#

delete does more than just free memory

#

it also calls destructors

#

operator delete is not the same as delete

#

just use new and delete

#

you just have to provide all the necessary operator new and delete functions

#

yeah but there's many more than just those needed

#

sec

#

here's a list

#

you need to implement all these and all their corresponding opetator delete functions

#

well, everything as far as new and delete goes ^^

#

then you don't need them yes

#

well, I guess you defined it twice ^^

hushed prawn
#

?

#

it tells you the size of the thing to free

#

you don't have to use it

#

it's there because having that info can allow for a more efficient implementation

amber prairieBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.

amber prairieBOT
#

This question thread is being automatically marked as solved.