ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Tue Mar 02, 2021 5:25 am

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
 Post subject: asking some info about C
PostPosted: Fri Feb 05, 2021 12:12 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 386
im trying to learn c (old and classic C, not c++ or c#)
my question is that where can i find a set of full documents about header files (.h files for #include)?

i'm also using tcc (tiny c compiler), but i found out that this compiler has some minor problems, is there any portable c compiler that i can keep it in flash drive without any installation? what complier should i use?

note: sorry for my bad grammar


Top
   
PostPosted: Fri Feb 05, 2021 4:54 pm 

Joined: Sat Apr 13, 2019 7:45 pm
Posts: 7
As a compiler you may try PellesC


Top
   
PostPosted: Fri Feb 05, 2021 5:58 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 386
peter2005 wrote:
As a compiler you may try PellesC

thank you for your answer
i also need to know that all of complied c codes (compiled to exe or dll) can run stand-alone or not, i choosed tcc at first, because it was stand-alone and not reqired any runtime (maybe this is a stupid question since c is free-module and its up to programmer code that may required external libraries), but for example, C# needs runtime to work


Top
   
PostPosted: Fri Feb 05, 2021 9:35 pm 

Joined: Sat Apr 13, 2019 7:45 pm
Posts: 7
Shokoniraya wrote:
peter2005 wrote:
As a compiler you may try PellesC

thank you for your answer
i also need to know that all of complied c codes (compiled to exe or dll) can run stand-alone or not, i choosed tcc at first, because it was stand-alone and not reqired any runtime (maybe this is a stupid question since c is free-module and its up to programmer code that may required external libraries), but for example, C# needs runtime to work


I checked my compiled files, there is by default only kernel32.dll dependency.


Top
   
PostPosted: Sat Feb 06, 2021 1:09 am 
User avatar

Joined: Sat Dec 27, 2014 8:49 pm
Posts: 203
You can find an archived copy of the final draft for the current C standard (C17) here for free:
https://web.archive.org/web/20181230041 ... d_fdis.pdf

This covers literally everything to know about the language, as it is the standards for C.

Shokoniraya wrote:
i also need to know that all of complied c codes (compiled to exe or dll) can run stand-alone or not


For C and C++, this depends on your compiler/link being used. If they offer static linking, then you can statically link to the runtime being used which will make your apps / dlls able to run without needing a separate runtime. This is not dependent on the language itself.

_________________
My personal site: http://atom0s.com
Donations can be made via Paypal: Click Here


Top
   
PostPosted: Wed Feb 10, 2021 9:28 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12004
And if you use gcc remember to ever add -static to the command you use for building.
Personally I also like -mtune=generic that makes your exe compatible with older CPUs and -m32 to make it 32bit (for retro-compatibility with old WinXP/7).

If curious, the following are the main gcc switches I use for building quickbms:
Quote:
-s -O2 -Wl,--enable-stdcall-fixup -Wl,--large-address-aware -mtune=generic -fno-unit-at-a-time -m32 -Wl,--stack,4194304 -fstack-protector-all -Wstack-protector -fwrapv --param ssp-buffer-size=1 -fno-strict-overflow -Wformat-security -Wl,--dynamicbase -Wl,--nxcompat -Wl,--enable-auto-image-base -Wl,--enable-auto-import -fno-omit-frame-pointer -static -Wall

They are used for smaller exe size, optimized instructions, stack security, larger stack, dynamic locations and so on.

Older versions of gcc create smaller executables.


Top
   
PostPosted: Thu Feb 25, 2021 6:15 pm 
User avatar

Joined: Sat Sep 15, 2018 5:22 am
Posts: 386
sir aluigi, i want to know that is there any portable gcc?


Top
   
PostPosted: Fri Feb 26, 2021 9:33 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 12004
gcc is multiplatform and on Windows it's called Mingw gcc.
What you need is using MSYS2:
https://www.msys2.org/

It's a complete setup made with packages (pacman) so it's super easy to install and update everything everytime you desire.
Additionally it runs the latest version of gcc 10 and has both 32bit (mingw32) and 64bit (mingw64) versions.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC


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 post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited