question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to build pure C programs?

See original GitHub issue

Although in BUCK:

  • srcs only contains .c source files, no c++ files.
  • compiler_flags contains "-std=c11"

the output still links against libstdc++.

How to write buck rules for pure C programs (without linking libstdc++)?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
weakishcommented, Jul 28, 2017

@njlr Thanks a lot! ld = /usr/bin/gcc does do the trick.

1reaction
njlrcommented, Jul 28, 2017

I think that setting the linker to gcc in .buckconfig does the trick.

Here is my ldd output:

$ ldd ./buck-out/gen/xkcd936
	linux-vdso.so.1 =>  (0x00007fff4afba000)
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2239b6d000)
	/lib64/ld-linux-x86-64.so.2 (0x0000559044bf0000)

I believe these are just C libraries?

All of the code is in my fork.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building your own C application - OpenGL Tutorial
So, this tutorial will explain how to build your own C application from scatch. But first, you need a basic knowledge of what...
Read more >
Walkthrough: Compile a C program on the command line
In the developer command prompt window, enter cd c:\ to change the current working directory to the root of your C: drive. Next,...
Read more >
How to create C programs using latest Visual Studio 2019
In this video, I will show you the proper way to create C programs using Visual Studio 2019 For more in depth learning...
Read more >
What are the differences between using pure C with a C ...
Always use a C compiler for C code, not C++. C++ isn't perfectly compatible with C. A few others: In C, declaring void...
Read more >
Developing C programs on Windows
You will need two things to create C programs: a text editor to write the source code for the program and a compiler...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found