Search Results

Search found 2880 results on 116 pages for 'deep linking'.

Page 11/116 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • how can I declare a value deep in an object tree using variable properties in javascript

    - by joshs
    I am trying to have a javascript object tree behave like a php associative array in the following way. var key1 = 'a'; var key2 = 'b'; var key3 = 'c'; var obj[key1][key2][key3] = 'd'; However, in javascript I believe you need to define each property/object pair individually, forming deeper leaves. Something like: var obj[key1] = {}; var obj[key1][key2] = {}; ... Is there a way to simplify or shorten this script? Thanks

    Read the article

  • iPhone Core Data - Access deep attributes with to many relationships

    - by ncohen
    Hi everyone, Let say I have an entity user which has a one to many relationship with the entity menu which has a one to many relationship with the entity meal which has a many to one relationship with the entity recipe which has a one to many relationship with the entity element. What I would like to do is to select the elements which belong to a particular user (username = myUsername) and particular menu*s* (minDate < menu.date < maxDate). Does anyone have an idea how to get them? Thanks

    Read the article

  • Step by Step / Deep explain: The Power of (Co)Yoneda (preferably in scala) through Coroutines

    - by Mzk
    some background code /** FunctorStr: ? F[-]. (? A B. (A -> B) -> F[A] -> F[B]) */ trait FunctorStr[F[_]] { self => def map[A, B](f: A => B): F[A] => F[B] } trait Yoneda[F[_], A] { yo => def apply[B](f: A => B): F[B] def run: F[A] = yo(x => x) def map[B](f: A => B): Yoneda[F, B] = new Yoneda[F, B] { def apply[X](g: B => X) = yo(f andThen g) } } object Yoneda { implicit def yonedafunctor[F[_]]: FunctorStr[({ type l[x] = Yoneda[F, x] })#l] = new FunctorStr[({ type l[x] = Yoneda[F, x] })#l] { def map[A, B](f: A => B): Yoneda[F, A] => Yoneda[F, B] = _ map f } def apply[F[_]: FunctorStr, X](x: F[X]): Yoneda[F, X] = new Yoneda[F, X] { def apply[Y](f: X => Y) = Functor[F].map(f) apply x } } trait Coyoneda[F[_], A] { co => type I def fi: F[I] def k: I => A final def map[B](f: A => B): Coyoneda.Aux[F, B, I] = Coyoneda(fi)(f compose k) } object Coyoneda { type Aux[F[_], A, B] = Coyoneda[F, A] { type I = B } def apply[F[_], B, A](x: F[B])(f: B => A): Aux[F, A, B] = new Coyoneda[F, A] { type I = B val fi = x val k = f } implicit def coyonedaFunctor[F[_]]: FunctorStr[({ type l[x] = Coyoneda[F, x] })#l] = new CoyonedaFunctor[F] {} trait CoyonedaFunctor[F[_]] extends FunctorStr[({type l[x] = Coyoneda[F, x]})#l] { override def map[A, B](f: A => B): Coyoneda[F, A] => Coyoneda[F, B] = x => apply(x.fi)(f compose x.k) } def liftCoyoneda[T[_], A](x: T[A]): Coyoneda[T, A] = apply(x)(a => a) } Now I thought I understood yoneda and coyoneda a bit just from the types – i.e. that they quantify / abstract over map fixed in some type constructor F and some type a, to any type B returning F[B] or (Co)Yoneda[F, B]. Thus providing map fusion for free (? is this kind of like a cut rule for map ?). But I see that Coyoneda is a functor for any type constructor F regardless of F being a Functor, and that I don't fully grasp. Now I'm in a situation where I'm trying to define a Coroutine type, (I'm looking at https://www.fpcomplete.com/school/to-infinity-and-beyond/pick-of-the-week/coroutines-for-streaming/part-2-coroutines for the types to get started with) case class Coroutine[S[_], M[_], R](resume: M[CoroutineState[S, M, R]]) sealed trait CoroutineState[S[_], M[_], R] object CoroutineState { case class Run[S[_], M[_], R](x: S[Coroutine[S, M, R]]) extends CoroutineState[S, M, R] case class Done[R](x: R) extends CoroutineState[Nothing, Nothing, R] class CoroutineStateFunctor[S[_], M[_]](F: FunctorStr[S]) extends FunctorStr[({ type l[x] = CoroutineState[S, M, x]})#l] { override def map[A, B](f : A => B) : CoroutineState[S, M, A] => CoroutineState[S, M, B] = { ??? } } } and I think that if I understood Coyoneda better I could leverage it to make S & M type constructors functors way easy, plus I see Coyoneda potentially playing a role in defining recursion schemes as the functor requirement is pervasive. So how could I use coyoneda to make type constructors functors like for example coroutine state? or something like a Pause functor ?

    Read the article

  • Deep copying of tree view nodes.

    - by Kanags.Net
    I'm trying to copy a treeview nodes to treenodecollection for some other processing. When i execute the treeview.nodes.clear() in the next line, my treenodecollection is becoming null. Can you please tell me how to copy the treeview nodes to treenodecollection and keep the copies of the nodes even after calling Clear method of actual tree view nodes? TreeNodeCollection tnc = null; private TypeIn() { tnc = treeView1.Nodes; treeView1.Nodes.Clear(); //Now my tnc becomes null, but I want the tnc for future use. }

    Read the article

  • How deep are your unit tests?

    - by John Nolan
    The thing I've found about TDD is that its takes time to get your tests set up and being naturally lazy I always want to write as little code as possible. The first thing I seem do is test my constructor has set all the properties but is this overkill? My question is to what level of granularity do you write you unit tests at? ..and is there a case of testing too much?

    Read the article

  • Deep relationships in Rails

    - by Neil Middleton
    I have some projects. Those projects have users through memberships. However, those users belong to companies. Question is, how do I find out which companies can access a project? Ideally I'd be able to do project.users.companies, but that won't work. Is there a nice, pleasant way of doing this?

    Read the article

  • CakePHP 3-level-deep model associatons

    - by user357452
    Hi, I am relatively new to CakePHP, I am doing fine with the documentation, but I've been trying to find a way out to this problem for weeks and I don't seem to find the solution, I am sure it is easy and maybe even automagicaly doable, but I just don't know how to find it (maybe I don't know the jargon for these kind of things) My model structure is like this: <?php class Trip extends AppModel { var $belongsTo = array( 'User' => array( 'className' => 'User', 'foreignKey' => 'user_id' ), 'Start' => array( 'className' => 'Place', 'foreignKey' => 'start_id' ), 'End' => array( 'className' => 'Place', 'foreignKey' => 'end_id' ), 'Transport' => array( 'className' => 'Transport', 'foreignKey' => 'transport_id' ) ); } ?> <?php class Place extends AppModel { var $belongsTo = array( 'User' => array( 'className' => 'User', 'foreignKey' => 'user_id' ), 'Country' => array( 'className' => 'Country', 'foreignKey' => 'country_id' ), 'State' => array( 'className' => 'State', 'foreignKey' => 'state_id' ), 'City' => array( 'className' => 'City', 'foreignKey' => 'city_id' ) ); var $hasMany = array( 'PlaceStart' => array( 'className' => 'trip', 'foreignKey' => 'start_id', 'dependent' => false ), 'PlaceEnd' => array( 'className' => 'trip', 'foreignKey' => 'end_id', 'dependent' => false ) ); } ?> <?php class State extends AppModel { var $belongsTo = array( 'Country' => array( 'className' => 'Country', 'foreignKey' => 'country_id', 'conditions' => '', 'fields' => '', 'order' => '' ) ); var $hasMany = array( 'City' => array( 'className' => 'City', 'foreignKey' => 'city_id', 'dependent' => false ) ); } ?> ... and so forth with User, City, Country, and Transport Models. What I am trying to achieve is to get all the information of the whole tree when I search for a Trip. <?php class TripController extends AppController { function index() { debug($this->Trip->find('first')); } } Outputs Array ( [Trip] => Array ( [id] => 6 [created] => 2010-05-04 00:23:59 [user_id] => 4 [start_id] => 2 [end_id] => 1 [title] => My trip [transport_id] => 1 ) [User] => Array ( [id] => 4 [name] => John Doe [email] => [email protected] ) [Start] => Array ( [id] => 2 [user_id] => 4 [country_id] => 1 [state_id] => 1 [city_id] => 1 [direccion] => Lincoln Street ) [End] => Array ( [id] => 1 [user_id] => 4 [country_id] => 1 [state_id] => 1 [city_id] => 4 [address] => Fifth Avenue ) [Transport] => Array ( [id] => 1 [name] => car ) ) Here is the question: How do I get in one query all the information down the tree? I would like to have something like Array ( [Trip] => Array ( [id] => 6 [created] => 2010-05-04 00:23:59 [User] => Array ( [id] => 4 [name] => John Doe [email] => [email protected] ) [Start] => Array ( [id] => 2 [user_id] => 4 [Country] => Array ( [id] => 1 [name] = Spain ) [State] => Array ( [id] => 1 [name] = Barcelona ) [City] => Array ( [id] => 1 [name] = La Floresta ) [address] => Lincoln Street ) [End] => (same as Start) [title] => My trip [Transport] => Array ( [id] => 1 [name] => car ) ) ) Can CakePHP create this kind of data? Not only for $this->Model->find() but also for $this->paginate() as for example: // filter by start if(isset($this->passedArgs['start'])) { //debug('isset '.$this->passedArgs['start']); $start = $this->passedArgs['start']; $this->paginate['conditions'][] = array( 'OR' => array( 'Start.address LIKE' => "%$start%", 'Start.State.name LIKE' => "%$start%", 'Start.City.name LIKE' => "%$start%", 'Start.Country.name LIKE' => "%$start%" ) ); $this->data['Search']['start'] = $start; } It seems like a rough question but I am sure this is extensively done and documented, I'd really appreciate any help. Thanks Cheers Naoise

    Read the article

  • Praw (Redditt API) How to retrieve replies to a comment past 10 levels deep

    - by jpreed00
    Ok, so I've written some code that, for all intents and purposes, should work: def checkComments(comments): for comment in comments: print comment.body checkComments(comment.replies) def processSub(sub): sub.replace_more_comments(limit=None, threshold=0) checkComments(sub.comments) #login and subreddit init stuff here subs = mysubreddit.get_hot(limit=50) for sub in subs: processSub(sub) However, given a submission that has 50 nested replies like so: root comment -> 1st reply -> 2nd reply -> 3rd reply ... -> 50th reply The above code only prints: root comment 1st reply 2nd reply 3rd reply 4th reply 5th reply 6th reply 7th reply 8th reply 9th reply Any idea how I can get the remaining 41 levels of replies? Or is this a praw limitation?

    Read the article

  • Static linking in Qt --> link errors in VS 2008

    - by ChruS
    Today I dediced to make static linking in Qt. I used Qt4 with Visual Studio and static C runtime article. The 3rd step took quite a long time. When it was finished I opened my project in VS 2008, made Build->Clean Solution and try to Release. Unfortunately I got link errors: warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library error LNK2019: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A) referenced in function "public: __thiscall QString::QString(void)" (??0QString@@QAE@XZ) error LNK2019: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) referenced in function "public: __thiscall QByteArray::QByteArray(void)" (??0QByteArray@@QAE@XZ) error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2019: unresolved external symbol "public: static enum QSysInfo::WinVersion const QSysInfo::WindowsVersion" (?WindowsVersion@QSysInfo@@2W4WinVersion@1@B) referenced in function _WinMain@16 What i did wrong? Help to fix this pls.

    Read the article

  • Linking to MSVC DLL from MinGW

    - by IndigoFire
    I'm trying to link the LizardTech GeoExpress DSDK into my own application. I use gcc so that we can compile on for platforms. On Linux and Mac this works easily: they provide a static library (libltidsdk.a) and headers and all that we have to do is use them. Compiling for windows isn't so easy. They've built the library using Microsoft Visual Studio, and we use MinGW. I've read the MinGW FAQ, and I'm running into the problems below. The library is all C++, so my first question: is this even possible? Just linking against the dll as provided yields "undefined reference" errors for all of the C++ calls (constructors, desctructors, methods, etc). Based on the MinGW Wiki: http://www.mingw.org/wiki/MSVC%5Fand%5FMinGW%5FDLLs I should be able to use the utility reimp to convert a .lib into something useable. I've tried all of the .lib files provided by LizardTech, and they all give "invalid or corrupt import library". I've tried both version 0.4 and 0.3 of the reimp utility. Using the second method described in the wiki, I've run pexport and dlltool over the dll to get a .a archive, but that produces the same undefined references. BTW: I have read the discussion below. It left some ambiguity as to whether this is possible, and given the MinGW Wiki page it seems like this should be doable. If it is impossible, that's all I need to know. If it can be done, I'd like to know how I can get this to happen. stackoverflow.com/questions/1796209/how-to-link-to-vs2008-generated-libs-from-g Thanks!

    Read the article

  • Using OpenCV in QTCreator (linking problem)

    - by Jane
    Greetings! I have a problem with the linking simpliest test program in QTCreator: CODE: #include <QtCore/QCoreApplication> #include <cv.h> #include<highgui.h> #include <cxcore.hpp> using namespace cv; int _tmain(int argc, _TCHAR* argv[]) { cv::Mat M(7,7,CV_32FC2,Scalar(1,3)); return 0; } .pro file: QT -= gui TARGET = testopencv CONFIG += console CONFIG -= app_bundle INCLUDEPATH += C:/OpenCV2_1/include/opencv TEMPLATE = app LIBS += C:/OpenCV2_1/lib/cxcore210d.lib \ C:/OpenCV2_1/lib/cv210d.lib \ C:/OpenCV2_1/lib/highgui210d.lib\ C:/OpenCV2_1/lib/cvaux210d.lib SOURCES += main.cpp I've tried to use -L and -l like LIBS+= -LC:/OpenCV2_1/lib -lcxcored ang .pri file QMAKE_LIBDIR += C:/OpenCV2_1/lib/Debug LIBS += -lcxcore210d \ -lcv210d \ -lhighgui210d The errors are like debug/main.o:C:\griskin\test\app\testopencv/../../../../OpenCV2_1/include/opencv/cxcore.hpp:97: undefined reference to cv::format(char const*, ...)' Could anyone help me? Thanks! In Visual Studio it works but I need it works in QTCreator..

    Read the article

  • ELF: linking: Why do I get undefined references in .so files

    - by ki.lya.online.fr
    Hi, I'm trying to build a program against wxWidgets, and I get a linker error. I'd like to really understand what it means. The error is: /usr/lib/libwx_baseu-2.8.so: undefined reference to `std::ctype<char>::_M_widen_init() const@GLIBCXX_3.4.11' What I don't understand is why the error is at libwx_baseu-2.8.so. I thought that .so files had all its symbols resolved, contrary to .o files that still need linking. When I ldd the .so, I get can resolve all its linked libraries, so there is no problem there: $ ldd /usr/lib/libwx_baseu-2.8.so linux-gate.so.1 => (0x00476000) libz.so.1 => /lib/libz.so.1 (0x00d9c000) libdl.so.2 => /lib/libdl.so.2 (0x002a8000) libm.so.6 => /lib/libm.so.6 (0x00759000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x002ad000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x0068d000) libpthread.so.0 => /lib/libpthread.so.0 (0x006f0000) libc.so.6 => /lib/libc.so.6 (0x00477000) /lib/ld-linux.so.2 (0x007f6000) Does it means that the .so file was not compiled correctly (in that case, it's a bug in my distribution package) or does it means that there are missing libraries on the linker command line for my particular program? Additionally, do you know how I can get a list on undefined symbols in an ELF file. I tried readelf -s but I can't find the missing symbol. Thank you. Mildred

    Read the article

  • How to run autoconf in OSX linking to specified OS SDK

    - by kroko
    Hello! I have written a small command line tool that includes some GPL code. Everything runs smothly. Using os 10.6. The external code used has a config.h header file, made by calling autoconf. I'd like to deploy the tool to different OS versions. Thus config.h could look like // config.h #if MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_4 // autoconf created config.h content for 10.4 comes here #elif MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_5 // autoconf created config.h content for 10.5 comes here #elif MAC_OS_X_VERSION_MAX_ALLOWED == MAC_OS_X_VERSION_10_6 // autoconf created config.h content for 10.6 comes here #else #error "muahahaha" #endif What is the way to tell autoconf to use /Developer/SDKs/MacOSX10.XXXX.sdk/usr/ while generating the config.h? In order to test it I have run #!/bin/bash # for 10.6 export CC="/usr/bin/gcc-4.2" export CXX="/usr/bin/g++-4.2" export MACOSX_DEPLOYMENT_TARGET="10.6" export OSX_SDK="/Developer/SDKs/MacOSX10.6.sdk" export OSX_CFLAGS="-isysroot $OSX_SDK -arch x86_64 -arch i386" export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch x86_64 -arch i386" export CFLAGS=$OSX_CFLAGS export CXXFLAGS=$OSX_CFLAGS export LDFLAGS=$OSX_LDFLAGS before calling ./configure on OS 10.6. I know that the configure script looks for libintl.h, which is not in the "out of box 10.6 / SDK", but is present in the local machine under /usr/local The config.h header file produced with method described above has info that libintl.h is in the system- thus "linking" autoconf only to SDK has failed. Is it happening because... "we don't have a crystal ball"? :). Or is it incorrect "setup"/flag-export before running autoconf, which I hope is the case? If so, then what would be the correct way to set up envvariables? Many thanks in advance.

    Read the article

  • Static linking in Qt --> link errors in VS 2008

    - by ChruS
    Today I dediced to make static linking in Qt. I used Qt4 with Visual Studio and static C runtime article. The 3rd step took quite a long time. When it was finished I opened my project in VS 2008, made Build->Clean Solution and try to Release. Unfortunately I got link errors: warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library error LNK2019: unresolved external symbol "private: static struct QString::Data QString::shared_null" (?shared_null@QString@@0UData@1@A) referenced in function "public: __thiscall QString::QString(void)" (??0QString@@QAE@XZ) error LNK2019: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) referenced in function "public: __thiscall QByteArray::QByteArray(void)" (??0QByteArray@@QAE@XZ) error LNK2001: unresolved external symbol "private: static struct QByteArray::Data QByteArray::shared_null" (?shared_null@QByteArray@@0UData@1@A) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2001: unresolved external symbol "public: static struct QMetaObject const QDialog::staticMetaObject" (?staticMetaObject@QDialog@@2UQMetaObject@@B) error LNK2019: unresolved external symbol "public: static enum QSysInfo::WinVersion const QSysInfo::WindowsVersion" (?WindowsVersion@QSysInfo@@2W4WinVersion@1@B) referenced in function _WinMain@16 What i did wrong? Help to fix this pls.

    Read the article

  • dlopen / dlsym with as little linking as possible

    - by johannes
    I have an application which can make use of plugins which are loaded at runtime using dlopen. Each of the plugins defines a function toretrieve the plugin information which is defined using a common structure. Something like that: struct plugin { char *name; char *app_version; int app_verion_id; char *plugin_version; int plugin_version_id; /* ... */ }; struct plugin p = { "sample plugin",APP_VERION,APP_VERSION_ID,"1.2.3",10203 }; struct plugin *get_plugin() { return &p; } This works well and plugins can be loaded. Now i want to build a small tool to read these properties without linking the whole application. For doing that I have some code like this: void *handle; struct plugin *plugin; struct plugin *(get_plugin*)(); handle = dlopen(filename, RTLD_LAZY); if (!handle) { /*...return; ...*/ } get_plugin = dlym(handle, "get_plugin"); if (!get_plugin) { /*...return; ...*/ } plugin = get_plugin(); printf("Plugin: %s\n", plugin->name); This works nice for simple plugins. The issue is that many plugins reference further symbols from the application, which are resolved even though RTLD_LAZY was set. (like global variables from the application which are used to initialize plugin-global things) So the dlopen() call fails with an error like fatal: relocation error: file sample_plugin.so: symbol application_some_symbol: referenced symbol not found. As I just want to have access to the single simple structure I was wondering how I can prevent the linker from doing that much of his work.

    Read the article

  • Error While Linking Multiple C Object files in Delphi 2007

    - by Ramnish
    Hello Everyone. I am new to delphi. I was trying to add C Object files in my Delphi project and link them directly since Delphi Supports C Object Linking. I got it working when i link a single Object file. But when i try to link multiple object files, i am getting error 'Unsatisfied forward or external declaration'. I have tried this in Delphi 2007 as well as XE.So what am i doing wrong here? Working Code: function a_function():Integer;cdecl; implementation {$Link 'a.obj'} function a_function():Integer;cdecl;external; end. Error Code: function a_function():Integer;cdecl; function b_function();Integer;cdecl; function c_function();Integer;cdecl; implementation {$LINK 'a.obj'} {$LINK 'b.obj'} {$LINK 'c.obj'} function a_function():Integer;cdecl;external; function b_function();Integer;cdecl;external; function c_function();Integer;cdecl;external; end.

    Read the article

  • Force compile-time linking of all classes in a SWC

    - by aaaidan
    Using Flash CS4, I am making a game that has a dozen or so sounds and a couple of music tracks. To cut down on publish/compile time, I have moved the sounds and music into an (external) SWC, which is located in a "Library Path" for the project. This works, but with a caveat... Until before I externalised the assets, I had been dynamically instantiating the Sound objects of the embedded sound by getting their classes with getDefinitionByName. // something like... var soundSubClass:Class = Class(getDefinitionByName(soundClassName)); var mySound:Sound = new soundSubClass(); But now that they're located in an external SWC, I need to have "concrete" references to the classes in order to load them like this, otherwise they are not included in the published SWF, and there is a runtime error when getDefinitionByName tries to get a class that doesn't exist. So, my question: in Flash Professional CS4, is there any way to force a library's assets to be included, regardless of whether they are statically linked? FlashDevelop has a compiler option "SWC Include Libraries", which is exactly what I want, and is distinct from the "SWC Libraries" option. The description of the "SWC Include Libraries" option is "Links all classes inside a SWC file to the resulting application SWF file, regardless of whether or not they are used." (Also, it's important to me that all the assets are contained within the one compiled SWF. Linking at runtime isn't what I'm after.)

    Read the article

  • Linking the Linker script file to source code

    - by user304097
    Hello , I am new to GNU compiler. I have a C source code file which contains some structures and variables in which I need to place certain variables at a particular locations. So, I have written a linker script file and used the __ attribute__("SECTION") at variable declaration, in C source code. I am using a GNU compiler (cygwin) to compile the source code and creating a .hex file using -objcopy option, but I am not getting how to link my linker script file at compilation to relocate the variables accordingly. I am attaching the linker script file and the C source file for the reference. Please help me link the linker script file to my source code, while creating the .hex file using GNU. /*linker script file*/ /*defining memory regions*/ MEMORY { base_table_ram : org = 0x00700000, len = 0x00000100 /*base table area for BASE table*/ mem2 : org =0x00800200, len = 0x00000300 /* other structure variables*/ } /*Sections directive definitions*/ SECTIONS { BASE_TABLE : { } > base_table_ram GROUP : { .text : { } { *(SEG_HEADER) } .data : { } { *(SEG_HEADER) } .bss : { } { *(SEG_HEADER) } } > mem2 } C source code: const UINT8 un8_Offset_1 __attribute__((section("BASE_TABLE"))) = 0x1A; const UINT8 un8_Offset_2 __attribute__((section("BASE_TABLE"))) = 0x2A; const UINT8 un8_Offset_3 __attribute__((section("BASE_TABLE"))) = 0x3A; const UINT8 un8_Offset_4 __attribute__((section("BASE_TABLE"))) = 0x4A; const UINT8 un8_Offset_5 __attribute__((section("BASE_TABLE"))) = 0x5A; const UINT8 un8_Offset_6 __attribute__((section("SEG_HEADER"))) = 0x6A; My intention is to place the variables of section "BASE_TABLE" at the address defined i the linker script file and the remaining variables at the "SEG_HEADER" defined in the linker script file above. But after compilation when I look in to the .hex file the different section variables are located in different hex records, located at an address of 0x00, not the one given in linker script file . Please help me in linking the linker script file to source code. Are there any command line options to link the linker script file, if any plese provide me with the info how to use the options. Thanks in advance, SureshDN.

    Read the article

  • Objective C, Linking Error with extern variable..

    - by LCYSoft
    I have a very simple java code like this. I don't have any idea how to do this in Objective C. Especially, the static part which calls the getLocalAddress() method and assign it into the static string variable. I know how to set a static variable and a static method in Objective but I dont know how to implement that static { } part in java. Thanks in advance... public class Address { public static String localIpAddress; static { localIpAddress = getLocalIpAddress(); } public Address() { } static String getLocalIpAddress() { //do something to get local ip address } } I added this in my .h file #import <Foundation/Foundation.h> extern NSString *localIpAddress; @class WifiAddrss; @interface Address : NSObject { } @end And my .m file looks like #import "Address.h" #import "WifiAddress.h" @implementation Address +(void)initialize{ if(self == [Address class]){ localIpAddress = [self getLocalIpAddress]; } } +(NSString *)getLocalIpAddress{ return address here } -(id)init{ self = [super init]; if (self == nil){ NSLog(@"init error"); } return self; } @end And Now I am getting a linking error and it complains about "extern NSString *localIpAddress" part. If I change the extern to static, it works fine. But what I wanted to do is that I want make the scope of "localIpAddress" variable as grobal. Since if I put "static" in front of a variable in Objective-C then the variable is only visible in the class. But this time, I want to make that as a grobal variable. So my question is how to make "localIpAddress" variable as a grobal variable which is initialized once when the first time Address class is created.. Thanks in advance...

    Read the article

  • FLTK in Cygwin using Eclipse (Linking errors)

    - by qpingu
    I have this assignment due that requires the usage of FLTK. The code is given to us and it should compile straight off of the bat, but I am having linking errors and do not know which other libraries I need to include. I currently have "opengl32", "fltk_gl", "glu32", and "fltk" included (-l), each of which seem to reduce the number of errors. I compiled FLTK using make with no specified options. Including all of the produced library files doesn't fix the problem, and I'm convinced that it's just some Windows specific problem. Compile log: **** Build of configuration Debug for project CG5 **** make all Building target: CG5.exe Invoking: Cygwin C++ Linker g++ -o"CG5.exe" ./src/draw_routines.o ./src/gl_window.o ./src/my_shapes.o ./src/shape.o ./src/shapes_ui.o ./src/tesselation.o -lopengl32 -lfltk_z -lfltk_gl -lglu32 -lfltk /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x197): undefined reference to `_SelectPalette@12' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x1a7): undefined reference to `_RealizePalette@4' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x1fe): undefined reference to `_glDrawBuffer@4' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x20d): undefined reference to `_glReadBuffer@4' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x23a): undefined reference to `_glGetIntegerv@8' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x2c3): undefined reference to `_glOrtho@48' /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../libfltk_gl.a(Fl_Gl_Window.o):Fl_Gl_Window.cxx:(.text+0x2f3): undefined reference to `_SwapBuffers@4' ...and lots more Thanks a ton for the help. EDIT: These first few lines are obviously OpenGL related, although I'm still not sure what additional libraries need to be included.

    Read the article

  • Linking error while using Qt static built libraries

    - by Kamran Amini
    I hope this is not a duplicate. Recently I'm developing a native C++ application using Qt 4.8.3 and VS2008. Since clients run the application on their naked machines, they need to install VC++ 2008 Redistribution package. So I decided to make it statically linked. I changed my project settings (C/C++ Code Generation Runtime Library) to /MTd. Also I compiled Qt again, this time using following commands for a static building; originally found on this blog Static Qt with static CRT (VS 2008) 1- replaced -MD with -MT in lines QMAKE_CFLAGS_RELEASE and QMAKE_CFLAGS_DEBUG in %QDIR%\mkspecs\win32-msvc2008\qmake.conf 2- nmake confclean 3- configure -static -platform win32-msvc2008 -no-webkit 4- nmake sub-src I compiled Qt successfully. But when I tried again to compile my application, it gave me some strange errors. 1>Linking... 1>qtmaind.lib(qtmain_win.obj) : error LNK2005: "public: bool __thiscall QBasicAtomicInt::deref(void)" (?deref@QBasicAtomicInt@@QAE_NXZ) already defined in QtCored4.lib(QtCored4.dll) 1>qtmaind.lib(qtmain_win.obj) : error LNK2005: "public: bool __thiscall QBasicAtomicInt::operator!=(int)const " (??9QBasicAtomicInt@@QBE_NH@Z) already defined in QtCored4.lib(QtCored4.dll) 1>qtmaind.lib(qtmain_win.obj) : error LNK2005: "public: __thiscall QString::~QString(void)" (??1QString@@QAE@XZ) already defined in QtCored4.lib(QtCored4.dll) I changed some lib files but with each change, situation got worse; for example I tried to use QtCored.lib instead of QtCored4.lib because it is newly created after compilation. I think I've missed something in building static Qt libs. Thanks.

    Read the article

  • Botan linking error on Windows MSVC

    - by Jake Petroules
    I am trying to compile a library linking to the version of Botan from the Qt Creator sources with MSVC 2008 but am receiving the following error. MinGW compiles and links it fine. What is the issue? databasecrypto.obj:-1: error: LNK2019: unresolved external symbol "public: static unsigned int const Botan::Pipe::DEFAULT_MESSAGE" (?DEFAULT_MESSAGE@Pipe@Botan@@2IB) referenced in function "private: static class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl DatabaseCrypto::b64_encode(class Botan::SecureVector<unsigned char> const &)" (?b64_encode@DatabaseCrypto@@CA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV?$SecureVector@E@Botan@@@Z) /*! Encodes the Botan byte array \a in as a base 64 string. \param in The Botan byte array to encode. */ std::string DatabaseCrypto::b64_encode(const SecureVector<Botan::byte> &in) { Pipe pipe(new Base64_Encoder); pipe.process_msg(in); return pipe.read_all_as_string(); // <-- default parameter here is Botan::Pipe::DEFAULT_MESSAGE }

    Read the article

  • Semantically linking to code snippets

    - by Tim
    What's the most simple and semantic way of presenting code snippets in HTML? Possible XHTML syntax <a href="code_sample.php" type="text/x-php"> Example of widget creation </a> Example of linked file (code_sample.php): // Create a new widget $widget = new widget(); Pros: Semantically uses title to describe the source code being referenced Up to the client to render snippet Having very many custom server-side implementations tells me it should be standardized Browsers can have plug-ins for copy+paste, download, etc Seems to me this is where it belongs (not in Javascript) Degradation: non-compliant browsers receive a link to the associated content Cons: Not semantic enough? Seems wrong to replace hyperlinks with source code for presentation <object> might be better, but wouldn't degrade as nicely. Background I'm trying to create a "personal" XHTML standard for storing notes (wow, this is probably among the nerdiest things I've said). Since notes are just "scratch" it needs to be very lightweight. SO's markdown is very lightweight but not semantic enough for my needs. Plus, now I'm just curious. What's the most ideal syntax for linking to client-rendered code-snippets?

    Read the article

  • g++ Linking Error on Mac while compiling FFMPEG

    - by Saptarshi Biswas
    g++ on Snow Leopard is throwing linking errors on the following piece of code test.cpp #include <iostream> using namespace std; #include <libavcodec/avcodec.h> // required headers #include <libavformat/avformat.h> int main(int argc, char**argv) { av_register_all(); // offending library call return 0; } When I try to compile this using the following command g++ test.cpp -I/usr/local/include -L/usr/local/lib \ -lavcodec -lavformat -lavutil -lz -lm -o test I get the error Undefined symbols: "av_register_all()", referenced from: _main in ccUD1ueX.o ld: symbol(s) not found collect2: ld returned 1 exit status Interestingly, if I have an equivalent c code, test.c #include <stdio.h> #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> int main(int argc, char**argv) { av_register_all(); return 0; } gcc compiles it just fine gcc test.c -I/usr/local/include -L/usr/local/lib \ -lavcodec -lavformat -lavutil -lz -lm -o test I am using Mac OS X 10.6.5 $ g++ --version i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664) $ gcc --version i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664) FFMPEG's libavcodec, libavformat etc. are C libraries and I have built them on my machine like thus: ./configure --enable-gpl --enable-pthreads --enable-shared \ --disable-doc --enable-libx264 make && sudo make install As one would expect, libavformat indeed contains the symbol av_register_all $ nm /usr/local/lib/libavformat.a | grep av_register_all 0000000000000000 T _av_register_all 00000000000089b0 S _av_register_all.eh I am inclined to believe g++ and gcc have different views of the libraries on my machine. g++ is not able to pick up the right libraries. Any clue?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >