linker

Mac: How to export symbols from an executable?

Hello. I am writing an executable which uses dlopen() (LoadLibrary() on Windows) to dynamically load a shared library. The shared library uses symbols from the executable. In Windows this is possible. Executables can export symbols: declspec(dllexport) and .def files both work. The linker, when creating the .exe, also creates the .lib ...

Wrapping a C++ DLL with a managed class.

Hi! I'm trying to wrap a unmanaged C++ DLL with managed C++ and I keep getting linking errors. even though I include my library.lib in the project and include the correct header file. This is the managed class: #pragma once #include "..\Terminal\Terminal.h" public ref class ManagedTerminal { private: Terminal * m_unTerminal; pu...

How will this Ocaml type definition look in its C stub?

I've taken the following code from http://www.ocaml-tutorial.org/data_types_and_matching I've been trying to write a C stub for following, to invoke from our PHP codebase. I can't quite understand how (and if) I'm supposed to create a typedef for the following Ocaml type expr, and how I can access the function multiply_out from the C st...

Actionscript button linking issue

So this doesn't make any sense. I have actionscript in a flash-based button menu, and one of the buttons is linking to the wrong page, and i cannot figure out why. Here is the actionscript: var myURL1:URLRequest = new URLRequest ("home.html"); home_btn.addEventListener(MouseEvent.CLICK, home_btnEventHandler); function home_btnEventHan...

linking with a pragma with g++

In Visual C++, one may link to a library in the code itself by doing #pragma comment (lib, "libname.lib"). Is something similar possible in g++? ...

Why shared library is linked by absolute path?

Hi,all: I create an application by linking the libociei.so and libcustome.so CC -o main main.cpp ../lib/libociei.so ../lib/libcustome.so and copy libociei.so libcustome.so to /usr/lib then I use ldd to check library, it shows: main ..... libcustome.so ===> /usr/lib/libcustome.so ../lib/libociei.so why libociei.so is no...

USe function from user32.dll in Qt4 application

Hi, i am unable to use the function MonitorFromPoint in my Qt application. I have the latest Qt SDL 2010.05 with mingw on Windows XP #include <QtCore/QCoreApplication> #include<windows.h> #include <winuser.h> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); POINT pt; MonitorFromPoint(pt,2); return a.ex...

What is compiler, linker, loader ?

Hi I wanted to know in depth meaning and working of compiler, linker and loader. With reference to any language preferably c++. thanks in advance ! ...

Sun Grid Engine: undefined reference to sge_gdi2_send_any_request

I'm trying to compile the CVS source for SGE6.2u5 (mainly because the provided binaries fail to install with ArchLinux x64). But I get the following compiler error. I Know there's probably no SGE experts out there, but does anyone have any suggestions on what I can do to the Makefile to make the linker error go away (get it to compile)?...

app with Scanning functionality for iphone os 3.x+ with framework of os 4.0+

I am currently developing one application which needs the barcode scanning facility for that I am planning to use the scannerkit SDK, What I want is to build the application for the iphone os 3.x+ but the some framework(CoreMedia and CoreVideo) which scannerkit sdk uses are part of os 4.0+, I had linked this two framework weak, so that I...

Non-member static templated method definitions in C++?

Can I call a non-member static templated function from a static member function where the definition is split into header and cpp: // zero.cpp class Zero { static void zero() { one(5); } }; // one.h template <typename T> static void one(T& var); // one.cpp template <typename T> void one(T& var) { } // main.cpp ... Zero::zero...

How to use CUDA constant memory in a programmer pleasant way?

I'm working on a number crunching app using the CUDA framework. I have some static data that should be accessible to all threads, so I've put it in constant memory like this: __device__ __constant__ CaseParams deviceCaseParams; I use the call cudaMemcpyToSymbol to transfer these params from the host to the device: void copyMetaData(C...

DBGHelp.dll causes load of msvcrt.dll in debug version

My application compiles with VC6 sp6, uses DBGHelp.lib to get stack information. The code is simmilar in debug and release compilations. The problem is that when executing the debug version, DBGHelp.dll loads msvcrt.dll (the release version). msvcrtd.dll is already loaded by my debug link anyway. So I end up having both msvcrtd.dll and m...

Microsoft and JQuery: code to combine linking and templating?

With an extreme amount of SO user help, I used ASP.NET MVC 2 Futures to employ JSON to load 600 some products and display them with Microsoft Jquery templates in 400ms with the code below. Is there a way to use Microsoft JQuery Linking to bind the object to the generated form data without looping through every one? (Assuming I preserve...

How to call a lib written in C++ from C ?

It seems to me like a no-brainer, but I cannot find any information against or for it. From the point of view of demangling etc, I don't suppose this to be a big problem, but I can't figure out, how I can write a little tiny C program which calls a function from a little tiny C++ library. I am on linux right now, trying with static bin...

C++ linking to libraries with makefile (newbe)

Hi, I'm trying to understand how to use non standard libraries in my C++ projects. I have a few questions. Lets say I want to use POCO library. So I downloaded it and build it using make (static build). Now I have bunch of .o files and .h files. There is a Path.h file and a Path.o file in different directories. Now I want to use this m...

How can I add sections to an existing (OS X) executable?

Is there any way of adding sections to an already-linked executable? I'm trying to code-sign an OS X executable, based on the Apple instructions. These include the instruction to create a suitable section in the binary to be signed, by adding arguments to the linker options: -sectcreate __TEXT __info_plist Info.plist_path But: The e...

C++ project compiles as static library but not dynamic (Visual Studio)

I'm a little new to c++ in visual studio, and I'm trying to compile a massive C++ project with Visual Studio. I've gone through and added all source and header files to my project and also updated all of the include paths in the project properties. If I have the type of project set to "Static Library (.Lib)" the project will compile wi...

Compiling 32-bit vs 64-bit project using CMake

How do I specify that CMake should use a different link_directories value depending on whether the target is 32-bit is 64-bit? For example, 32-bit binaries need to link with 32-bit Boost, 32-bit binaries need to link with 64-bit Boost. ...

c++ What to do if Library makes use of debug version of other library?

Hi! A library i'd like to use makes calls to functions like "malloc_dbg" which are defined in libcmtd.lib but not in libcmt.lib (so I get Linker errors in Release mode) Do I really need to use the debugversion of that lib even in releasemode? or can I somehow use libcmt.lib and libcmtd.lib together, but use libcmtd.lib only for this ot...