TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Building C Projects

191 pointsby rsaarelmover 10 years ago

10 comments

tujvover 10 years ago
By contrast, the Plan 9 C compiler does use the header when linking. Header files contain a prama statement with library name, removing the need for linker flags.<p>See: <a href="http://plan9.bell-labs.com/sys/doc/comp.html" rel="nofollow">http:&#x2F;&#x2F;plan9.bell-labs.com&#x2F;sys&#x2F;doc&#x2F;comp.html</a>
评论 #8565382 未加载
评论 #8566395 未加载
评论 #8565960 未加载
评论 #8565959 未加载
e12eover 10 years ago
&gt; instead of writing yet another wrapper around yet another set of poorly standardised existing tools, I&#x27;m using aimake, a build system I wrote originally for NetHack 4<p>Not sure I&#x27;ll be able to use aimake, as it&#x27;s not invented here ;-)<p>On a more serious note, it sounds a bit strange to claim this isn&#x27;t built on other tools -- he uses various compilers and linkers, and other utilities for installation etc. Eg CMake might not be perfect, but at least I couldn&#x27;t find any kind of rationale for why cmake or tup might not work perfectly fine for the purpose? Maybe I skimmed too quickly?
评论 #8567341 未加载
AceJohnny2over 10 years ago
Considering the glut of C build systems (often built on top of GNU Makefiles) as proof that this is a complicated field, this is a surprisingly undiscussed aspect of programming. Thanks for this link!
paradosover 10 years ago
For the preprocessing part of the problem this might be useful: <a href="https://news.ycombinator.com/item?id=8356100" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8356100</a>
syskover 10 years ago
This is probably the first time I really get what is happening during a build (despite having written a few C programs and Makefiles). Thanks for writing!
cafover 10 years ago
An interesting treatise, however the entire &quot;Standard directory detection&quot; part gives me the willies.
Rapzidover 10 years ago
If anyone ever finds a linux C program that doesn&#x27;t quite do what they need, my advice is this as I&#x27;ve had great success with it in the past modifying ntfs3g and the like..<p>Download the source package and open it in NetBeans! For what I needed clicking build JUST WORKED. For my purposes it was a short trip to adding some new arg commands and modifying functionality, then building and packaging it back into a .deb ready to go. I&#x27;m not sure if this is still the case, but NetBeans was pretty fantastic for this just 2 years ago.
评论 #8567602 未加载
las_casesover 10 years ago
For goodness sake, keep writing these type of articles! I am now digging into &quot;Memory management in C programs&quot; and I hope the rest of the articles are as good as these two.
Someoneover 10 years ago
<i>&quot;The algorithm used by the vast majority of preprocessors is very simple: the preprocessor has a hardcoded list of directories, which the user can add to, and the preprocessor will scan them in sequence until it finds the file it&#x27;s looking for. In the case of include &quot;file.h&quot;, it will also scan the directory containing the source file.&quot;</i><p>At least for gcc, that is not quite correct. It also has a <i>list</i> of user directories.<p>The user list starts as a list containing only the current directory, but can be extended with command-line options. See <a href="https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html" rel="nofollow">https:&#x2F;&#x2F;gcc.gnu.org&#x2F;onlinedocs&#x2F;cpp&#x2F;Search-Path.html</a>
gnuvinceover 10 years ago
&gt; C is a compiled language[...]<p>Not off to a great start :&#x2F;
评论 #8565627 未加载