Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [linking]

The tag has no usage guidance.

0
votes
4answers
138 views

Is it better to use the linker to compile multiple C++ files or better to include them as a header file

Assume we have two files a.cc #include <iostream> int timesTwo(int in); int main(){ std::cout << timesTwo(5) << std::endl; return 0; } b.cc int timesTwo(int in){ return in*2;...
1
vote
2answers
218 views

Is it good practice to statically link libstdc++ and/or libgcc when creating distributable binaries for Linux?

Context: I have an open source project which uses JNI. While it's possible to build it yourself, I expect most users will use standard Java tools like Maven, Gradle, or SBT to download the JAR, which ...
0
votes
1answer
191 views

What does the 'emulation' do in the Linker?

I am looking into assembler and I am trying to understand the whole compilation process. During the linking step I use: ld -m elf_i386 -s -o hello hello.o Everything works fine, but I do not ...
-1
votes
1answer
56 views

Creating a “lite” version of shared library on Linux/POSIX in addition to full version

I have a large shared library, a collection of functions created from numerous .a files into libeverything.so. The code for the .a files is obviously compiled with -fPIC. I also have libeverything.a ...
0
votes
2answers
97 views

How should I include libraries that I want to statically link against in my repository?

I know how to actually do the linking, but I'm not sure what the best practice is for actually getting those libraries downloaded and into my repository. Should I just straight-out include them using ...
5
votes
4answers
958 views

What are the benefits of using meta tag/JavaScript redirection over HTTP header redirection?

Upon inspecting Twitter's URL shortening service http://t.co, I noticed that, instead of redirecting to the goal URL using a Location HTTP header and a 3xx HTTP status code, it redirects using the ...
1
vote
1answer
54 views

Union wildcard sections in the linker

I'm trying to union many functions so that they will all run in the same small section of ram but be loaded from elsewhere. I have done this for several sections explicitly with a sections command ...
10
votes
2answers
412 views

Apollo-11: Using inclusion instead of a linker

Recently digitized and turned into a repo, the original Apollo 11 guidance computer source code has been made available for viewing on Github. In MAIN.agc, the repo author comments that they ...
0
votes
2answers
143 views

Standard for implementing GUIs for command line utilities

I wrote a command-line utility and I want to develop a GUI for it. I saw that almost every tool on linux comes command-line, and it eventually has a GUI which interacts with the command line utility ...
15
votes
4answers
546 views

Should I add the source of libraries instead of linking to them?

I'm relatively new to C++, so I'm not sure how I should best handle small dependencies (e.g., a scripting language, or a JSON/YAML/XML Parser). Should I create separate projects and link them as ...
2
votes
2answers
434 views

Why use dynamic linking for less-popular libraries?

I know the difference between static and dynamic linking. I know why the notion of a library is important. And I even know why you'd want to link something like OpenGL, platform-specific APIs, or ...
4
votes
1answer
356 views

How would I organize a C project that uses libraries?

First off, I'm relatively new to C - I know the language somewhat, but never looked too much into the whole build process. From what I'm seeing, if I want to use a third party library and have it in ...
2
votes
3answers
4k views

Linking two or more different programming languages

I would like to ask how optimizer software written in C/C++ can be linked to simulator software written in FORTRAN or any other language. I have copied the section of journal article of Singh and ...
4
votes
2answers
5k views

Can I distribute a GPL executable (not a library) in a closed-source application? [duplicate]

I want to write a closed-source desktop application that uses a piece of GPL software in the background. I know that I can't link to a GPL library (libgit.a). But if I embed a GPL application (git....
0
votes
2answers
103 views

The need for header file when including libraries?

When compiling an application that depends on a library we have to specify the include the library and also the header file. Since the library binary contains the actual function names couldn't the ...
1
vote
2answers
671 views

Microchip XC8: How to pack code against an upper limit?

I have a project for a PIC16F1454 that needs some custom linking. Basically, I've separated my code into two parts that can be downloaded separately in the field and thus update (almost) all of the ...
18
votes
7answers
38k views

Why do we need to include the .h while everything works when including only the .cpp file?

Why do we need to include both the .h and .cpp files while we can make it work solely by including the .cpp file? For example: creating a file.h containing declarations, then creating a file.cpp ...
5
votes
1answer
525 views

How do programming languages integrate with OS runtimes

For example, Objective-C, Swift and Ruby (i.e. RubyMotion) integrate with the Cocoa framework. Is this done via linked libraries? I assume they call functions in existing binaries instead of simply ...
0
votes
1answer
314 views

Linking a GPL executable from proprietary .bat script [duplicate]

Licensing question - am I allowed to use a GPL binary executable (.exe) in my copyrighted .bat script? Namely I want to use FART command line tool (find & replace text in files) in an install ...
5
votes
3answers
2k views

Why are there two different kinds of linking, i.e. static and dynamic?

I've been bitten for the n-th time now by a library mismatch between a build and deployment environment. The build environment had libruby.so.2.0 and the deployment environment had libruby.a. One ruby ...
3
votes
1answer
419 views

In c++, difference between linking a class object and just including it.

this is my first time here. I'm a physics grad student and I've recently found a research group to work with. We study statistical mechanics using computer models, so there is a significant ...
0
votes
1answer
404 views

Dynamically loading MPL library in closed source application

I am dynamically loading an MPL 2.0 licensed library to use some of its exported functions in a feature. My code does not distribute the library, it simply detects it's presence on the system and uses ...
4
votes
2answers
137 views

How should an embedded OS be combined with user code?

As a side-effect of an embedded project I've been working on, I've developed a small operating system for an ARM processor. While the OS and my user code are in separate directories and have clean ...
-1
votes
4answers
385 views

What exactly is my program “linking” with overall? [closed]

I have heard that my C++ programs "need to link with the C++ library/runtime". However, the C++ runtime is just the compiler inserting stack operation code in to the image, or "boilerplate" code if ...
3
votes
2answers
2k views

How exactly does a program (executable image) and library (pre-compiled image) “link” together?

I know very well of the difference of static versus dynamic linking. What I want to know is, when linking statically (with a library like Winmm.lib on Windows), how does the linker "link" the pre-...
4
votes
2answers
404 views

May non-GPL-compatible scripts be linked at runtime to a GPLv3 library, by that (GPL) library itself?

First of all, pardon the title, as it's not very clear. I have an application I am writing that is GPLv3, and is in Java, which means that classfiles are generated and linked to for general operation. ...
0
votes
4answers
158 views

How could distribution and reuse flexibility be hurt by linking my program as a static or dynamic library?

I'm writing a small program that I want to be able to link with other programs. I also intend to run it from a command line interface, and maybe later with a GUI interface. How could distribution ...
13
votes
1answer
7k views

Why is the code section called a text section?

The section of an executable that contains code is sometimes called the .text section. In segmented memory architectures, a segment mapped as code is sometimes called a text segment. The unix error ...
7
votes
2answers
2k views

Questions about linking libraries in C

I am learning C (still very much a beginner) on Linux using the GCC compiler. I have noticed that some libraries, such as the library used with the math.h header, need to be linked in manually when ...
30
votes
3answers
29k views

Can I link to a GPL library from a closed source application?

Okay, before everyone goes shouting about duplicate questions, yes, I've already seen several questions like this here. But none answer the question. If I link against a GPL-ed library without ...
3
votes
3answers
1k views

Is BSD-License compatible with Apple AppStores?

I would like to know if it is possible to make an application to be sold on Apple AppStores that is linked (during compilation) to a BSD-licensed library.
1
vote
1answer
63 views

Can thesaurus items have more than one USE relation?

I want to model a Thesaurus using the ANSI/NISO standard relation description like "broader term", "narrow term", etc. (see this Wikipedia article for details). Is it valid for a Thesaurus item in ...
1
vote
2answers
102 views

Methods on packaging an assembler with compiler

I am planning on creating a compiler that will generate assembly, that is as far as I really want to go with this project (don't want to create the object files myself or any of the machine code). ...