linker

linker could not found object files from different directory with scons

*爱你&永不变心* 提交于 2019-12-25 03:12:16
问题 Currently, I make a project with scons. I compiled source codes and it is time to link them. However, I got an error that ld cannot find object files. The SConscript is located in src/kernel32, and import os, sys # Compile CPP env_gpp_options = { 'CXX' : 'x86_64-pc-linux-g++', 'CXXFLAGS' : '-std=c++11 -g -m32 -ffreestanding -fno-exceptions -fno-rtti', 'LINK' : 'x86_64-pc-linux-ld', 'LINKFLAGS' : '-melf_i386 -T scripts/elf_i386.x -nostdlib -e main -Ttext 0x10200', } env_gpp = Environment(**env

C++ Compilation Issue - Undefined symbols for architecture x86_64 - Mac Os X Mountain Lion

ぐ巨炮叔叔 提交于 2019-12-25 02:54:03
问题 I'm having a compilation issue which I'm unable to solve. I'm developing a cross platform C++ project coding on both Mac Os X 10.8 and Windows. The code compiles and run fine on Windows and on Mac Os X Leopard as well. Since Apple pushes the developers to stick to the latest platform for various reasons I'm forced to develop on Mountain Lion and I'm trying to get the project to work again. I compiled correctly all the libraries I needed (wxWidgets, etc) and I imported the project in the

Can't add static library in Eclipse Juno 8.1.1 CDT C++ project

浪尽此生 提交于 2019-12-25 02:24:08
问题 I have been trying to find a guide how to link a static library to my Eclipse CDT project but I was not able to find one. I have tried both with Visual Studio 2010 compiler and MiNGW. I use Windows and Eclipse Juno 8.1.1 , under Project Settings -> C/C++ Build -> Settings I have something like this : Lib manager : Path and symbols: 回答1: You have to add the library name without lib and .a in Libraries (-l) and adding the path in Libraries search path (-L). However, this question is resolved

Using Portaudio on osx 10.9 in Xcode 5 - Undefined symbols for architecture x86_64

为君一笑 提交于 2019-12-25 02:22:17
问题 I am trying to use Portaudio on OSX 10.9 in Xcode 5, but am running into some issues. I have downloaded the source, rand ./configure and make, included the include folder in my xcode project, and ran Pa_Initialize() to get this error. I have tried setting the architectures in the xcode build settings from "Standard Architectures (64-bit Intel)(x86_64)" to "Universal (32/64-bit Intel)(x86_64, i386)" with no success. I have followed instructions/solutions here, here and here but have found no

unable to compile with library

限于喜欢 提交于 2019-12-25 02:15:34
问题 I would like to experiment with the OpenALPR SDK and have written a little test program. The problem is, I can't get it to compile properly and I'm not sure why. Here's the SDK documentation. My source file looks like: $ cat test.cpp #include <alpr.h> #include <iostream> std::string key = "MyKey"; int main (void) { alpr::Alpr openalpr("us", "/etc/openalpr/openalpr.conf", "/usr/share/openalpr/runtime_data/", key); // Make sure the library loaded before continuing. // For example, it could fail

How “Unknown class <MyClass> in Interface Builder file” error can be fixed with a line reads “[MyClass class]”?

房东的猫 提交于 2019-12-25 01:46:35
问题 I read the following answer, so I know that "Unknown class in Interface Builder file" error can be solved using the -ObjC linker option. (FYI, MyClass is in static library.) https://stackoverflow.com/a/6092090/534701 I've also found that single line of [MyClass class] code in the App Delegate can handle the same problem without using -ObjC option. My Question is how come the code can work. According to the answer that I've attached above, the error occurs because symbols in my static

Compiling Rust static library and using it in C++: undefined reference

一曲冷凌霜 提交于 2019-12-25 01:41:08
问题 I'm trying to compile a static library in Rust, and then use it in my C++ code (note this is about calling Rust from C++ and not the other way around). I went over all the tutorials I could find online, and replies to similar questions, and I'm obviously doing something wrong, though I can't see what. I created a minimal example for my problem : 1. Cargo.toml : [package] name = "hello_world" version = "0.1.0" [lib] name = "hello_in_rust_lib" path = "src/lib.rs" crate-type = ["staticlib"]

c++ files to include for boost : asio

我与影子孤独终老i 提交于 2019-12-25 01:37:25
问题 I'm following this tutorial however it does not state which libaries I need to include in order to get boost to work,current options for links are: -I/usr/include/opencv2 -I/usr/include/boost_1_55_0 -I/usr/include/boost_1_55_0/boost -O0 -g3 -Wall -c -fmessage-length=0 however this returns the following erro: which states that it can't find asio, am I doing something wrong or was assio the wrong library to link to? Or is there any other way to find out. Note that this is my 2nd c++ project

My Java GUI interfaces with my uber-cool proprietary dll. How can I prevent 3rd parties from interfacing with this dll?

▼魔方 西西 提交于 2019-12-25 01:35:42
问题 I'm writing my process in C++. Now I want to write its GUI. I was thinking of using Java in order to do this and link it using JNI, but then I thought of a security problem... Suppose I have my GUI.exe file written in Java, and I also have my Engine.dll file written in c++. What would prevent evil evil people from taking my DLL and linking it to their program? I do use a license validation stuff in my C++ dll, but it can be broken by these evil evil people. I know every program can be cracked

Generating single .so from multiple C++ and C object files

本秂侑毒 提交于 2019-12-25 00:22:15
问题 Let's say I have a C++ library code, with some definitions wrapped with extern "C" { ... } . I also have a C library code which uses that C++ library. What I want to do is to create a single .so file, so that only one call to dlopen should be enough to start using this library. Here's what I do now: I'm first compiling my C++ library to a .so file with -shared -rdynamic -fPIC . Then I'm compiling my C library to a .so file with same parameters. After that, I have to load C++ library with