Hot answers tagged

15

If you link to a GPL lib then you have created a derived work and your code must be GPL - this is different to LGPL code which specifically allows dynamic linking of differently licensed code. The system libraries including libc, are all LGPL. There is also a special exemption for the Linux kernel headers and libgcc (the library implicitly called to by the ...


15

Linking code (using the linker, e.g. ld often started by gcc or gfortran compilation commands) written in two different languages is implementation specific. It is often called foreign function interface. It depends upon calling conventions specific to the implementations. On Linux, with code compiled by gfortran and gcc (both from the GCC compiler) is ...


12

While you can include .cpp files as you mentioned, this is a bad idea. As you mentioned, declarations belong in header files. These cause no problems when included in multiple compilation units because they do not include implementations. Including a the definition of a function or class member multiple times will normally cause a problem (but not always) ...


9

I think all they're saying here is that there are two components (one containing MODFLOW 2000 and MT3DMS 5.0, and the other containing NGSA II, with the two components being written in different languages) which simply use files as their interprocess communication (IPC) mechanism - hence the two components are logically linked while not being linked as in ...


9

Because the license demands it for your use case (e. g. lib being LGPL vs. your project being proprietary). Because you want to decouple deployed app and lib version. Because you aren't absolutely sure the lib is bug-free. Because the target distribution(s) provide(s) the lib through their packet manager. Because the lib is used by more than one binary and ...


7

For a small-systems, hardcore embedded OS, the first option is the only really viable one. The problem is that for nearly every chipset, you would have to make small adjustments to the interfacing with the hardware and that gives you a high risk that the OS needs to be re-compiled for the new chipset. So, the first option is not only the easiest for you, ...


7

Read more on the role of the C and C++ preprocessor, which is conceptually the first "phase" of the C or C++ compiler (historically it was a separate program /lib/cpp; now, for performance reasons it is integrated inside the compiler proper cc1 or cc1plus). Read in particular the documentation of the GNU cpp preprocessor. So in practice the compiler ...


7

By many different methods, not easily reduced to just a few paras. Here are some, in roughly ascending order of abstraction. The OS implements one or more privileged instructions (trap, syscall, etc). The compiler emits code to translate certain language constructs into those instructions. [ASM] The OS provides an API in a form compatible with the external ...


6

Require that people have gas. This is the preferred way for most OSS software, and you make life for potential distributors a lot easier by sticking to the standard. The rationale behind the standard is a variation of DRY: If everyone would be packaging dependencies with their source packages, any distribution would face a myriad of similar libraries with ...


5

In theory it should be fine. The BSD license is a Permissive free software license which means it doesn't insist on anything using it being shared in the same way. The BSD license only says that redistribution and use in source and binary forms are permitted (subject to certain constraints) but doesn't mandate how that should be other than that the ...


5

http://en.wikipedia.org/wiki/BSD_licenses You have several versions of the BSD license. It's one of the simplest licenses, so you should simply read it. Here is the "longest one": Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of ...


5

Both gcc and g++ are frontends to the GNU compiler collection. You should use the former for compiling and linking C code, and the latter for performing the same actions on C++ code. One of the strongest arguments for maintaining the distinction is that C is not a subset of C++. If you link using g++ it will automatically link in the C++ standard library. ...


5

The idea of headers is that we separate the public interface (i.e. declarations) from internal implementation details (i.e. the actual method bodies). This split has all kinds of advantages: There's a helper function I need? Let's just put it into the .cpp file, and outside code cannot see it. I can also do things like using std without interfering with ...


4

You're basically right so far. The magic is that the C world has packaging systems too, and they come with your Operating System! Now, before you get too excited, this depends on your platform. Modern Linux distributions have package managers and the more popular libraries are distributed in binary form by these systems. For example, a program that needs ...


3

Bat files execute and do not link. Yes you can execute GPLed code from non-GPLed code. The only thing you will need to do is if you distribute FART, make sure you distribute it's source code as well. See semantic A/V for a popular example. Or many video games. As long as you give credit and don't violate the rules about distributing binaries without ...


3

Yes. GPL covers distribution/conveyance only. As your other comment suggests, you want to restrict your users. It doesn't matter that the script is sent over a network. Conveyance (the GPL defined term) requires the transfer of covered works from one legal person to another. Computers are not legal persons. This is critically important to LGPL. Those ...


3

On Unix and Linux, you can see which libraries are linked with the ldd command. The output from an empty c++ program I made as a test was: linux-gate.so.1 (0xb77ba000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb76ae000) libm.so.6 => /usr/lib/libm.so.6 (0xb7668000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb764c000) libc.so.6 => ...


3

Let me first say that I agree with Bart's answer, but I want to argue for option (2+). Assume that your OSS project is a success, that you have some dozens (or hundreds) of developers using your OS, and you are busy working on V2, which has some breaking changes with V1. A few users have weird problems you can't reproduce, which you suspect are related to ...


3

In the general case, you are correct in that you can't link to a GPL library, distribute your code, and then not release your code as GPL. However, there is the System Library Exception which is how folks link against Linux libs and still release their product under non-GPL licenses. Another exception is when the two licenses are compatible with each ...


3

The term comes from assembly language. I can't verify the etymology, but my guess is that the name comes from the other use of the section. Whereas the .data section denotes variables that can change during the course of execution, the .text section contains data that doesn't change during execution, allowing it to be put into ROM if needed. That makes it ...


3

Short answer: you're not forced to release your software under GPL; you can do it because you're making interoperability with GPL software and this doesn't make your software a derivative work (but if you want to feel more safe then don't distribute Git inside your application package, a dependency is OK). Dirty workaround to avoid licensing headaches: note ...


3

TLDR; Should you add the source? YES Should X add the source? DEPENDS Here comes the why... Back in the day, compilation time was an issue even smaller projects had. Compiling your sources and never worrying about caching compiler results was definitely appealing to some. That's one point for libraries irrelevant to you. Another important one is ...


2

Firstly, is it "bad" to compile C programs with the g++ compiler? Define "bad". There are a few things which may cause a valid C program to compile in C++ with a different semantic, if my experience is pertinent, you have more chances to find UB handled differently when changing the version of your C compiler than to meet them. A C++ compiler will not ...


2

OS X contains many components that are BSD-licensed. This implies that all Mac applications are directly or indirectly linked to BSD-licensed libraries. Moreover, OS X itself is available on Mac App Store. So I assume that BSD license is compatible with Mac App Store.


2

I think you have totally misunderstood the concept of a runtime libray. The runtime is an executable, it does lots of work allocating storage, opening sysout, syserr etc and setting up various traps and signals before your main is called. Thereafter it performs all your basic IO via fopen(), fread(), etc. calls, handles any memory management via "malloc()" ...


2

To me, the answer is very simple: to save resources like space. If all N applications on a system need library X, and all of them statically link this library into their executables, then there is (N - 1) (size of X) bytes you are wasting. The reason why statically linking has survived at all is precisely because there is no system that can guarantee that ...


2

Libraries are specified during linking, rather than compiling, and thus don't provide functions names during compilation. Also, the library object files may not have all the information necessary for the compilation stage (such as the number and types of arguments), depending on what features are available in the object format and which features the compiler ...


2

The answer by Andriano Repetti is perhaps correct but you should ask a lawyer (and I am not a lawyer neither), or perhaps the FSF or the copyright owners of the gitsoftware. Be aware that some people think (and I believe that) if you adapt some GPL software (even if you publish your adapted source code under GPL!) to communicate with your own proprietary ...


2

(I am having a Linux oriented point of view; I don't know Windows, but its DLL could be slightly different than Linux ELF shared object dynamic libraries) A shared library is useful as soon as you might have more than one process or one program using it: e.g. two different programs using the same library, or perhaps even two different processes using the ...



Only top voted, non community-wiki answers of a minimum length are eligible