This may be a stupid question, but if I compile a shared library using g++ on one distribution of Linux, and then move those libraries as object files via flash drive to another computer with the exact same Linux distro and version of g++ will I still be able to link those libraries in my source files on the second
Tag: g++
gcc 4.x not supporting x87 FPU math?
I’ve been trying to compile gcc 4.x from the sources using –with-fpmath=387 but I’m getting this error: “Invalid –with-fpmath=387”. I looked in the configs and found that it doesn’t support this option (even though docs still mention it as a possible option): Basically, I started this whole thing because I need to supply an executable for an old target platform
gmon.out is not created when executable forks another executable
I am using gprof for profiling. But gmon.out is not created when I fork another executable inside the main executable which is compiled with option -pg. Any idea how to resolve it. Answer But gmon.out is not created when I fork another executable It probably does. It simply has the same name as all the other gmon.out files. They just
g++ custom dynamic library linking error undefined symbol
Ok, I’m looking for a solution for 2 days now. I didn’t find anything to solve my problems. What is currently going on? So, I tried creating a dynamic library (.so) on Linux Mint Maya 13 with g++. foolib.h: foolib.cpp: main.cpp: I compiled these files with these instructions: libfoo.so: foo: Creating libfoo.so works without any errors, but foo throws undefined
How to know if process has truly finished with a dlclose()ed library?
I’m on Linux (Ubuntu 12.04, gcc 4.6.3), trying to bend dlopen/close to my will in order to make a plugin-based application that can reload its plugins as and when necessary (e.g. if they’re recompiled). The basic theory is simple: dlopen the plugin; use it, keeping track of all its symbols that are in use. When the time comes to reload,
Undefined references in makefile
Ok, ive read about 10 tutorials, but i keep getting errors all the time, i have 5 files, main.cpp class.cpp, class.h and functions.cpp and functions.h. All of those use functions from different objects meaning that functions in functions.cpp uses objects from classes.cpp. My makefile looks as follows I keeps telling me that it has undefined references. What am i missing?
Can I squeeze my own program between the preprocessor and compiler?
Is this a stupid question, or can I specify g++ to use a program between the preprocessor and compiler? Alternatively, I know that I can just run the preprocessor on a file (hence all the files). Then I am guessing there is a switch to run only the compiler. So I can manually invoke these two and put my program
How to view symbols in object files?
How can I view symbols in a .o file? nm does not work for me. I use g++/linux. Answer Instead of nm, you can use the powerful objdump. See the man page for details. Try objdump -t myfile or objdump -T myfile. With the -C flag you can also demangle C++ names, like nm does.
Dynamic Shared Library compilation with g++
I’m trying to compile the following simple DL library example code from Program-Library-HOWTO with g++. This is just an example so I can learn how to use and write shared libraries. The real code for the library I’m developing will be written in C++. If I compile the program with gcc it works fine. When I change the filename and
GCC and ld can’t find exported symbols…but they’re there
I have a C++ library and a C++ application trying to use functions and classes exported from the library. The library builds fine and the application compiles but fails to link. The errors I get follow this form: app-source-file.cpp:(.text+0x2fdb): undefined reference to `lib-namespace::GetStatusStr(int)’ Classes in the library seem to be resolved just fine by the linker, but free functions and