linker-flags

Combining FORTRAN and C++, linking error

為{幸葍}努か 提交于 2021-02-19 05:44:05
问题 I should couple in linux one c++ code with old fortran code, where fortan is the main code. Im not expert in this area and I try to start with simple test, but still I cannot compile it. Maybe I'm stupid, but I cannot find a working example anywhere. I managed to compile fortran and c, when the linking can be done by ifort (need to use intel compiler later with the actual fortran code). But If I've understood right, with c++ , the linking must be done by c++ compiler ( g++ ). So what do I do

CMake passes all gcc flags to nvcc as well

£可爱£侵袭症+ 提交于 2020-06-27 04:11:22
问题 My project uses cuda kernel for a small module and needs nvcc for compiling. During compilation, cmake pass the same linker and compiler flags intended for gcc to nvcc as well. In my particular case, I get the following error. nvcc fatal : Unknown option 'Wl,--no-as-needed' Following the accepted answer in this thread, I managed to remove the compiler flags for the target that needs nvcc as follows. get_target_property(_target_cxx_flags target_that_needs_nvcc COMPILE_OPTIONS) list(REMOVE_ITEM

Xcode how to exclude FOLDERS from compilation?

风格不统一 提交于 2020-06-10 10:02:52
问题 I saw this and answers in stackO, but didn't find how to exclude folders. I have 3 folders with a lot of .h , .m and .mm and i need to exclude them temporary, but not to remove references. How can i do that? 回答1: From looking at the post you link to. Here is how you do it: Go to Build Settings. Press the plus button and select "Add User-Defined settings" Give the new field the name of EXCLUDED_SOURCE_FILE_NAMES . Add the path to the folder: <Path>/FolderToIgnore/* . The asterisk denotes all

Xcode how to exclude FOLDERS from compilation?

和自甴很熟 提交于 2020-06-10 10:02:37
问题 I saw this and answers in stackO, but didn't find how to exclude folders. I have 3 folders with a lot of .h , .m and .mm and i need to exclude them temporary, but not to remove references. How can i do that? 回答1: From looking at the post you link to. Here is how you do it: Go to Build Settings. Press the plus button and select "Add User-Defined settings" Give the new field the name of EXCLUDED_SOURCE_FILE_NAMES . Add the path to the folder: <Path>/FolderToIgnore/* . The asterisk denotes all

Xcode how to exclude FOLDERS from compilation?

烂漫一生 提交于 2020-06-10 09:59:33
问题 I saw this and answers in stackO, but didn't find how to exclude folders. I have 3 folders with a lot of .h , .m and .mm and i need to exclude them temporary, but not to remove references. How can i do that? 回答1: From looking at the post you link to. Here is how you do it: Go to Build Settings. Press the plus button and select "Add User-Defined settings" Give the new field the name of EXCLUDED_SOURCE_FILE_NAMES . Add the path to the folder: <Path>/FolderToIgnore/* . The asterisk denotes all

Xcode how to exclude FOLDERS from compilation?

送分小仙女□ 提交于 2020-06-10 09:59:07
问题 I saw this and answers in stackO, but didn't find how to exclude folders. I have 3 folders with a lot of .h , .m and .mm and i need to exclude them temporary, but not to remove references. How can i do that? 回答1: From looking at the post you link to. Here is how you do it: Go to Build Settings. Press the plus button and select "Add User-Defined settings" Give the new field the name of EXCLUDED_SOURCE_FILE_NAMES . Add the path to the folder: <Path>/FolderToIgnore/* . The asterisk denotes all

what is the json-spirit linker flag for g++?

有些话、适合烂在心里 提交于 2020-01-29 23:38:30
问题 I can't find this anywhere. I've installed json-spirit on my ubuntu server with apt-get install json-spirit-dev . What linker flag has to be used with g++ to use json-spirit? 回答1: The only library listed in that package is called libjson_spirit.a . You can link with it by adding -ljson_spirit to your linker step. 来源: https://stackoverflow.com/questions/17437893/what-is-the-json-spirit-linker-flag-for-g

Can you compile a shared object to prefer local symbols even if it's being loaded by a program compiled with -rdynamic?

妖精的绣舞 提交于 2019-12-30 09:00:08
问题 I am building a shared library in C that is dynamically loaded by a program that I do not have source access to. The target platform is a 64-bit Linux platform and we're using gcc to build. I was able to build a reproduction of the issue in ~100 lines, but it's still a bit to read. Hopefully it's illustrative. The core issue is I have two non-static functions ( bar and baz ) defined in my shared library. Both need to be non-static as we expect the caller to be able to dlsym them. Additionally

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

How to allow -z multidefs with g++47

柔情痞子 提交于 2019-12-14 00:27:41
问题 How can I tell the linker of g++ to allow multiple definitions of symbols (choose the first appearance)? -z multidefs Allows multiple symbol definitions. By default, multiple symbol definitions occurring between relocatable objects (.o files) will result in a fatal error condition. This option suppresses the error condition and allows the first symbol definition to be taken. This option is valid only when the -b svr4 option is specified. The -zmuldefs option is not recognized by g++ , nor -z