Programming :: Cmake - Using Header Files In Higher Directories ?

Nov 1, 2010

Say I have a directory structure:

And other.c has:

How do I setup the CMakeFiles.txt files in each directory, so the executable "program" (from program.c) is created.

Currently I get the error:

View 1 Replies


ADVERTISEMENT

Programming :: Cmake: Using Find_package(Boost) When FindBoost.cmake Is Not In The Default Location?

Feb 23, 2010

I am attempting to compile some code on a cluster where I do not have root access (and is missing many of the libraries I want), and hence have had to create local builds of the boost and opencv libraries (i.e. in /home/username/usr/local). In particular, my cmake depends on:

Code:

find_package(boost)

which my normal development machine finds in:

Code:

/usr/share/cmake-2.6/Modules/FindBoost.cmake

On the cluster I have a version of FindBoost.cmake at:

Code:

/home/username/cmake_modules

How can I tell CMake to look for FindBoost.cmake in that directory, since neither the cmake file, nor the boost install is in the standard location? I've modified the FindBoost.cmake file to make it search in the locally installed boost libraries.

[code]....

View 3 Replies View Related

Programming :: C Header Files And Object Files ?

Sep 18, 2010

When is it good to use separate translation units and object files and link them into the main C program, and when is it good to include the header files in the main C program? I don't understand if most people include header files or if most people just link in object files and use their contents in the main program. It's sort of a simple question, but it's confusing to me and that's why I need help with it. I sort of don't understand the difference, or if there's really no difference other than the way the final result is achieved, which way is better or preferred, etc...

For example:

Code:

or:

Code:

Simple explanation of the difference? or which one is preferred or better? I've read a little on the ELF format... so is there no difference in the end result? It's just a matter of preference or necessity, and where the information is to begin with?

View 9 Replies View Related

Programming :: Cannot Find Header Files To Use Kmalloc()

Jun 16, 2010

I want to use kmalloc() to allocate contiguous memory on ram. But I can not seem to find the required header file(s) like linux/slab.h. I suppose I do not have the required library and I certainly do not know what and where to look.

View 14 Replies View Related

Programming :: How To Attach New C Header Files And Libraries

Mar 10, 2010

I have been a predominant Windows user for a long time but shifted to Ubuntu recently. I was just trying out a few basic C functions when i realized that the "conio.h" header file isn't included in the libraries and therefore i was unable to use the "clrscr()" function.

I downloaded a tarball which contained the necessary library and header files including conio.h. Once extracted, i specified the location and included in the program as " #include "path to the header file" ".

I still didn't call the "clrscr()" function, and it compiled successfully. Next i edited the program to call that function and it gave the following error...

How i can add new libraries in the future?

View 14 Replies View Related

Programming :: Using Header Files - Reference And Put Formulas?

Feb 14, 2011

New to programming having issues reference header files.

Not sure how to put the fomula in headers below:

Program

using namespace std;

View 7 Replies View Related

Programming :: Put Header Files For A Shared Library?

Feb 26, 2010

I have written a simple library and ended up with a .so file. I have a header file from writing the code that describes how to use the functions in the source code I have written. I think this .h files needs to be available to other programs that access this code.

I have seen lots of tutorials on how to copy the .so file to the relevant directories and make links with the version number. What I can't find is where to put the header file so that any programs I write to use my new library can access the header.

Hope this makes sense. For example, I might use <stdio.h> normally, I will need to access <mylibrary.h> once mylibrary.so is loaded (as far as I understand!)

It's weird, I've been using C compilers for embedded processors over ten years now and never given a second thought to how libraries and headers work behind the scenes!

View 6 Replies View Related

Programming :: Codeblocks Plugins And Header Files Location?

Jan 29, 2010

I installed Codeblocks and build some programs, but I have two questions:1. Where are my header files placed, since I don't know where codeblocks is installed. Soemetimes I have to remove header file extension (.h) to be able to compile some source. I use gcc as setting for codeblocks to compile and build programs.2. Plugins for Codeblocks can be installed, but when browse codeblocks's wiki I can't find download links neither developer pages

View 3 Replies View Related

Programming :: Sort Files In Directories Based On Files Date

Sep 8, 2009

I need a script that will take all the files in a given directory and create new monthly sub-directories and sort all the files based on the creation date into the appropriate directory.For example, all files created between 01/01/09 and 01/31/09 will be placed in 'JAN-2009'

View 5 Replies View Related

Programming :: Compile C++ Program Without Changing #include Line & Header Files Not System?

Apr 3, 2011

I have C++ source code(*.cpp) files that expects it's header files in System's include folder which is/usr/include.The cpp files has include lines like this:

Code:
#include <some.h>
#include <another.h>

[code]...

View 3 Replies View Related

Programming :: Determine Files And Directories?

Mar 9, 2010

i made a program to list all the files in a directory,is there a way to determine what are directories and what are files ?

View 5 Replies View Related

Programming :: Copy Files To Dynamic Directories?

Feb 14, 2011

I have been searching for a solution to the following problem:

When my distro of choice updates Firefox web browser, the directory name is '/usr/lib/firefox-<version>'.
The problem here is that the directory name is dynamic by nature and doesn't allow a simple static solution, e.g.
'cp -rf /usr/local/files/bookmarks.html /usr/lib/firefox/defaults/profile'.

The same quandary applies when adding extensions, changing prefs etc.
I have looked at the following commands:-
find, sed, xargs, grep, awk, fprint.
Unfortunately my grasp of syntax and programming is very simple at best.

View 2 Replies View Related

Programming :: Make List Of Directories Which Contain Files Other Than Subdirs?

Oct 17, 2009

I need to, through a bash script, go through a given directory (given as argument 1) to list out the relative path in this directory (including $1) for eact subdirectory which contains files. Directories which only contain . .. and eventually only subdirectories SHALL NOT be listed. It is this last requirement that makes it difficult for me.

I have been using the tree command for now, but I have not found a way to ignore paths to directories which only contains other subdirs or nothing at all in any easy way. I may offcourse test each directory after they are listed but this gives an extra loop to go through and I beleive it should be possible to do it directly when creatring the list. I guess by using find or ls in conjuntion with the tree command or by itself it should be possible but I am not to conversant of nested script commands.

View 9 Replies View Related

Programming :: Moving Files To Directories Based On Part Of Filename?

Jul 6, 2010

I have a single directory of pairs of files, with the pairs sharing a string as the beginning of the filename:

SF1-27F1492R-clone01_T3_A18_001.ab1
SF1-27F1492R-clone01_T7_A20_002.ab1
SF1-27F1492R-clone02_T3_A19_003.ab1
SF1-27F1492R-clone02_T7_A21_004.ab1
...etc

I need to create a subdirectory for each pair then move the pair into the subdirectory.

I accomplished the first step using:

$find /foo -name '*T3*' -exec mkdir '{}.wrk' ;

I can use a regex to designate the pair and associate the directory, but how do I use regex in a path as the output of a move command?

View 7 Replies View Related

Programming :: Perl Script To Count Files And Directories Is Not Working?

Aug 26, 2010

I am new to perl scripting and wrote a perl script to read the directories and files and count the no of files in each directory and generate a log file. The problem is it is not printing anything to the log file. I am copying the script below.

!/usr/local/bin/perl
$dir= 'c:My ProjectsPerl ScriptsNew Folder' ;
$directory_count = 0;
$file_count=0;

[code].....

View 14 Replies View Related

Programming :: Java Preferences - Web Suggested Things Like Hidden Files Or Directories

Mar 28, 2011

I am trying to understnd where java preferences are stored based on web search I understand they are somewhat like windows registry - stored out there somewhere. web suggested things like hidden files or directories - and i've look all over th eplace withour result on Fedora 14. trying to start a program. got part way in and had given some info and then it blew. it still remembers my iput - which may have been wrong. ive looked at code and see it uses the java preferences system - wpould like to find and erase.

View 2 Replies View Related

Programming :: Shell Script To Rename All Patern Mateched Directories And Files?

Jul 11, 2011

I have one directory with 3 level sub-directories, and about houndard files under those directories. I need a shell script to rename all patern mateched directories and files.

For example: the patern is AA in the directory or file name.

View 14 Replies View Related

Programming :: How To Set RPATH In CMake

Jun 2, 2010

This is probably an easy question but somehow I couldn't manage it to work.. I was testing the C++ WT library and I have a CMakeLists.txt file as below:

Code:
ADD_EXECUTABLE(heloooo.wt
hello.C
)
SET(CMAKE_SKIP_BUILD_RPATH FALSE)

[Code]....

What am i doing wrong, I don't want to use the LD_LIBRARY_PATH, but to get the executable find the library with rpath when run?

View 7 Replies View Related

Programming :: Building One KDE Component With CMake?

Jun 21, 2011

Overnight, I upgraded from KDE 4.5.1 to 4.6.3 and had a rude awakening this morning when I found that KDE had managed to, once again, break the Task Manager "force rows" behavior which had been fixed a few major releases ago. I found this lovely patch that had been applied:

[URL]

And thus broken the functionality, and I want to recompile that particular plasmoid with the patch removed. However, I am completely unfamiliar with CMake or building anything at all, for that matter. All my programming is done in PHP which means I'm pretty much completely lost. I'm in the midst of pulling down the kde-workspace tree with git, and already downloaded and modified a separate copy of the file in question to look the way it is supposed to. I don't want to rebuild all of KDE, just the one module.

View 2 Replies View Related

General :: Create A Backup Directory And 3 Directories Within That And Some Files Within The 3 Directories And Then Back Them Up Ot Restore Them?

Dec 19, 2009

i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.

View 14 Replies View Related

Programming :: Cmake - Unable To Add Object To Static Lib

Nov 3, 2010

I'm creating a static lib via cmake,and when I view the .a binary file with less/more/cat I see functions from my time_tools.c, but not my other_api.c The directories structure is:

Code:

CMakeLists.txt
time/CMakeLists.txt
time/time_tools.c
time/time_tools.h

[code]....

View 2 Replies View Related

Programming :: Tool To Convert Configure.ac Into CMake?

Feb 18, 2010

Is there any tool to translate rules from configure.ac into Cmake rules?

View 3 Replies View Related

Programming :: Build Chain (make Or Cmake) For *nix_Movemap Project?

Jun 29, 2010

[URL]...Now it works in Windows platform. Some functions rely on win-specific code and need to cross-platform alternatives. Can some one help to build chain(make or cmake) for this awesome project? any one can compile the Linux generator and transfer the project under *nix platform.

View 1 Replies View Related

General :: How To Store Files / Directories In Different Different Directories?

Mar 23, 2011

I am writing a script, in that my requirement is, if all the fill types stored in one directory from that we need to separate different different directories based on the file types.

for example in a directory(anish). 5 different types files
1- directory
2- .txt files
2- .sh files

like that and my requirement is the (1- directory is moved to one new directory(dir) which we are given in the script)and (2 .txt files are moved to another new directory(test) which we are given in the script)and ( 2 .sh files are moved to another new directory(bash) which we are given in the scrip)finally the directory anish should be empty..using bash script.how it is possible !!

View 7 Replies View Related

Ubuntu :: G++ Header Files?

Apr 12, 2011

I tried to update the header files manually in the include folder, because I thought that I needed to have windows.h etc, but now nothing compiles and I get a good 80 errors for even hello world. I have tried removing g++ and all related packages, deleting the header files folder and reinstalling, but it reinstalls the broken files. Any way of restoring the originals without reinstalling ubuntu?

View 1 Replies View Related

Programming :: C Tcp Header Change?

Jul 25, 2011

I am trying to write a program that will send a packet to a server as a different IP address so I can test my firewall rules as I only have access to a couple of machines:

Code:
int my_socket;
struct sockaddr_in sin;

[code]....

View 2 Replies View Related

Ubuntu :: Get Files/bookmarks/ - Higher Power Consumption

Jul 5, 2011

What my situation was before the problems:

-I dualboot win(xp) and xubuntu(11.04)
-No problems whatsoever except for the fact that power consumption was higher on xubuntu.

Then i read something that said that the kernel i was using was effectively having power issues and that it could be fixed so in went into the terminal and nano'd the grub config file and update-grub'd with the addition i had read all over the internet. When i rebooted it seemingly had worked but once i opened a ..... video it didn't react to anything (i'm 99% sure kernel panic since there was no hdd movement). So i forced it to shutdown and when i got back in again i nano'd the file again but for some reason i didn't only remove the power stuff but I also removed the quiet splash. Once i had rebooted it would suddenly ask for username and password twice.

once the older looking menu an then the newer looking one with the fancy bg). The first time i got in okay but afterwards i could only get in as root. I thought i had simply forgotten my password but i ran passwd myusername as root and it didn't work(only when i typed something random it gave the wrong password message). As root i also can't edit the users and groups(when i open it it stays grayed out). how do i fix this. If i will lose my account anyways then how do i get my files/bookmarks/... of of it.

View 1 Replies View Related

Fedora :: Vmware And C Header Files ?

Dec 28, 2009

I've installed Fedora 12 (KDE version) on VMware workstation running under Windows 7.

I've been able to configure the VMware tools fine up until this point:

Code:

What is the location of the directory of C header files that match your running kernel? After some searching online I deduced I should install all of the latest updates and kernel-devel.

I then nuked the previous VMware tools install and started over with it again, but alas, no directory I try works (i.e. /usr/src/kernels/, /usr/src/kernels/2.6.31.5-127.fc12.i686/ and so forth).

View 8 Replies View Related

General :: Add Header And Footer To Many Files

Aug 27, 2010

I'm trying to add a header to many .cpp files in a directory (or directory tree).

My attempt was:

Code:

If I put part of the command inside quotes the substitution occurs, but then I get other errors like:

Code:

cat:

No such file or directory

I could just write a small program to do it.

View 3 Replies View Related

Ubuntu :: Adding New Header Files

Jan 26, 2010

I am new to linux. I want to use a header file asm/msr.h. But the /usr/include does not contain the header file that I want. Can I just copy the whole asm directory into the directory /usr/include, and overwrite the old one?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved