Tag Info

Hot answers tagged

10

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 ...


8

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) ...


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 ...


6

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 ...


5

Static With a statically linked application, everything that you need to run the application is part of the application itself. It depends on nothing else. If there is a fatal error in a dynamically linked library, it doesn't 'care'. If the dynamically linked version of a library it uses isn't there (someone accidentally removed /lib on a unix system?) ...


5

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 ...


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 ...


5

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, ...


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

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 ...


4

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 ...


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

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 ...


2

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 ...


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

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 ...


1

It is entirely possible to use libraries without using the headers. Here is an example using just the C library: int puts(const char *); int main() { puts("Hello, World!"); } The advantage of header files is to provide the function signatures and structure bodies for you. In the case of the Standard C Library itself, the standard explicitly forbids ...


1

First off, have you looked into the Optimization on the XC8? It may require a paid license, but it could also get you down below a page, keeping you from having to have those extra bits dangling onto the next page. Another thing to note is that sometimes the X series compilers will do very, very strange things under optimization settings. Thoroughly test ...


1

Due to C++'s multiple-unit build model, you need a way to have code that appears in your program only once (definitions), and you need a way to have code that appears in each translation unit of your program (declarations). From this is born the C++ header idiom. It's convention for a reason. You can dump your entire program into a single translation unit, ...


1

There are advantages to each, as is the case for pretty much everything in software development. Say I am developing a Windows application, that involves some sort of cryptographic feature. Because those functions are complicated, and rolling your own is almost always a bad idea, I instead use the libraries provided by the Windows platform. Pretend, after ...


1

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 ...


1

From reading the Wikipedia page on the MPL, it seems to me that you can "link from code with a different license". The license is even marked as such in the summary box. If you read the actual license, in its 2.0 version, section "Distribution of a Larger Work", you can read that you have to keep the library in question under MPL, regardless if you ...


1

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 ...


1

For any compiled language, the language specifies a run-time environment that you rely upon. For example in C and C++, you expect to be able to pass command-line arguments, that there will be standard output, standard error and standard input files. You expect execution to begin at main. The run-time library does all those things for you. It also does things ...


1

A library is basically a collection of object files. An object file is basically a list of function names and signatures, together with the machine code instructions. When statically linking, when the linker sees a function call, it finds its name and signature in the object files, copies the machine code instructions to the exe, and changes the function ...


1

In general, GPL'd and proprietary (non-GPL'd, closed-source) code can only be used together when they can be reasonably considered to be separate applications. In practice, what this means is that: The two applications must communicate at arms length with each other and Each application must be capable of running without the other. So if I write a ...


1

If you're wondering whether to link statically or dynamically you have to first determine how your application will be used. Dynamic linking is less resource intensive, so this is a good option if your application will be used by many other processes. Dynamic linking also allows you to propagate bug fixes without having to reship things. Static linking is ...



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