linker

Link errors compiling a mixed objective-C/C++ project with C++11 support in xcode 4.5.2

左心房为你撑大大i 提交于 2020-01-03 01:55:11
问题 I am trying to compile a workspace of 3 projects with C++11 support. This set of projects has successfully compiled and linked using LLVM compiler defaults. In addition, the c++ code has previously compiled on a number of compilers including g++, llvm, msvc, sun, irix etc so it is very clean code. Under the c++ language dialect section of the workspace build settings there are 3 line items: c language dialect c++ language dialect c++ standard library Using the settings: c language dialect:

MSVC - boost::python static linking to .dll (.pyd)

和自甴很熟 提交于 2020-01-02 22:04:14
问题 I got a VS10 project. I want to build some C++ code so I can use it in python. I followed the boost tutorial and got it working. However VS keeps to link boost-python-vc100-mt-gd-1_44.lib but it's just a wrapper which calls boost-python-vc100-mt-gd-1_44.dll. That's why I need to copy the .dll with my .dll(.pyd) file. So I want to link boost:python statically to that .dll(.pyd) file. But I just can't find any configuration option in VS or in the compiler and linker manual. The weirdest thing

Understanding Linker Map File (MS Visual Studio 2005)

蹲街弑〆低调 提交于 2020-01-02 19:11:31
问题 All - I'm trying to understand the first section of the Map file produced by the MS Visual Studio 2005 linker. I know it has something to do with memory sections, but can someone help me decipher it? Timestamp is 4b4f8d2b (Thu Jan 14 14:31:23 2010) Preferred load address is 00400000 Start Length Name Class 0001:00000000 0028b752H .text CODE 0002:00000000 000001b4H .idata$5 DATA 0002:000001b4 00000004H .CRT$XCA DATA 0002:000001b8 00000004H .CRT$XCAA DATA 0002:000001bc 00000004H .CRT$XCC DATA

Xcode warning with non-standard Framework ld: warning: directory not found for option -F

此生再无相见时 提交于 2020-01-02 13:56:10
问题 Cleaning up warnings, I could see the following: ld: warning: directory not found for option '-F/myPath/etc/myframework' This was happening with non-standard iOS frameworks. How to eliminate the warning? 回答1: Checking the man page of the linker ld shows the following detail for the -Fdir option: Add dir to the list of directories in which to search for frameworks. Directories specified with -F are searched in the order they appear on the command line and before the default search path. In

Dll project doesn't build as Linker not able to find the same named .lib file

瘦欲@ 提交于 2020-01-02 10:10:08
问题 I am a newbie in the Visual Studio 2010 environment. I got a source base which was developed using Visual Studio 2008. I am trying to build it in VS 2010; but the build fails as the Linker says the error - LINK : fatal error LNK1181: cannot open input file X.lib'. Here X is the name of the lib file created from the same project and X.dll is the output dll. In fact the X.lib is not present in the project. Without succesfully building the project, it won't come at all for the Dll to build

What does the /TSAWARE linker flag do to the PE executable?

不问归期 提交于 2020-01-02 08:43:30
问题 After adding the /TSAWARE linker flag to one of my projects (Visual Studio 6), I was surprised to find a new section in the PE file (.idata). If I don't set the flag, the imports are merged into .rdata. To illustrate the "problem" we start out with a simple console program: #include <stdio.h> int main() { printf("hello world\n"); return 0; } and compile with: cl /Og /O1 /GF /WX /c main.c Then link with link /MACHINE:IX86 /SUBSYSTEM:CONSOLE /RELEASE /OUT:a.exe main.obj link /MACHINE:IX86

g++ can't find headers but I did include them

时光毁灭记忆、已成空白 提交于 2020-01-02 08:15:11
问题 I am starting on c++ and already going wrong ... I am trying to compile a small test of levelDB : #include <assert.h> #include "leveldb/db.h" using namespace std; int main() { leveldb::DB* db; leveldb::Options options; options.create_if_missing = true; leveldb::Status status = leveldb::DB::Open(options, "/tmp/testdb", &db); assert(status.ok()); return 1; } Here is the g++ command : g++ -I include/ testLevelDB.cpp Output: /tmp/ccuBnfE7.o: In function `main': testLevelDB.cpp:(.text+0x14):

nvlink, relocatable device code and static device libraries

可紊 提交于 2020-01-02 08:06:20
问题 While investigating some issues with relocatable device code, I stumbled upon something I don't quite understand. This is a use case for what is pictured on slide 6. I used an answer of Robert Crovella as a basis for a repro code. The idea is that we have some relocatable device code compiled into a static library (e.g. some math/toolbox library), and we want to use some functions of that precompiled library into another device library of our program: libutil.a ---> libtest.so ---> test_pgm

Visibility linker warnings when compiling iOS app that uses Boost

我的梦境 提交于 2020-01-02 07:02:52
问题 My iOS app uses a library which in turn depends on Boost. While revamping the 3rdparty build system, I encountered linker warnings such as this ld: warning: direct access in ___cxx_global_var_init to global weak symbol std::__1::basic_ofstream<char, std::__1::char_traits<char> >::~basic_ofstream() means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. and this ld: warning: direct access in

Ubuntu 11.10 linking perftools library

别说谁变了你拦得住时间么 提交于 2020-01-02 06:32:14
问题 I can't get gcc in Ubuntu 11.10 to properly link in the google perftools -lprofiler. The problem seems to be that the linker discards libraries which are not directly used in a program. An example will help. Let's call this main.cpp: #include <math.h> int main() { double value; for (int i=0; i < 1000000; i++) { for (int j=0; j < 1000; j++) value = sqrt(100.9); } return 0; } Compile using: g++ -c main.cpp -o main.o g++ main.o -o main -lm -lprofiler Check the executable using ldd ./main: linux