I'm having trouble understanding how compilers and linkers work and the files they create. More specifically, how do .cpp, .h, .lib, .dll, .o, .exe all work together? I am mostly interested in C++, but was also wondering about Java and C#. Any books/links would be appreciated!
...
I am new to Automake and I am attempting to compile without linking. My goal is to generate a simple Makefile as shown below using Automake.
CFLAG = -Wall
build: Thread.o
Thread.o: Thread.cc Thread.h
g++ $(CFLAG) -c Thread.cc
clean:
rm -f *.o
My attempt so far has brought me to the following Makefile.ac.
noinst_PROGRAMS =...
Hello,
In Linux, downloaded a program source and want it to be statically linked.
Have a huge Makefile there,
I
./configure
make
to compile.
prehpes it's a bit too general to ask, but how can I make the binary statically linked?
Thanks.
EDIT: the reason for this is wanting to make sure the binary will
have no dependencies (or at le...
I have a static library that I want to distribute that has includes Foo.c/h and someone picks it up and includes my static library in their application.
Say they also have Foo.c/h in their application. Will they have linking errors?
...
Hi all!
I have implemented a shared library in Linux and try to test it, but I get an error "undefined reference to `CEDD(char*)'".
I use Eclipse with following parameters:
Path to include files (here is
everything ok)
Path to the library
and its name. Path is correct and the
name is WISE_C (full name:
libWISE_C.so)
My Code:
Test...
Hi,
We have a c file called dbookpy.c, which will provide a Python binding some C functions.
Next we decided to build a proper .so with cmake, but it seems we are doing something wrong with regards to linking the external library 'libdbook' in the binding:
The CMakeLists.txt is as follows:
PROJECT(dbookpy)
FIND_PACKAGE(PythonInterp)...
I was trying to do something like this in a makefile:
program.exe: ui.o main.o
gcc ......etc
ui.o: window1.o window2.o
gcc -c window1.o window2.o -o ui.o #this doesn't want to work
window1.o: window1.c window1.h window1_events.c window1_controls.c ...
gcc -c window1.c window1_events.c window1_controls.c... -o window1.o
window2....
Hi folks...here's the situation I'm looking for feedback on:
At work, one of my responsibilities is maintaining a couple of legacy apps, one of which we'll call "LegacyApp." It's always been compiled with VS 6.0. (And isn't touched much these days.)
It uses an API that provides access to some specialized hardware. This API is produc...
Hey Folks i am trying to compile this C++ program:
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <Windows.h>
#include "Validate.h"
JNIEXPORT jstring JNICALL Java_Validate_takeInfo(JNIEnv *env, jobject obj,
jstring domain, jstring id, jstring idca, jstring password)
{
const c...
Hi all: quick question: I'm in a situation where it would be useful to generate my C++ executable using only 'gcc' (without g++). Reason for this is that I have to submit the code to an automatic submission server which doesn't recognize the 'g++' (or 'c++', for that matter) command.
In my experiments, while I'm compiling gcc works well...
I am working on a c++ project that links to a static library. However, I want to use intel's TBB, which is only available as a dynamic library. I tried to set this up in visual studio but I can't get it to work. Does anyone have detailed directions to do this if it is possible?
...
I am linking with a number of 3rd party .lib files, and I get a large number of LNK4099 warnings at link time. It appears that this warning message cannot be supressed, so I believe that if I remove all debug information from the .lib files, the warning will not be shown. Is there a way to remove the debug information? These are librarie...
Hi,
I am working on an application written in C. One part of the application should embed python and there is my current problem. I try to link my source to the Python library but it does not work.
As I use MinGW I have created the python26.a file from python26.lib with dlltool and put the *.a file in C:/Program Files (x86)/python/2.6/...
Hi,
I want to create a shared library from several static libs using GCC under OS X.
In some static libs, there's no code in shared library call it, I just want to export the symbols in these static libs. This works under debug mode, but doesn't under release mode (especially when I enable the dead code striping). I can understand the ...
Hi all,
IDE had been working very well, until today.
When I try to compile my priject I get this :
[Linker Error] Unable to open file 'CHARTGROUPFRAME.DFM'
CHARTGROUPFRAME.CPP Unit is a part of a project, so this is bug of course.
BCB support seems to be pretty much incompetent so far , so I've figured maybe I'll have better l...
I'm trying to link to a shared library with a template class, but it is giving me "undefined symbols" errors. I've condensed the problem to about 20 lines of code.
shared.h
template <class Type> class myclass {
Type x;
public:
myclass() { x=0; }
void setx(Type y);
Type getx();
};
shared.cpp
#include "shared.h"
template <cla...
Hi;
I am reading "Advanced Mac OS X Programming" by Mark and Aaron. I can't get one terminal statement to work correctly :
cc -g -o useadd -F./Adder/build -framework Adder useadd.m
It's on page 45 - Chapter 3 (Libraries). As you can see, I am trying to link useadd.m against a framework created using Xcode. When I run this command, ...
I compiled with gcc
gcc -l. 'net-snmp-config --cflags'
-fPlC -shared -c -o matsu_object.o tsu_object.c
but this error occurred
gcc: -lcrypto: Because a link was
not completed, the input file of the
linker was not used
What's wrong?
...
This is probably a really easy question to answer, but for some reason I'm really struggling with it.
I have a DLL written in C to access hardware at a protocol level, and I want to write a Haskell program that calls some of those C functions. Here's a snippet of the relevant C header (with names just slightly obfuscated due to possibl...
Hi all,
I was wondering if someone could provide me with a bit of theory. I read that;
Page alignment causes changes in
linking. Of very high impact on the
success of compiling software for
Android is the fact that Google forces
compatible binaries to not be page
aligned for the text and data section.
This requires chang...