cc

Add SDL to my path

血红的双手。 提交于 2019-12-08 02:43:49
问题 I install SDL via brew on my mac but I can't include it! Here is my too easy code: #include <SDL.h> int main(){ return 0; } when I compile it with cc, CC could not find SDL.h I found that brew install SDL in Cellar but cc did not check this folder Could you help me? 回答1: I know this post has 9 months old but if someone, somewhere in the internet try to find out how to use SDL with mac, just follow this. DL .dmg file on the SDL website (V2). Put SDL2.framework in /Library/Frameworks In your

javascaipt中数组元素删除方法delete和splice

▼魔方 西西 提交于 2019-12-06 21:04:31
一、用delete 删除数组中元素(少用) 说明:delete: 只是被删除的元素变成了 undefined ,即数组长度不变 //定义数组 var array=["aa","dd","cc","aa"]; //方法1:delete删除数组元素 delete array[1]; //输出结果 : ["aa",undefined,"cc","aa"] getArray(array); 输出结果:     aa     undefined     cc     aa 二、用splice删除数组的元素 说明:该方法会自动改变原始数组,即每用一次splice(i,1)数组长度自动减1 var array = ["aa","dd","cc","aa"]; //方法2:删除数组元素 array.splice(1,1); //输出结果:["aa","cc","aa"] getArray(array); 输出结果:     aa     cc     aa 来源: https://www.cnblogs.com/yanl55555/p/11997657.html

Valgrind macOs and error Syscall param msg->desc.port.name points to uninitialised byte(s)

落花浮王杯 提交于 2019-12-05 13:56:50
问题 I tried to run valgrind 3.13 and 3.14 (on macOs 10.12.6) in very simple project but I got strange error who I never got in my linux before. Very simple C program main.c : int main() { return (0); } Compilation with cc : $> cc main.c Run my simple program with valgrind : $> valgrind ./a.out Output of valgrind: ==12768== Memcheck, a memory error detector ==12768== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==12768== Using Valgrind-3.14.0.SVN and LibVEX; rerun with -h for

Error(Mac OS): sudo pip install MySQl-python

孤者浪人 提交于 2019-12-03 13:54:58
问题 I have problem on command sudo pip install MySQl-python All log: Downloading/unpacking MySQl-python Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded Running setup.py (path:/private/tmp/pip_build_root/MySQl-python/setup.py) egg_info for package MySQl-python Installing collected packages: MySQl-python Running setup.py install for MySQl-python building '_mysql' extension cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd

Error(Mac OS): sudo pip install MySQl-python

心已入冬 提交于 2019-12-03 03:50:28
I have problem on command sudo pip install MySQl-python All log: Downloading/unpacking MySQl-python Downloading MySQL-python-1.2.5.zip (108kB): 108kB downloaded Running setup.py (path:/private/tmp/pip_build_root/MySQl-python/setup.py) egg_info for package MySQl-python Installing collected packages: MySQl-python Running setup.py install for MySQl-python building '_mysql' extension cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os

remote gdb

≡放荡痞女 提交于 2019-12-03 01:54:55
moonx@moonx:/usr/download/test/mygcc$ cat testthread.cc -n 1 // thread example 2 #include <iostream> // std::cout 3 #include <thread> // std::thread 4 5 void foo() 6 { 7 // do stuff... 8 } 9 10 void bar(int x) 11 { 12 // do stuff... 13 } 14 15 int main() 16 { 17 std::thread first (foo); // spawn new thread that calls foo() 18 std::thread second (bar,0); // spawn new thread that calls bar(0) 19 20 std::cout << "main, foo and bar now execute concurrently...\n"; 21 22 // synchronize threads: 23 first.join(); // pauses until first finishes 24 second.join(); // pauses until second finishes 25 26

C Compiling: error: stray '\4' in program ; octal flow?

删除回忆录丶 提交于 2019-12-02 06:51:06
问题 Trying to compile a load of .c files (1) The files compile ok, using cc cc -Wall -Wextra -Wunreachable-code -ggdb -O0 *.c (2) Then, I need to make a static library from the final output, to use in a c++ program. So I do: ar cru liborientdb-c.a *.o (3) Works ok. However when I come to compile the c++ program testme.cpp that includes the library in line #1 (line 1 of testme.cpp) #include "liborientdb-c.a" Compile step: cc testme.cpp i get this error: liborientdb-c.a:117:22: error: stray '\3' in

C Compiling: error: stray '\\4' in program ; octal flow?

牧云@^-^@ 提交于 2019-12-02 04:43:21
Trying to compile a load of .c files (1) The files compile ok, using cc cc -Wall -Wextra -Wunreachable-code -ggdb -O0 *.c (2) Then, I need to make a static library from the final output, to use in a c++ program. So I do: ar cru liborientdb-c.a *.o (3) Works ok. However when I come to compile the c++ program testme.cpp that includes the library in line #1 (line 1 of testme.cpp) #include "liborientdb-c.a" Compile step: cc testme.cpp i get this error: liborientdb-c.a:117:22: error: stray '\3' in program liborientdb-c.a:117:263: warning: null character(s) ignored [enabled by default] liborientdb-c

Solaris 10 CC Preprocessor bug causes undefined symbols

我怕爱的太早我们不能终老 提交于 2019-12-01 21:39:53
I have a very very simple C++ file as follows that I'm compiling on Solaris 5-10 with the CC compiler. Here is the source code in my file myTest.C: #include <map> std::map<int, bool> myVar2; I would like to first run the CC pre-processor on this file, examine the pre-processed file, and then compile that pre-processed file into an object file. I call this "indirect-compiling". To do this, I do the following: % CC -P -o myFile_indirect.i myFile.C % CC -c -o myFile_indirect.o myFile_indirect.i I would also like to compile this file without a separate pre-processing step as is normally done. I

Add custom user email to CC for specific Woocommerce email notification

眉间皱痕 提交于 2019-12-01 14:42:18
In Woocommerce I try to customize the code from this thread to add a custom email as "CC" email address in customer completed order email notification: /** * Function adds a BCC header to emails that match our array * * @param string $headers The default headers being used * @param string $object The email type/object that is being processed */ function add_cc_to_certain_emails( $headers, $object ) { // email types/objects to add cc to $cc_email = get_user_meta( $user_id, 'order_cc_email', true ); // MY CUSTOM CODE $add_cc_to = array( 'customer_completed_order', // Customer Processing order