Search Results

Search found 454 results on 19 pages for 'stdlib'.

Page 1/19 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Makefile : Build in a separate directory tree

    - by Simone Margaritelli
    My project (an interpreted language) has a standard library composed by multiple files, each of them will be built into an .so dynamic library that the interpreter will load upon user request (with an import directive). Each source file is located into a subdirectory representing its "namespace", for instance : The build process has to create a "build" directory, then when each file is compiling has to create its namespace directory inside the "build" one, for instance, when compiling std/io/network/tcp.cc he run an mkdir command with mkdir -p build/std/io/network The Makefile snippet is : STDSRC=stdlib/std/hashing/md5.cc \ stdlib/std/hashing/crc32.cc \ stdlib/std/hashing/sha1.cc \ stdlib/std/hashing/sha2.cc \ stdlib/std/io/network/http.cc \ stdlib/std/io/network/tcp.cc \ stdlib/std/io/network/smtp.cc \ stdlib/std/io/file.cc \ stdlib/std/io/console.cc \ stdlib/std/io/xml.cc \ stdlib/std/type/reflection.cc \ stdlib/std/type/string.cc \ stdlib/std/type/matrix.cc \ stdlib/std/type/array.cc \ stdlib/std/type/map.cc \ stdlib/std/type/type.cc \ stdlib/std/type/binary.cc \ stdlib/std/encoding.cc \ stdlib/std/os/dll.cc \ stdlib/std/os/time.cc \ stdlib/std/os/threads.cc \ stdlib/std/os/process.cc \ stdlib/std/pcre.cc \ stdlib/std/math.cc STDOBJ=$(STDSRC:.cc=.so) all: stdlib stdlib: $(STDOBJ) .cc.so: mkdir -p `dirname $< | sed -e 's/stdlib/stdlib\/build/'` $(CXX) $< -o `dirname $< | sed -e 's/stdlib/stdlib\/build/'`/`basename $< .cc`.so $(CFLAGS) $(LDFLAGS) I have two questions : 1 - The problem is that the make command, i really don't know why, doesn't check if a file was modified and launch the build process on ALL the files no matter what, so if i need to build only one file, i have to build them all or use the command : make path/to/single/file.so Is there any way to solve this? 2 - Any way to do this in a "cleaner" way without have to distribute all the build directories with sources? Thanks

    Read the article

  • OS X contains heapsort in stdlib.h which conflicts with heapsort in sort library

    - by CryptoQuick
    I'm using Ariel Faigon's sort library, found here: http://www.yendor.com/programming/sort/ I was able to get all my code working on Linux, but unfortunately, when trying to compile with GCC on Mac, its default stdlib.h contains another heapsort, which unfortunately results in a conflicting types error. Here's the man page for Apple heapsort: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/heapsort.3.html Commenting out the heapsort in the sort library header causes a whole heap of problems. (pardon the pun) I also briefly thought of commenting out my use of stdlib.h, but I use malloc and realloc, so that won't work at all. Any ideas?

    Read the article

  • Mac OS X 10.9 with GCC 4.7.3, stdlib.h: no such file or directory

    - by Leon Kaihua Li
    I'm doing some development with C++ on Mac OS. The code worked fine on Mac OS 10.8.3/10.8.4, with GCC 4.7.3. However recently I upgraded my OS to Mavericks 10.9 and Xcode 5.0. I find that when I try to compile my code, both gcc/g++/clang responds with: *******.C:1:** stdlib.h:no such file or directory *******.C:2:** iostream.h:no such file or directory Since I'm not familiar with Mac OS(My working platform is openSUSE), what can I do for it? will it help if I install "Command Line Tools" from Xcode? Or is there anyway that I could re-build the include index? Include dir of GCC is /opt/local/include/gcc47 and it seems there is a stdlib.h in it. The path is /opt/local/include/gcc47/c++/tr1/ Please help me, and thank you very much.

    Read the article

  • Isn't the C++ standard library backward-compatible?

    - by Chris Metzler
    Hi. I'm working on a 64-bit Linux system, trying to build some code that depends on third-party libraries for which I have binaries. During linking, I get a stream of undefined reference errors for one of the libraries, indicating that the linker couldn't resolve references to standard C++ functions/classes, e.g.: librxio.a(EphReader.o): In function `gpstk::EphReader::read_fic_data(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': EphReader.cpp:(.text+0x27c): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' EphReader.cpp:(.text+0x4e8): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long)' I'm not really a C++ programmer, but this looks to me like it can't find the standard library. Doing some more research, I got the following when I looked at librxio's dependency for the standard library: $ ldd librxio.so.16.0 ./librxio.so.16.0: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by ./librxio.so.16.0) libm.so.6 => /lib64/libm.so.6 (0x00002aaaaad45000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00002aaaaafc8000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002aaaab2c8000) libc.so.6 => /lib64/libc.so.6 (0x00002aaaab4d7000) /lib64/ld-linux-x86-64.so.2 (0x0000555555554000) So I read that as saying that librxio (one of the third-party libraries) requires at least v3.4.9 of the standard library. But the version I have installed is 4.1.2: $ rpm -qa | grep libstdc compat-libstdc++-33-3.2.3-61.x86_64 libstdc++-devel-4.1.2-14.el5.i386 libstdc++-devel-4.1.2-14.el5.x86_64 libstdc++-4.1.2-14.el5.x86_64 libstdc++-4.1.2-14.el5.i386 Shouldn't this work? The shared object major number is 6, same as for v3.4.9. At this level, shouldn't this be backward compatible? It seems like the third-party library is looking for an earlier version of the standard library than what I have installed; but isn't there backward compatibility between versions with the same major number for the shared library? Again, I'm not really a C++ programmer; but I don't see what the problem is. Any advice greatly appreciated. Thanks.

    Read the article

  • Error in qsort function in Programming Pearls?

    - by Dervin Thunk
    Hello, is it just me or this code in Programming Pearls is wrong (quicksort wants 2 const voids, no?) If so, is my solution right? Apologies, just learning... int wordncmp(char *p, char* q) { int n = k; for ( ; *p == *q; p++, q++) if (*p == 0 && --n == 0) return 0; return *p - *q; } int sortcmp(char **p, char **q) { return wordncmp(*p, *q); } ... qsort(word, nword, sizeof(word[0]), sortcmp); Is this a solution? int sortcmp(const void *p, const void *q) { return wordncmp(* (char * const *) p, * (char * const *) q); }

    Read the article

  • I just can't figure out strcat.

    - by Anonymous
    I know I shouldn't be using that function, and I don't care. Last time I checked the spec for strcat, it said something along the lines of updating the first value as well as returning the same. Now, this is a really stupid question, and I want you to explain it like you're talking to a really stupid person. Why won't this work? char* foo="foo"; printf(strcat(foo,"bar")); EDIT: I don't know the difference between char[] and char*. How would I allocate a string of 255 characters? EDIT 2: OK, OK, so char[number] allocates a string of that many bytes? Makes sense. Thanks.

    Read the article

  • How to pass parameters with spaces via cstdlib system

    - by buchtak
    Hi, I have this windows console app which takes a file, do some calculations, and then writes the output to a specified file. The input is specified in "app.exe -input fullfilename" format. I need to call this application from my C++ program, but I have a problem with spaces in paths to files. When I call the app directly from cmd.exe by typing (without specifying output file for clarity) "c:\first path\app.exe" -input "c:\second path\input.file" everything works as expected. But, when I try using cstdlib std::system() function, i.e. std::system(" \"c:\\first path\\app.exe\" -input \"c:\\second path\\input.file\" "); the console prints out that c:\first is not any valid command. It's probably common mistake and has simple solution, but I have been unable to find any. Thx for any help.

    Read the article

  • How to raise an error, if the parsed number of a C++ stdlib stream is immediatly followed by a non whitespace character?

    - by Micha Wiedenmann
    In the following example, I didn't expect, that 1.2345foo would be parsed. Since I am reading data files, it is probably better to raise an error and notify the user. Is peek() the correct thing to do here? #include <iostream> #include <sstream> int main() { std::stringstream in("1.2345foo"); double x; in >> x; if (in) { std::cout << "good\n"; } else { std::cout << "bad\n"; } } Output good

    Read the article

  • Opa app does not load in Internet Explorer when compiled with Opa 1.1.1

    - by Marcin Skórzewski
    I did a minor update to the already working application and then had problems using new version of Opa compiler. First problem - runtime exception Since the original deployment Opa 1.1.1 has been released and it resulted in error: events.js:72 throw er; // Unhandled 'error' event ^ Error: listen EADDRINUSE at errnoException (net.js:901:11) at Server._listen2 (net.js:1039:14) at listen (net.js:1061:10) at Server.listen (net.js:1127:5) at global.BslNet_Http_server_init_server (/opt/mlstate/lib/opa/stdlib/server.opp/serverNodeJsPackage.js:223:1405) at global.BslNet_Http_server_init_server_cps (/opt/mlstate/lib/opa/stdlib/server.opp/serverNodeJsPackage.js:226:15) at __v1_bslnet_http_server_init_server_cps_b970f080 (/opt/mlstate/lib/opa/stdlib/stdlib.qmljs/stdlib.core.web.server.opx/main.js:1:175) at /opt/mlstate/lib/opa/stdlib/stdlib.qmljs/stdlib.core.web.server.opx/main.js:440:106 at global.execute_ (/opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:19:49) at /opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:17:78 I decided to build Opa from sources and it helped, but another problem occurred :( Second problem - stops to support the IE Application stopped to work in Internet Explorer. I tried two different machines (Windows XP and 7) with IE 8 and 10. Web page does not load at all (looks like the network problem, but the same URL works fine in Firefox). I confirmed the same problem with "Hello world" from the Opa tutorial compiled with both Opa stable 1.1.1 and build from sources. I suspected that the problem is due to Node.js update (Opa = 1.1.1 requires Node 0.10.* - now I am using 0.10.12, but I also tried other 0.10-s), but "Hello world" from the Node's from page works fine. I am running the app on OSX developer box and Linux Debian 7.0 server. Any suggestions what am I doing wrong? PS. I was off the business for a while. Anyone knows what happened to the Opa forum? Signing is seams not to work.

    Read the article

  • Error message during update from 13.04 to 13.10

    - by layonhands
    The following was reported after I attempted to report the problem back to Ubuntu: The problem cannot be reported: You have some obsolete package versions installed. Please upgrade the following packages and check if the problem still occurs: ubuntu-release-upgrader-gtk, apport, apport-gtk, apport-symptoms, apt, apt-utils, at-spi2-core, binutils, dbus, gcc-4.7-base, gdb, gir1.2-atk-1.0, gir1.2-gtk-3.0, glib-networking, glib-networking-common, glib-networking-services, gnupg, gpgv, ifupdown, initramfs-tools, initramfs-tools-bin, kmod, libappindicator3-1, libapt-inst1.5, libapt-pkg4.12, libasound2, libatk-bridge2.0-0, libatk1.0-0, libatk1.0-data, libatspi2.0-0, libc-bin, libc6, libcups2, libdbus-1-3, libdbusmenu-glib4, libdbusmenu-gtk3-4, libdrm-intel1, libdrm-nouveau2, libdrm-radeon1, libdrm2, libgail-3-0, libgcc1, libgcrypt11, libglib2.0-0, libglib2.0-data, libgnutls26, libgomp1, libgstreamer-plugins-base1.0-0, libgstreamer1.0-0, libgtk-3-0, libgtk-3-bin, libgtk-3-common, libgudev-1.0-0, libicu48, libindicator3-7, libkmod2, liblcms2-2, libpci3, libplymouth2, libpolkit-agent-1-0, libpolkit-backend-1-0, libpolkit-gobject-1-0, libprocps0, libpython-stdlib, libpython2.7, libpython2.7-minimal, libpython2.7-stdlib, libpython3-stdlib, libpython3.3-minimal, libpython3.3-stdlib, libssl1.0.0, libstdc++6, libtiff5, libudev1, libx11-6, libx11-data, libx11-xcb1, libxcb-dri2-0, libxcb-glx0, libxcb-render0, libxcb-shm0, libxcb1, libxcursor1, libxext6, libxfixes3, libxi6, libxinerama1, libxml2, libxrandr2, libxrender1, libxres1, libxt6, libxtst6, libxxf86vm1, lsb-base, lsb-release, module-init-tools, multiarch-support, openssl, passwd, pciutils, perl, perl-base, perl-modules, plymouth, plymouth-theme-ubuntu-text, policykit-1, procps, python, python-gi, python-minimal, python2.7, python2.7-minimal, python3, python3-apport, python3-distupgrade, python3-gi, python3-minimal, python3-problem-report, python3-software-properties, python3-update-manager, python3.3, python3.3-minimal, rsyslog, shared-mime-info, software-properties-common, software-properties-gtk, tar, tzdata, ubuntu-release-upgrader-core, ubuntu-release-upgrader-gtk, udev, update-manager, update-manager-core, update-notifier, update-notifier-common If this question has already been answered, I'm sorry for the repost, but I would appreciate a link to the fix. Thanks. FYI: Dell Latitude D630, Intel Centrino processor. Also, the updater is currently running what seems to be the update. I will report back when it is done going through its process to let you know if it is in fact the 13.10 update. Update 2: System went through an update, but it wasn't for the OS. I think it was an update for the error message mentioned above. Now the OS update is currently running the 'distribution upgrade' portion of the update. This is further than it had gone before. Again I will report back once this is done to let you know whether or not the update was successful. Final Update: Don't know for sure what happened, but I'm almost sure that the error mentioned above was resolved in the first update prior to the 13.10 update. All set.

    Read the article

  • Pointer initialization doubt

    - by Jestin Joy
    We could initialize a character pointer like this in C. char *c="test"; Where c points to the first character(t). But when I gave code like below. It gives segmentation fault. #include<stdio.h> #include<stdlib.h> main() { int *i; *i=0; printf("%d",*i); } But when I give #include<stdio.h> #include<stdlib.h> main() { int *i; i=(int *)malloc(2); *i=0; printf("%d",*i); } It works( gives output 0). Also when I give malloc(0), It also works( gives output 0). Please tell what is happening

    Read the article

  • Memory allocation for a matrix in C

    - by Snogzvwtr
    Why is the following code resulting in Segmentation fault? (I'm trying to create two matrices of the same size, one with static and the other with dynamic allocation) #include <stdio.h> #include <stdlib.h> //Segmentation fault! int main(){ #define X 5000 #define Y 6000 int i; int a[X][Y]; int** b = (int**) malloc(sizeof(int*) * X); for(i=0; i<X; i++){ b[i] = malloc (sizeof(int) * Y); } } Weirdly enough, if I comment out one of the matrix definitions, the code runs fine. Like this: #include <stdio.h> #include <stdlib.h> //No Segmentation fault! int main(){ #define X 5000 #define Y 6000 int i; //int a[X][Y]; int** b = (int**) malloc(sizeof(int*) * X); for(i=0; i<X; i++){ b[i] = malloc (sizeof(int) * Y); } } or #include <stdio.h> #include <stdlib.h> //No Segmentation fault! int main(){ #define X 5000 #define Y 6000 int i; int a[X][Y]; //int** b = (int**) malloc(sizeof(int*) * X); //for(i=0; i<X; i++){ // b[i] = malloc (sizeof(int) * Y); //} } I'm running gcc on Linux on a 32-bit machine.

    Read the article

  • Pointer initialization doubt

    - by Jestin Joy
    We could initialize a character pointer like this in C. char *c="test"; Where c points to the first character(t). But when I gave code like below. It gives segmentation fault. #include<stdio.h> #include<stdlib.h> main() { int *i=0; printf("%d",*i); } Also when I give #include<stdio.h> #include<stdlib.h> main() { int *i; i=(int *)malloc(2); printf("%d",*i); } It worked(gave output 0). When I gave malloc(0), it worked(gave output 0). Please tell what is happening

    Read the article

  • How to run an exe using c prog

    - by Ujjwal
    Hi All, I am new to this forum. I am in need of a program in C that runs an exe file in Windows. While googling I found the code below : 1. Code: #include<stdlib.h> #include<stdio.h> int main() { (void)system("C:\\Windows\\notepad.exe"); return 0; } The above code compiles successfully in Borland Turbo C. But it fails to run Notepad. 2 Code: #include<stdlib.h> #include<stdio.h> void main() { int result ; result=system("C:\\Windows\\notepad.exe"); printf("%d",result); } The above code on running gives -1 as output. Why am I getting -1. My OS Windows XP Borland Turbo C Compiler Please help.

    Read the article

  • Proper way to use hiera with puppetlabs-spec-helper?

    - by Lee Lowder
    I am trying to write some rspec tests for my modules. Most of them now use hiera. I have a .fixures.yml: fixtures: repositories: stdlib: https://github.com/puppetlabs/puppetlabs-stdlib.git hiera-puppet: https://github.com/puppetlabs/hiera-puppet.git symlinks: mongodb: "#{source_dir}" and a spec/classes/mongodb_spec.rb: require 'spec_helper' describe 'mongodb', :type => 'class' do context "On an Ubuntu install, admin and single user" do let :facts do { :osfamily => 'Debian', :operatingsystem => 'Ubuntu', :operatingsystemrelease => '12.04' } end it { should contain_user('XXXX').with( { 'uid' => '***' } ) should contain_group('XXXX').with( { 'gid' => '***' } ) should contain_package('mongodb').with( { 'name' => 'mongodb' } ) should contain_service('mongodb').with( { 'name' => 'mongodb' } ) } end end but when I run the spec test, I get: # rake spec /usr/bin/ruby1.8 -S rspec spec/classes/mongodb_spec.rb --color F Failures: 1) mongodb On an Ubuntu install, admin and single user Failure/Error: should contain_user('XXXX').with( { 'uid' => '***' } ) LoadError: no such file to load -- hiera_puppet # ./spec/fixtures/modules/hiera-puppet/lib/puppet/parser/functions/hiera.rb:3:in `function_hiera' # ./spec/classes/mongodb_spec.rb:15 Finished in 0.05415 seconds 1 example, 1 failure Failed examples: rspec ./spec/classes/mongodb_spec.rb:14 # mongodb On an Ubuntu install, admin and single user rake aborted! /usr/bin/ruby1.8 -S rspec spec/classes/mongodb_spec.rb --color failed Tasks: TOP => spec_standalone (See full trace by running task with --trace) Module spec testing is relatively new, as is hiera. So far I have been unable to find any suitable solutions. (the back and forth on puppet-dev was interesting, but not helpful). What changes do I need to make to get this to work? Installing puppet from a gem and hacking on rubylib isn't a viable solution due to corporate policy. I am using Ubuntu 12.04 LTS + Puppet 2.7.17 + hiera 0.3.0.

    Read the article

  • Package libxul not fount - Kiwix Wikpedia in Ubuntu Precise 12.04

    - by JHOSmAN
    I'm trying to install the service Kiwix but I need a library that is not available for Ubuntu 12.04 LTS Precise leave the log and if someone could tell me how to install Seller would appreciate. kiwix-0.9# ls aclocal.m4 COMPILE config.sub COPYING install-sh ltmain.sh missing static AUTHORS config.guess configure depcomp kiwix Makefile.am README CHANGELOG config.log configure.ac desktop libxul-dev_1.8.1.16+nobinonly-0ubuntu1_all.deb Makefile.in src root@ubuntu-MM061:/home/ubuntu/Escritorio/kiwix-0.9# ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... no checking for mawk... mawk checking whether make sets $(MAKE)... yes checking whether to enable maintainer-specific portions of Makefiles... no checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for g++... g++ checking whether we are using the GNU C++ compiler... yes checking whether g++ accepts -g... yes checking dependency style of g++... gcc3 checking for g++... g++ checking for cl... no checking for cl... no checking for Xcode... no checking for jar... jar checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by gcc... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B checking the name lister (/usr/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1572864 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking for /usr/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for ar... ar checking for strip... strip checking for ranlib... ranlib checking command to parse /usr/bin/nm -B output from gcc object... ok checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking whether we are using the GNU C++ compiler... (cached) yes checking whether g++ accepts -g... (cached) yes checking dependency style of g++... (cached) gcc3 checking how to run the C++ preprocessor... g++ -E checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... yes checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for ld used by g++... /usr/bin/ld checking if the linker (/usr/bin/ld) is GNU ld... yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking for g++ option to produce PIC... -fPIC -DPIC checking if g++ PIC flag -fPIC -DPIC works... yes checking if g++ static flag -static works... yes checking if g++ supports -c -o file.o... yes checking if g++ supports -c -o file.o... (cached) yes checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for ranlib... (cached) ranlib checking whether make sets $(MAKE)... (cached) yes checking for pkg-config... pkg-config checking for perl... perl checking fcntl.h usability... yes checking fcntl.h presence... yes checking for fcntl.h... yes checking float.h usability... yes checking float.h presence... yes checking for float.h... yes checking libintl.h usability... yes checking libintl.h presence... yes checking for libintl.h... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking stddef.h usability... yes checking stddef.h presence... yes checking for stddef.h... yes checking for stdint.h... (cached) yes checking for stdlib.h... (cached) yes checking for string.h... (cached) yes checking for strings.h... (cached) yes checking sys/socket.h usability... yes checking sys/socket.h presence... yes checking for sys/socket.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking for unistd.h... (cached) yes checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking for stdbool.h that conforms to C99... yes checking for _Bool... no checking for inline... inline checking for int16_t... yes checking for int32_t... yes checking for int64_t... yes checking for int8_t... yes checking for off_t... yes checking for pid_t... yes checking for size_t... yes checking for uint16_t... yes checking for uint32_t... yes checking for uint64_t... yes checking for uint8_t... yes checking for ptrdiff_t... yes checking vfork.h usability... no checking vfork.h presence... no checking for vfork.h... no checking for fork... yes checking for vfork... yes checking for working fork... yes checking for working vfork... (cached) yes checking for stdlib.h... (cached) yes checking for GNU libc compatible malloc... yes checking for working strtod... yes checking for getcwd... yes checking for gettimeofday... yes checking for memmove... yes checking for memset... yes checking for pow... yes checking for regcomp... yes checking for sqrt... yes checking for strcasecmp... yes checking for strchr... yes checking for strdup... yes checking for strerror... yes checking for strtol... yes Package libxul was not found in the pkg-config search path. Perhaps you should add the directory containing libxul.pc' to the PKG_CONFIG_PATH environment variable No package 'libxul' found Package libxul was not found in the pkg-config search path. Perhaps you should add the directory containinglibxul.pc' to the PKG_CONFIG_PATH environment variable No package 'libxul' found checking for /stable... no checking for "/nsISupports.idl"... no configure: error: unable to find nsISupports.idl apt-get install libxul Leyendo lista de paquetes... Hecho Creando árbol de dependencias Leyendo la información de estado... Hecho E: No se ha podido localizar el paquete libxul

    Read the article

  • FLEX/BISON : Why my rule is not regonized ?

    - by Natim
    Hi, I am trying to do a little exercice in FLEX and BISON. Here is the code I wrote : calc_pol.y %{ #define YYSTYPE double #include "calc_pol.tab.h" #include <math.h> #include <stdlib.h> %} %start line %token NOMBRE %token FIN %% line: exp '\n' { printf("\t%.2lf\n", $1); }; exp: exp exp '+' { $$ = $1 + $2 ;} | exp exp '-' { $$ = $1 - $2 ;} | exp exp '*' { $$ = $1 * $2 ;} | exp exp '/' { $$ = $1 / $2 ;} | exp exp '^' { $$ = pow($1, $2) ;} | NOMBRE; %% calc_pol.l %{ #include "calc_pol.tab.h" #include <stdlib.h> #include <stdio.h> extern YYSTYPE yylval; %} blancs [ \t]+ chiffre [0-9] entier [+-]?[1-9][0-9]* | 0 reel {entier}('.'{entier})? %% {blancs} {reel} { yylval = atof(yytext); return NOMBRE; } \n { return FIN; } . { return yytext[0]; } %% Makefile all: calc_pol.tab.c lex.yy.c gcc -o calc_pol $< -ly -lfl -lm calc_pol.tab.c: calc_pol.y bison -d calc_pol.y lex.yy.c: calc_pol.l flex calc_pol.l Do you have any idea of what's wrong ? Thanks Edited: The error message is flex calc_pol.l: calc_pol.l:18: règle non reconnue Line 18 is the line beginning with {reel}, and the error message translates to English as "unrecognized rule".

    Read the article

  • ZF2: How to get Zend\Navigation inside custom router?

    - by Katan87
    I have custom router and I have to get access to Zend\Navigation inside this custom router. I was googling, asking and searching and no results :/ All I need is to find nodes with 'link' param using Zend\Navigation in my AliasSegment::match function. Here is my module.config.php: 'navigation' => array( // The DefaultNavigationFactory we configured in (1) uses 'default' as the sitemap key 'default' => array( // And finally, here is where we define our page hierarchy 'account' => array( 'label' => 'Account', 'route' => 'node', 'pages' => array( 'home' => array( 'label' => 'Dashboard', 'route' => 'node', 'params' => array( 'id' => '1', 'link' => '/about/gallery' ), ), 'login' => array( 'label' => 'Sign In', 'route' => 'node', 'params' => array( 'id' => '1', 'link' => '/signin' ), ), 'logout' => array( 'label' => 'Sign Out', 'route' => 'node', ), ), ), ), ), [...] 'service_manager' => array( 'factories' => array( 'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory', 'Navigation' => 'Zend\Navigation\Service\DefaultNavigationFactory', ), ), [...] And here is my AliasSegment class: namespace Application\Controller; use Traversable; use Zend\Mvc\Router\Exception; use Zend\Stdlib\ArrayUtils; use Zend\Stdlib\RequestInterface as Request; use Zend\Mvc\Router\Http; class AliasSegment extends \Zend\Mvc\Router\Http\Segment { public function match(Request $request, $pathOffset = null) { //Here i need to have access to Zend\Navigation return parent::match($request, $pathOffset); } }

    Read the article

  • why malloc+memset slower than calloc?

    - by kingkai
    It's known that calloc differentiates itself with malloc in which it initializes the memory alloted. With calloc, the memory is set to zero. With malloc, the memory is not cleared. So in everyday work, i regard calloc as malloc+memset. Incidentally, for fun, i wrote the following codes for benchmark. The result is confused. Code 1: #include<stdio.h> #include<stdlib.h> #define BLOCK_SIZE 1024*1024*256 int main() { int i=0; char *buf[10]; while(i<10) { buf[i] = (char*)calloc(1,BLOCK_SIZE); i++; } } time ./a.out real 0m0.287s user 0m0.095s sys 0m0.192s Code 2: #include<stdio.h> #include<stdlib.h> #include<string.h> #define BLOCK_SIZE 1024*1024*256 int main() { int i=0; char *buf[10]; while(i<10) { buf[i] = (char*)malloc(BLOCK_SIZE); memset(buf[i],'\0',BLOCK_SIZE); i++; } } time ./a.out real 0m2.693s user 0m0.973s sys 0m1.721s Repalce memset with bzero(buf[i],BLOCK_SIZE) in Code 2 produce the result alike. My Question is that why malloc+memset is so much slower than calloc? How can calloc do that ? Thanks!

    Read the article

  • Why does the order of the loops affect performance when iterating over a 2D array? [closed]

    - by Mark
    Possible Duplicate: Which of these two for loops is more efficient in terms of time and cache performance Below are two programs that are almost identical except that I switched the i and j variables around. They both run in different amounts of time. Could someone explain why this happens? Version 1 #include <stdio.h> #include <stdlib.h> main () { int i,j; static int x[4000][4000]; for (i = 0; i < 4000; i++) { for (j = 0; j < 4000; j++) { x[j][i] = i + j; } } } Version 2 #include <stdio.h> #include <stdlib.h> main () { int i,j; static int x[4000][4000]; for (j = 0; j < 4000; j++) { for (i = 0; i < 4000; i++) { x[j][i] = i + j; } } }

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >