Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How to compile without net framework?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Wed Dec 30, 2009 3:22 pm    Post subject: How to compile without net framework? Reply with quote

Everything I compile requires net framework to run. How can I avoid this?

Edit: I compile with Visual Studio 2008. I searched in compiler settings but I can't understand them.


Last edited by kot1990 on Wed Dec 30, 2009 3:30 pm; edited 1 time in total
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Wed Dec 30, 2009 3:29 pm    Post subject: Reply with quote

By not using a language that requires it for operation...
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Wed Dec 30, 2009 3:33 pm    Post subject: Reply with quote

I create simple console application in C/C++ and on computer that has not net framework it won't run, I compile in release mode . When I compile with devc++ it runs but the application is larger in file size. In VS it gives a release file of 4kb but in devc++ is 22kb. Ow, I forgot to mention that I create an empty project without any dependencies.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Dec 30, 2009 3:50 pm    Post subject: Reply with quote

look in project settings -> C/C++ -> code generation
you're probably using dll
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Wed Dec 30, 2009 4:01 pm    Post subject: Reply with quote

Ok thx, now I am at work now, when I go home I will try that.

Edit: Thx slovach I found it. For anyone who has the same issue: project propeties -> C/C++ -> code generation and change runtime library from Multi-Threaded DLL (MD) to just Multi-Threaded (MT) and recompile. But there's nothing about net framework there Evil or Very Mad Evil or Very Mad Evil or Very Mad . How will someone know that? and most maybe ignore that because when you install visual studio packets like net framework are autoinstalled, but when you want to run your program on another computer a strange error appears on runtime, what the....
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Wed Dec 30, 2009 9:49 pm    Post subject: Reply with quote

Don't use the managed framework?

New Project -> C/C++ -> Win32 -> Console

Compile with the code generation multi-threaded and the user won't even need the visual c++ redistributable libraries.

_________________
Back to top
View user's profile Send private message
igoticecream
Grandmaster Cheater Supreme
Reputation: 0

Joined: 23 Apr 2006
Posts: 1807
Location: 0x00400000

PostPosted: Wed Dec 30, 2009 10:23 pm    Post subject: Reply with quote

kot1990 wrote:
I create simple console application in C/C++ and on computer that has not net framework it won't run


are you using unmanaged C++ right?

_________________
+~
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Thu Dec 31, 2009 5:18 am    Post subject: Reply with quote

igoticecream wrote:
are you using unmanaged C++ right?


managed is the one that uses .net framework right? Yea I am using unmanaged C++, I want to compile an executable that will run directly, not bytecode or other shit. Which one is better/faster?
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Thu Dec 31, 2009 6:02 am    Post subject: Reply with quote

kot1990 wrote:
change runtime library from Multi-Threaded DLL (MD) to just Multi-Threaded (MT).
That's not .NET framework. That's the CRT, C Runtime library. To avoid that add /nodefaultlib to your linker, define your own mainCRTStartup()/WinMainCRTStartup(), make sure that the exceptions are off, and dynamically link the runtime library.

Also, if I were you, I'd avoid static linking to the runtime library, because it makes your exe huge and is waste of space.

EDIT: Oh right, remember that you'll lose all the CRT functionality, so better to stick to winapi :)
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Dec 31, 2009 6:14 am    Post subject: Reply with quote

pretty sure that the CRT is actually a standard system file, so you shouldn't actually run into trouble doing that in most cases. maybe, though it's a pretty common 'trick' for getting very tiny exe's.

don't think you can rely on this with the CPRT though
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Thu Dec 31, 2009 6:30 am    Post subject: Reply with quote

Jani wrote:
That's not .NET framework. That's the CRT, C Runtime library. To avoid that add /nodefaultlib to your linker, define your own mainCRTStartup()/WinMainCRTStartup(), make sure that the exceptions are off, and dynamically link the runtime library.

Also, if I were you, I'd avoid static linking to the runtime library, because it makes your exe huge and is waste of space.

EDIT: Oh right, remember that you'll lose all the CRT functionality, so better to stick to winapi Smile


lol you're right.,, what is requiered is C++ redistributable package by microsoft and not net. framework xD. Explain a little better what is a runtime library, I don't understand and why is necessary? It sounds like somethink that is required for the program to run in runtime, but what it contains and what it does?
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Thu Dec 31, 2009 6:51 am    Post subject: Reply with quote

slovach wrote:
pretty sure that the CRT is actually a standard system file, so you shouldn't actually run into trouble doing that in most cases.
Depends on what are you writing. If you're able to code in WinAPI only, you're fine without it. And everything on Windows should be doable in WinAPI.

kot1990 wrote:
Explain a little better what is a runtime library, I don't understand and why is necessary? It sounds like somethink that is required for the program to run in runtime, but what it contains and what it does?
If you use any standard C functions, you'll be using the runtime lib. If you stick to WinAPI, you'll be fine without it. CRT is the lib implementing the C standard library.

Also, check the WinAPI equivalents and here's a nice site.
Back to top
View user's profile Send private message
kot1990
Expert Cheater
Reputation: 1

Joined: 06 Sep 2009
Posts: 131
Location: Greece

PostPosted: Thu Dec 31, 2009 11:41 am    Post subject: Reply with quote

thank you for all this info. So runtime libraries are like dlls.
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Thu Dec 31, 2009 3:27 pm    Post subject: Reply with quote

Jani wrote:
If you use any standard C functions, you'll be using the runtime lib. If you stick to WinAPI, you'll be fine without it. CRT is the lib implementing the C standard library.

Also, check the WinAPI equivalents and here's a nice site.


If you're using C++, you won't even touch those functions. If you're using C, you should stop using the worst C compiler on the planet.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Dec 31, 2009 6:11 pm    Post subject: Reply with quote

Jani wrote:
slovach wrote:
pretty sure that the CRT is actually a standard system file, so you shouldn't actually run into trouble doing that in most cases.
Depends on what are you writing. If you're able to code in WinAPI only, you're fine without it. And everything on Windows should be doable in WinAPI.

kot1990 wrote:
Explain a little better what is a runtime library, I don't understand and why is necessary? It sounds like somethink that is required for the program to run in runtime, but what it contains and what it does?
If you use any standard C functions, you'll be using the runtime lib. If you stick to WinAPI, you'll be fine without it. CRT is the lib implementing the C standard library.

Also, check the WinAPI equivalents and here's a nice site.


Many of the Windows functions rely on the CRT afaik

HeapAlloc ultimately calls malloc()
so does new in C++ I think.


you can go hog wild by linking against msvcrt.lib
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites