linker

How to link with specific library ( g++; libstdc++.so.5 and libstdc++.so.6 )

╄→尐↘猪︶ㄣ 提交于 2019-12-19 03:49:17
问题 A simple question - is there any way to make the g++ linker to link with a specific libstdc++ library version? I didn't find anything useful in the man page of gcc / g++ , neither in other questions here. Here's the situation - my application uses a specific shared library, that's built with libstdc++.so.5 and I want to install and use it on RHEL5 . So, when I try to build the application on a RHEL5 machine, I got the warning: warning: libstdc++.so.5, needed by ..the_shared_library_.. may

Linker error using extern “C” in Objective-C code

天涯浪子 提交于 2019-12-19 03:41:49
问题 I'm trying to create some utility functions that can be called from both Objective-C and C++ code in an iPhone application. I have third party C++ classes that cannot be compiled as ObjectiveC++ (.mm). I have a header file declaring my functions, then a .c file defining them. I've tripled checked for spelling errors, but for some reason my linker is NOT able to find the definition of any of the functions. Here is the header for the C helper functions: #ifndef FILE_LOADER_H #define FILE_LOADER

Linker error using extern “C” in Objective-C code

萝らか妹 提交于 2019-12-19 03:41:08
问题 I'm trying to create some utility functions that can be called from both Objective-C and C++ code in an iPhone application. I have third party C++ classes that cannot be compiled as ObjectiveC++ (.mm). I have a header file declaring my functions, then a .c file defining them. I've tripled checked for spelling errors, but for some reason my linker is NOT able to find the definition of any of the functions. Here is the header for the C helper functions: #ifndef FILE_LOADER_H #define FILE_LOADER

Undefined symbol _main when trying to build shared library g++ / mac

女生的网名这么多〃 提交于 2019-12-19 03:37:10
问题 I am trying to build libdecodeqr on a mac. My c++ building and linking history is all on windows, so it's an exciting journey of discovery. I have finally got to the point where I want to create the linked library. The command I am running is: g++ -shared -o libdecodeqr.so.0.9.3 bitstream.o codedata.o container.o ecidecoder.o formatinfo.o galois.o imagereader.o libdecodeqr.o -L/opt/local/lib -arch i386 -lcxcore -lcv The result is: Undefined symbols: "_main", referenced from: start in crt1.10

Undefined reference on very simple program

拜拜、爱过 提交于 2019-12-19 03:24:26
问题 Once I installed Ubuntu 11.10, strange error appears. I want to use GD with my C program, so I installed package "libgd2-xpm-dev". Everything was installed - files gd.h and libgd.a are in "/usr/include" and in "/usr/lib". So, I've tried to compile simple program with GD. #include <stdio.h> #include <gd.h> int main() { gdImagePtr im, im_clear; int black, white; FILE *out1; im = gdImageCreate(100, 100); im_clear = gdImageCreate(100, 100); white = gdImageColorAllocate(im, 255, 255, 255); black =

Remove C++ class names from binary dll file

懵懂的女人 提交于 2019-12-19 02:52:07
问题 I have a C++ project under Visual Studio 2010 which compiles into a dll. I have several private implementation-specific classes defined in my project, e.g. CMyClass . This class is not exported from the dll or by any interface function. However, when I check generated dll file, there is a string "CMyClass" stored in it. It is a release build, and I don't want this string to appear in the dll file. This dll is shipped to customers, and I want all names I used in my project to be stripped off

Weak link framework

一个人想着一个人 提交于 2019-12-19 02:32:26
问题 Due to the last release of the adMob package, I have added the MessageUI framework to my project. As I wish to deploy my application to 2.x OS devices, I have weak linked MessageUI as advised. If I build for iPhone device 3.0, it works fine. If I build for iPhone device 2.2.1, I get a link error: "ld: framework not found MessageUI" Where could I be wrong? 回答1: You are getting that error because you are building against a version of the SDK that does not implemement the MessageUI framework.

Weak link framework

流过昼夜 提交于 2019-12-19 02:32:16
问题 Due to the last release of the adMob package, I have added the MessageUI framework to my project. As I wish to deploy my application to 2.x OS devices, I have weak linked MessageUI as advised. If I build for iPhone device 3.0, it works fine. If I build for iPhone device 2.2.1, I get a link error: "ld: framework not found MessageUI" Where could I be wrong? 回答1: You are getting that error because you are building against a version of the SDK that does not implemement the MessageUI framework.

“Multiple definition of” C++ compiler error

谁说胖子不能爱 提交于 2019-12-18 18:55:07
问题 I can't seem to get rid of these seemingly random compiles errors in one of my classes. I get about 4 errors such as: multiple definition of `draw_line(float, float, float, float)' and multiple definition of `near_far_clip(float, float, float*, float*, float*, float*, float*, float*)' that are flagged in the middle of the method. I also consistently get multiple definition of `stack' in the middle of another method. stack is a global variable in a totally different file. It isn't even

C++ linking problems, seems like I can't link against standard C++ stuff

谁说我不能喝 提交于 2019-12-18 18:47:09
问题 I am trying to use a library I've compiled myself in an iOS app. The library is the Tesseract OCR lib. It seems like compiling that (and its dependencies) have gone ok. However, when I try to link against this lib in my app project, the app fails to link. The link errors surprise me; it seems like there are problems with the Tesseract stuff finding pretty standard C++ stuff. Any suggestions about what I might be doing wrong would be most helpful. Here is a snippet of the kind of link errors I