w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Significance of --start-group and --end-group linker flags for dynamic libraries
Dynamic libraries, unlike static libraries, are loaded even if they provide no useful symbols. This makes the order much less relevant. With static libraries, the wrong order can lead to required libraries, or objects within a .a file, not to be taken, even if they're later needed. This is what --start-group and --end-group solve. With dynamic libraries, both orders work. Suppose liba.so exports a and libb.so requires it. If liba.so is loaded first, then when libb.so is loaded, it will use it. If libb.so is loaded first, then a will be unresolved for a while, until liba.so is loaded. Either way, it works.

Categories : C

Remove default flags on cmake
CMake uses distinct variables for each build type. They are called CMAKE_CXX_FLAGS_<BUILDTYPE> and CMAKE_C_FLAGS_<BUILDTYPE> So, for CXX, this would be CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_MINSIZEREL Additionally, it uses the settings in the "general" variable CMAKE_CXX_FLAGS and CMAKE_C_FLAGS So in order to get rid of the defaults, you would need to set the global or specific variable and clear the other one (or configure them as you need). Note: If you want those changes in the cache, you need to use the FORCE parameter. Otherwise, they are locally employed to this project and its child projects.

Categories : Visual C++

Is there a way to set Other Linker flags to Theos Logos Tweak?
Never after several hours of researching and reading the documentation I figured it out. Its simple, you need to pass the other linker flags as an command line argument. user-macbook:$ make LDFLAGS=-ObjC here is the complete link, http://uv.howett.net/ipf.html

Categories : Iphone

C/cmake - how to add a linker flag to an (unused) library when the library is specified in TARGET_LINK_LIBRARIES?
The CMake command target_link_libraries allows for specifying both libraries and flags when linking a given target. Instead of directly using the target name MY_LIB in the TARGET_LINK_LIBRARIES call, use a variable that wraps the reference to MY_LIB with the --whole-archive and --no-whole-archive flags: ADD_LIBRARY(MY_LIB my_lib.c ) SET(MY_LIB_LINK_LIBRARIES -Wl,--whole-archive MY_LIB -Wl,--no-whole-archive) ... ADD_EXECUTABLE(my_app my_app.c) TARGET_LINK_LIBRARIES(my_app ${MY_LIB_LINK_LIBRARIES})

Categories : C

CMake and Static Linking
How do I setup for static linkage using CMake Well... you don't :) That's not how CMake works: in CMake, you first find the absolute path of a library, then link to it with target_link_libraries. So, if you want to link to a static library, you need to search for that static library: find_library(SOMELIB libsomelib.a) instead of: find_library(SOMELIB somelib)

Categories : Gcc

Static linking .dll's and cmake/qt creator?
No, you cannot link DLLs statically. You must build the libraries as static libraries and link those. How to do that depends on the libraries. If they use autotools you need to pass --enable-static --disable-shared to configure. For anything else you'll need to consult documentation.

Categories : C++

Linker can't find functions even if they are in a static lib
Your signature in the .h file; void compute_power(fftw_complex *in, double *powoutput, int size); is not compatible with the signature in the .cpp file; void compute_power(fftw_complex *in, double *powoutput, unsigned int size) They are name mangled to different symbols for linking. Change them to be the same, and things should link.

Categories : C++

C++ Linker error in Xcode for a Static Method
You did not include the class name qualifier in the implementation, so those "static methods" are being compiled as simple global functions. For example, you have: int NextInt(int high, int low) But you need: int Random::NextInt(int high, int low)

Categories : C++

iOS CMake install(targets ...) function uses wrong folders
Found a more specific report of this issue here: http://public.kitware.com/Bug/view.php?id=12506 There are a couple of workarounds on that site. However I used the code snippet below instead to create the Release and Debug folders in the same directory without appending the EFFECTIVE_PLATFORM_NAME to them. if(${IOS}) set_target_properties(${PROJECT_NAME} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}") endif(${IOS})

Categories : IOS

Linker error in VS2010 (2 project in solution and static method)
Try to implement the static method in the .h file like: // example.h class Example { public: void method1() { static_method(); }; private: static void static_method() { // implementation } }; // example.cpp /* nothing here yet... */ // main.cpp void main() { Example e; e.method1(); // it works! }

Categories : C++

How to provide linker options when linking a static library with qmake?
In staticlib projects, the LFLAGS are not passed to the linker. In fact, there's no documented way to pass such flags. The solution is generator-dependent. For msvc_nmake, LIBFLAGS are passed to the linker instead. To get verbose output, you might add QMAKE_LIBFLAGS += /VERBOSE To verify that it works, on any system, you can invoke qmake -spec win32-msvc2008; the particular msvc version doesn't matter. For unixmake, AR is used to invoke the linker, so you have to add the flags to QMAKE_AR. To get verbose output, you might add QMAKE_AR += -v To verify, invoke qmake -spec macx-llvm; any other unix spec should work as well.

Categories : Qt

Static Library throws Linker Error: "No such file or directory"
In the xcode settings, search for the build setting "Header Search Paths" and then add the directory that your static framework is in. Make sure you tell it to be recursive to help search it's subfolders.

Categories : IOS

XCode: Apple Mach-O Linker Error with New iOS 6 while adding self created static library
I found solution for my problem After created your own static .a extension library files 1. **libdevice.a** (device mode compile static library file) 2. **libsimulator.a** (simulator mode compile static library file) Please convert two compile mode static libraries to one common static .a extension library in your terminal lipo -create libdevice.a libsimulator.a -output libcommonlibrary.a The new libcommonlibrary.a common static library file will support both simulator and device compilation. please ref link: http://blog.boreal-kiss.net/2011/03/15/how-to-create-universal-static-libraries-on-xcode-4/

Categories : IOS

Linker error : undefined reference to `std::ctype::_M_widen_init() from static lib. even with same gcc version
Even I were careful the static library and project were using different libs as commenters advised me . At least I can show how I solved it: [root@ ~/projects/INSEPTRA_RELENG_12_8_chunk]# find / -name "libstdc++.a" /usr/lib/libstdc++.a /usr/local/lib/gcc46/libstdc++.a /usr/local/lib/gcc47/libstdc++.a /usr/lib32/libstdc++.a /root/projects/lib/libstdc++.a [root@ ~/projects/INSEPTRA_RELENG_12_8_chunk]# cp /usr/lib/libstdc++.a /usr/lib/libstdc++.a_bak [root@ ~/projects/INSEPTRA_RELENG_12_8_chunk]# cp /usr/local/lib/gcc46/libstdc++.a /usr/lib/libstdc++.a [root@ ~/projects/INSEPTRA_RELENG_12_8_chunk]# cp /usr/local/lib/gcc46/libstdc++.a /usr/lib32/libstdc++.a [root@ ~/projects/INSEPTRA_RELENG_12_8_chunk]# cp /usr/local/lib/gcc46/libstdc++.a /root/projects/lib/libstdc++.a [root@ ~/projects/INS

Categories : C++

Visual Studio CRT - how to share a static lib used by clients with static and dynamic CRT?
If Shared is a static library, you just can't do it. Make Exe_Proj2 use the dynamic CRT or die trying. If Shared is a dynamic library, it should work, as long as you don't pass anything that needs the CRT services (any C++ standard library type, file handles, etc.) between the libraries, but in this case the linker shouldn't complain.

Categories : C++

How to select nodes between flags when flags repeat and are not consecutive
Have a look for e.g. this Kayessian method. Or try this: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output omit-xml-declaration="yes" indent="yes"/> <xsl:key name="kFollowing" match="p" use="generate-id(preceding-sibling::p[starts-with(@class, 'excerptstart')][1])"/> <xsl:key name="kExcerptstart" match="p[starts-with(@class, 'excerptstart')]" use="@class"/> <xsl:template match="/*"> <xsl:copy> <xsl:apply-templates select="p"/> </xsl:copy> </xsl:template> <xsl:template match="p" /> <xsl:template match="p[ generate-id() = generate-id( key( 'kExcerptstart', @class)[1])] "> <xsl:copy-of select="."/> <xsl:vari

Categories : Xslt

CMake doesn't find Boost libraries while using android-cmake toolchain file
There are a few issues here. It looks like your boost libraries have been built without runtime-link=static ie they aren't linked statically to the C++ Standard Library. If they had been, their names' postfixes should contain an s (see the boost docs on library naming) Another issue is that CMake's FindBoost module expects the COMPONENTS arguments to be of the form "date_time", "thread" rather than the full name as you have provided. Another more minor point is that you shouldn't need to set Boost_INCLUDE_DIR or Boost_LIBRARY_DIR; these are set by the CMake module if successful. Setting them shouldn't cause any problems however, it's just unnecessary clutter. Also, for BOOST_ROOT, BOOST_INCLUDEDIR, and BOOST_LIBRARYDIR, these would normally be set via the command line using the -D

Categories : C++

cmake: check if file exists at build time rather than during cmake configuration
You can use add_custom_command to invoke CMake itself in script mode by using the -P command line option. So your command would be something like: set(FileToCheck "/the/file") add_custom_command(TARGET MyExe POST_BUILD COMMAND ${CMAKE_COMMAND} -DFileToCheck=${FileToCheck} -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake COMMENT "Checking if ${FileToCheck} exists...") and your script file "check.cmake" would be something like: if(EXISTS ${FileToCheck}) message("${FileToCheck} exists.") else() message("${FileToCheck} doesn't exist.") endif()

Categories : File

CMake: wrong zlib found - how to build zlib from src (with main project CMakeLists.txt) and link it?
Third-party libraries most likely call FindZLIB.cmake to determine the location of CMake. You already had the right idea by setting the ZLIB_LIBRARY manually, but were not quite getting it right: add_subdirectory(<path_to_zlib_src_dir>) set(ZLIB_INCLUDE_DIR "<path_to_zlib_src_dir>" "${CMAKE_BINARY_DIR}/<path_to_zlib_build_dir>") set(ZLIB_LIBRARY zlib) add_subdirectory(<path_to_lpng_src_dir>) The include directory needs to contain both src and build path as zconf.h is build by CMake The library name is only the CMake-target name, not the complete path to the resulting file. On Windows dlls are not automatically copied by CMake. You might want to add some additional code to make sure that the zlib and lpng dlls end up in the right place. You can call find_

Categories : Visual Studio 2010

adding non standard library to cmake using FindLibrary.cmake
For such a small (fairly standard) find process, I'd just add the code directly to the main CMakeLists.txt. You can move it to a separate .cmake file if you prefer - then you'd just include that file at the appropriate point in your main CMakeLists.txt. As for the code, I'd keep it pretty simple; essentially just a find_path and find_library call along with checks that the relevant things were actually found: find_path(NHPARSER_INCLUDE_DIR NAMES NHparser.h PATH_SUFFIXES NHparser) if(NOT NHPARSER_INCLUDE_DIR) message(FATAL_ERROR "Didn't find NHparser.h") endif() find_library(NHPARSER_LIBRARY NAMES NHparser) if(NOT NHPARSER_LIBRARY) message(FATAL_ERROR "Didn't find NHparser library") endif() The you can use the variables like: include_directories(${NHPARSER_INCLUDE_DIR}) ... targe

Categories : C++

dynamic to static url AND removing the dynamic
Try: Options +FollowSymLinks RewriteEngine On #set this to path to your filmdetails.html file (from the document root) RewriteBase / #checking if redirect already happened RewriteCond %{ENV:REDIRECT_PASSED} !^$ RewriteRule $ - [L] #Your rewrite rule RewriteRule ^filmdetails/(.*)/$ filmdetails.html?var=$1 [L,E=PASSED:1] #redirecting from filmdetails.html with query string ?var=something RewriteCond %{QUERY_STRING} ^var=(.+)$ [NC] RewriteRule ^filmdetails.html$ filmdetails/%1/? [R] filmdetails.html?var=something will be redirected to filmdetails/something

Categories : Htaccess

Wrong encoding for static texts on a JSP page
Evidently the JSP compiler (in your Java EE server) that translates .jsp to .java assumes that the (UTF-8) text is another encoding, and hence those sequences. Use: <%@ page pageEncoding="UTF-8" %>

Categories : Spring

Xcode Static libraries building in wrong folder
For the record, the issue has been solved. So, as I said, I use cocoapods, but my current setup is that a single podfile, and workspace is used for 3 projects that share some common libraries. As explained in this issue, cocoapods will only consider one project out of all those that are specified in the podfile, and it turns the one project (out of three) that it was using, didn't have the beta configuration, so it didn't feel the need to prepare for it. So when it was time to build the project with the beta configuration, cocoapods would be built for the release configuration, and put in some folder specific to release, so the beta project wouldn't be able to find it. Fixing was a matter of creating the beta configuration for all projects present in the workspace, forcing cocoapods to pr

Categories : Xcode

Is both Static and Dynamic Layout Possible?
Yes it is possible. After setContentView(R.layout.options); get your buttons container with findViewById(). You will have a reference to a LinearLayout, RelativeLayout or something else. After that use Layout inflater and programmatically you can add other layouts or components. Hope it helps!

Categories : Android

Dynamic vs. Static DLL Linking is different
The two versions differ in the calling convention. The run time linking variant uses stdcall and the load time linking variant uses register. Make the calling conventions match and all will be well.

Categories : Windows

Confusion about static and dynamic arrays in C
You have to give the compiler information about the type of pointer you have in functions f and g, you can't do point arithmetic on void pointers. Cast data to a char pointer and the printf's will work void f(void *data, int offset){ char *s = (char *)(( char*)data + offset); printf("%s", s); } void g(void *data, int offset){ char *s = *(char **)((char*)data+offset); printf("%s", s); }

Categories : C

change static url to dynamic with mod_rewrite
Try this instead: RewriteCond %{REQUEST_URI} !^/index.php RewriteRule (.*) index.php?co=$1 The RewriteCond checks that the requested path does not already begin with "/index.php" (without this check an infinite loop will occur). And, if not, the RewriteRule then rewrites everything in the request to the index.php path you need.

Categories : Regex

dynamic memory across static libraries
It's important to have a virtual destructor in the base class when inheriting. When you call delete later on in the program, if you don't have a virtual destructor, the compiler will generate code that calls the destructor that belongs to the type that the current variable happens to be. So, if you are holding a pointer of the base class type, the base class destructor will be used. If you are holding a pointer to the derived class type, the derived class destructor will be used. This may cause all kinds of problems, most frequently you can spot it by seeing very-hard-to-find memory leaks.

Categories : C++

UITableView Mix of Static and Dynamic Cells?
As you stated you can't mix static and dynamic cells. However, what you can do is break up the content into different data arrays that correspond to each group. Then break the table up into difference sections and load the data from the correct array in cellForRowAtIndexPath:. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellID = @"CELLID"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID forIndexPath:indexPath]; switch (indexPath.section) { case 0:{ cell.textLabel.text = self.arrayOfStaticThings1[indexPath.row]; }break; case 1:{ cell.textLabel.text = self.arrayOfDynamicThings[indexPath.row]; }break; case 2:{

Categories : IOS

How to use Google Maps without a key? (from static to dynamic with URL)
Use the Google Maps Javascript API v3 (lots of good examples in the documentation)

Categories : Javascript

Dynamic static table view
I think you better use dynamic cells. for header and footer of cells and sections you can just call this methods: - (NSString *) tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { return @"This will be the header!!!!"; } or - (NSString *) tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section { return @"This will be the footer!!!!"; } P.S. there were some methods, something like "viewForHeaderInSection" and "viewForFooterInSecton". But I don't remembre the complete implementation. P.S^2. you have to set the Table View Style to Grouped! See this image for a tiny help

Categories : IOS

Static and Dynamic Linking Libraries
The linker decides how to link the library by generally looking at the extension, but that's pretty much up to the linker. The AIX linker has some rather exotic behaviour. Moreover, if you have both a .so and a .so version of the library in the same place, the command line switches you have given the linker will determine which one it uses Sort of. You can link a .a into a .so but there will be performance issues - shared libraries should be built with position independent code for best performance. And depending on the code, the linker might refuse to link it because it can't patch up the relocation information. But you can't tell the linker to treat a .a as a .so As above - maybe.

Categories : C++

static and dynamic evolution of services
1.What does author mean by "Interfaces to and connectivity between component service roles can change, often at run-time" ? I'm not sure exactly. Interfaces change overtime because: New technology standards can be adopted - say moving from SOAP to REST, or form XML to JSON, but that would happen slowly overtime through deployment - where as for me "runtime" is a memory space in which things run, and I don't see interfaces changing themselves taht fast - otherwise how could anyone integrate with them? The API or interface contract itself changes to fulfill business need. 2.What does author mean by two points mentioned on-demand challenges which mentioned above. Hmmm, good design patterns tend to survive time well (they never change, because they are never broken - like SOLID

Categories : C++

ASP.NET Menu Control: 1st level static, second level dynamic, third level static
Kettic Menu Controls for Windows Forms can fully customize item appearance, text, orientation, image, checkbox, and any other controls at design time.

Categories : C#

Dynamic css - wrong content type
The problem seems to be in the requested url. <%= get_css_path %> will return /get_css and hence the controller action with handle this request by the format.html part. So you can try to append the format with the url as: <link href="<%= get_css_path(:format => :css) %>" media="screen" rel="stylesheet" type="text/css" /> This will request /get_css.css and hence the action will handle with format.css part.

Categories : CSS

Serving static content from dynamic URLs
Rewrite the static files request to the right directoty, for example : location ^(.*)/skin/(.*).(jpeg|jpg|gif|png|ico|svg|css|js)$ { rewrite "^.*/skin/(.*)$" /skin/$1 break; }

Categories : Nginx

Having a static header/footer with dynamic content
PHP includes are pretty much the standard way, yep. include "header.php"; echo "Hello World"; include "footer.php"; (See php.net's manual on include, alternatively use require) Note that your header / footer don't actually have to stay constant on every page, you could do checks for variables set beforehand or checks for what page the user is on. $page = "contact"; include "header.php"; echo "Contact page stuff"; include "footer.php"; and in header, you could have "contact" in your navigation bolded or something if ($page == 'contact'. There's certainly other ways to do this (such as javascript or $_SERVER variables), but I use $page for other things so I like doing it that way.

Categories : PHP

Dynamic and static MenuItems, both in MainMenu and ContextMenu
Use a CompositeCollection to build your list, use a CollectionContainer for the dynamic part.

Categories : C#

Converting Static to Dynamic Hash Table
A few points to think about: You can use vector instead of the C-style array to hold your elements, because it allows for dynamic resizing. When you need to grow the table, you'll have to rehash all existing elements to put them in new locations in a new container (which you can then swap with the existing container when the rehashing is complete). You'll want to be able to specify a load factor that decides when to grow. You'll need to decide if you want to allow the container to shrink the allocated space, again at some threshold.

Categories : C++

Two dimensional array with static and dynamic values
Something like this will do the job for you : var currntTab = 'home'; var urlValue = '192.168.1.8'; var myArray = [[currntTab,urlValue]]; console.log(myArray[0][0]+" "+myArray[0][1]); See the working Fiddle here : FIDDLE

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.