gnu

How to force revaluation of variables in makefile

好久不见. 提交于 2019-12-12 04:19:34
问题 I have a makefile which runs a binary to generate the cpp files. I then compile the cpp files and generate .o files for each cpp file. The problem is when the makefile is first invoked, the folder is empty because the binary is not invoked yet and CPP_FILES=$(wildcard $(MY_DIR)/inc/output/*.cpp) will be an empty variable. So I changed the line to CPPFILES=$$(wildcard $(MY_DIR)/inc/output/*.cpp) OBJFILES=$$(patsubst $(MY_DIR)/*.cpp,$(MY_DIR)/*.o,$(CPPFILES)) and //ran the binary to generate

Why do I have to double run make to fully compile my program? GNU c++

断了今生、忘了曾经 提交于 2019-12-12 00:27:26
问题 Im terrible with understanding what goes on behind the scenes when running programs. On my schools server, I just use gcc and pretty much the same code every time I need to make a makefile lol. I downloaded my program to debug it in NetBeans and after hours/days.. I finally ALMOST have everything working. After looking at a few posts on here and other sites, I saw that for some reason I need to use g++ instead of gcc to compile since I'm using a MacBook. Which I don't really understand.. But

spyder设置关闭UMR之后,重启黑屏问题解决

烈酒焚心 提交于 2019-12-11 22:33:44
1. cd /etc/ld.so.conf.d 进入到当前目录. 2. sudo cat x86_64-linux-gnu_GL.conf 显示以下结果: /usr/lib/nvidia-384 /usr/lib32/nvidia-384 3. sudo vim i386-linux-gnu_GL.conf ,将以上结果复制进来保存退出. 4. sudo ldconfig 进行动态链接保存. 5. 重启spyder. 来源: CSDN 作者: 爱学习的小崽子 链接: https://blog.csdn.net/qq_38444706/article/details/103500426

error: ‘get_nprocs’ was not declared in this scope

旧街凉风 提交于 2019-12-11 13:36:16
问题 I am using this code for dealing with old g++ compilers. I got this from this answer. unsigned thread::hardware_concurrency() { #if defined(PTW32_VERSION) || defined(__hpux) return pthread_num_processors_np(); #elif defined(__APPLE__) || defined(__FreeBSD__) int count; size_t size=sizeof(count); return sysctlbyname("hw.ncpu",&count,&size,NULL,0)?0:count; #elif defined(BOOST_HAS_UNISTD_H) && defined(_SC_NPROCESSORS_ONLN) int const count=sysconf(_SC_NPROCESSORS_ONLN); return (count>0)?count:0;

GNU 'ls' command not outputing the same over a pipe [duplicate]

瘦欲@ 提交于 2019-12-11 11:39:23
问题 This question already has answers here : Why does ls give different output when piped (3 answers) Closed 3 years ago . When I execute the command ls on my system, I get the following output: System:~ user# ls asd goodfile testfile this is a test file However, when I pipe ls to another program (such as cat or gawk ), the following is output: System:~ user# ls | cat asd goodfile testfile this is a test file How do I get ls to read the terminal size and output the same over a pipe as it does

Using crypt_r on OS X

ぃ、小莉子 提交于 2019-12-11 10:36:52
问题 I want to use the crypt_r function on Mac OS X 10.8.2 #define _GNU_SOURCE #include <crypt.h> produces crypt.h: No such file or directory Where can I get the crypt.h file from? Or am I including it wrong? Edited question - concrete example #include <unistd.h> #include <stdlib.h> int main(){ struct crypt_data * data = (struct crypt_data *) malloc(sizeof(struct crypt_data)); char * testhash; testhash = crypt_r("string", "sa", data); free(data); return 0; } produces gcc test.c -Wall test.c: In

Unable to compile Objective-C code on Ubuntu

微笑、不失礼 提交于 2019-12-11 10:23:31
问题 So I have this piece of code... /** * cdb.m * Copyright (C) 2013 Naveen Mathew. All rights reserved. */ #import <objc/Object.h> #import "cdb.h" #import <stdio.h> #import <stdlib.h> @implementation CDB : Object { } - (int) main { printf("Hello world"); return 0; } @end int main(void) { CDB *myNumber = [CDB new]; // equal to [[Number alloc] init] [myNumber main]; return 0; } and I want to compile it in Ubuntu 13.04 but without all the crap that GNUStep gives me. So I use the GNU Objective C

How to strip parameters from a variable in a makefile

☆樱花仙子☆ 提交于 2019-12-11 10:19:58
问题 Below is a variable I am using in a makefile. copt = -mcpu=cortex-m3 -mthumb -g -c I want to remove -mthumb and replace it with some other option. Is there any way I can strip the option and add few other options. I know how to add : Example - copt += -O3 but don't know how to remove the already existing options. Thanks! 回答1: $(subst from,to,text) Performs a textual replacement on the text text: each occurrence of from is replaced by to. The result is substituted for the function call. In

How can I use a look after to match either a single or a double quote?

家住魔仙堡 提交于 2019-12-11 08:35:36
问题 I have a series of strings I want to extract: hello.this_is("bla bla bla") some random text hello.this_is('hello hello') other stuff What I need to get (from many files, but this is not important here) is the content between hello.this_is( and ) , so my desired output is: bla bla bla hello hello As you see, the text within parentheses can be enclosed with either double or single quotes. If this was only single quotes I would use a look behind and look ahead just like this: grep -Po "(?<=hello

error reading .po file in java

南笙酒味 提交于 2019-12-11 08:06:39
问题 i read a bit about reading from .po files and i still have some questions. Does anyone know if you can directly read from a .po file just like reading from a .properties file in java, or does it need to be transformed from .po to .properties? I imported the class GettextResource and : ResourceBundle rb = ResourceBundle.getBundle("stuff.po.I18n"); System.out.println(GettextResource.gettext(rb, "name_test")); Where msgid "name_test" msgstr "test" (from .po file) This does return only the string