C++ :: Directory Name Must Immediately Follow -I Compile Error

Oct 17, 2013

I am trying to compile some code under opensuse 12.2. The code compiles fine under cygwin and CentOS. Under suse, I get the error "directory name must immediately follow -I"

This is the place in make where the error happens.

Code:
g77-3.3 -I ./src/src_common_depend/ -O2 -DVERNUM=6 -c -o bld_dir/FortranA.o src/src_client_main/FortranA.FOR
f771: error: directory name must immediately follow -I

The includes are specified in the make file with,
SOURCELOC = ./src
INCLUDES = -I ${SOURCELOC}/src_common_depend/

These are common includes that are used by more than one applications and so are stored in a common location.

I have tried leaving off the ./ and the trailing /

SOURCELOC = src
INCLUDES = -I ${SOURCELOC}/src_common_depend

And various similar combinations, including parenthesis instead of the curly braces.

I'm not sure why gcc under suse would be particular about this syntax when gcc under other distros seem to think it's fine.

This is the compile rule that g77 is implementing where the error occurs:

# compile src fortran objects with fortran preprocessor
$(BDIR)/%.o: $(SOURCELOC)/src_client_main/%.FOR
$(FCOMP) $(FCFLAGS) $(VFLAGS) -c -o $@ $<

View 11 Replies


ADVERTISEMENT

C :: Error While Reading Files In Directory

Sep 7, 2014

I use this header dirent.h to get list of files in directory

[URL] .....

I am using code::blocks on windows XP.

Directory "kernels_source" is placed in project's directory where I am running the code.

Code:

#include "include/types.h"
#include "include/gaussian.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

[Code]....

View 10 Replies View Related

C :: Ubuntu File Compile Error GCC

Sep 27, 2014

what can i do to fix ? why do i get the error ?

View 2 Replies View Related

C++ ::  Palindrome Program Compile Error

Jan 16, 2014

Here is the code which I wrote in Turbo C++...its giving errors..

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
voidmain() {
clrscr();

[code]....

View 8 Replies View Related

C++ :: Binary Function Compile Error

Mar 8, 2013

I wrote a binary function based on existing template:

template <class T> struct percentage : binary_function <T,T,double> {
double operator() (const T& x, const T& y) const
{return x*1.0/(x+y);}
};

I call it in form of percentage<int>() When I compile, it's indicated: error C2143: syntax error : missing ',' before '<' I use VC 2012.

View 5 Replies View Related

C/C++ :: Compile Error With Calloc Function

Sep 24, 2014

i was working to compile the code below. Unfortunately it didn't compile and give me the known error error: attempt to use poisoned "calloc".

This is how i compile it :

gcc -I/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5/plugin/include -fPIC -O0 -Wall -pedantic -std=c99 -c decode.c decode.o

decode.c
#include <stdio.h>
#include <coretypes.h>
#include <gcc-plugin.h>
#include <gimple.h>
#include <tree.h>

[code]....

View 1 Replies View Related

C++ :: Header File - Compiler Error Before Directory

May 18, 2014

I'm trying to compile this code which is a header file.

#ifndef CUBEMAP_H_INCLUDED
#define CUBEMAP_H_INCLUDED
#include "Texture.h"
#include <string>
class CubeMap : Texture {

[Code] ....

But I get the following error:

|9|error: expected ')' before 'Directory'|

How can i resolve this?

View 6 Replies View Related

C/C++ :: Fatal Error - Iostream / No Such File Or Directory

Aug 4, 2014

I keep running into this error, even though the first few times i built and ran something it worked perfectly, and since I'm new to CodeBlocks (or any IDE/Compiler for that matter) what to do.Any code i put in, it'll give me this error....

View 3 Replies View Related

C :: Library Of Functions - Getting Error At Compile Time

Nov 19, 2013

So I made a library for a whole bunch of functions and when i compile it, it says"Unresolved external symbol_(Name of function here) referenced in function main.

View 1 Replies View Related

C++ :: Compile Error With Static Template Function

Nov 29, 2012

The below code compiles without error using VS 2012 but with g++ 4.1.2 I get this error:

Code:
main.cpp: In function 'int main(int, char**)':
main.cpp:37: error: no matching function for call to 'StringHelper::stringToNumeric(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'

Here is the code:

#include <string>
#include "boost/lexical_cast.hpp"
using boost::lexical_cast;
using boost::bad_lexical_cast;
class StringHelper {

[Code] ....

This is part of a larger program so in reality StringHelper has more static functions but this example does produce the error the same as the code when in the larger program.

To get it to compile under g++ I had to assign the return value from substr() to a string and pass that string to stringToNumeric. Why do I have to do this for g++ and not VS? Do I have something wrong with my template function that g++ is calling out and VS is not?

View 4 Replies View Related

Visual C++ :: Display Data Immediately - Dialog Domodal?

Mar 24, 2014

I haven't seen it anywhere and I've been looking. Is it possible to display data, say in a CEdit field in a dialog as soon as the dialog starts? Either before or after DoModal is fine.. These are essentially the same.

Using Visual Studio 2013 - trial version. It's nice. Coming from VC6. Many things are familiar (so far), at least in the C++ part.

View 7 Replies View Related

C :: Standard USB Protocol To Follow To Send Data To Embedded Board (and Vice Versa)

Mar 13, 2013

Is there any standard USB protocol which i can follow to send data to my embedded board(and vice versa). I have no clue on USB programming using c,is there any example code i could follow,

View 4 Replies View Related

C++ ::  Creating A New Directory?

May 11, 2013

How do you create a new directory in C++? I would like to do this using the standard library and no external, third party or non standard libraries/headers. I need to do this without calling system() or system("mkdir").

View 7 Replies View Related

C++ :: How To Change Directory

Apr 24, 2014

How to change directory in c++ ( windows ) I want to go to the folder "example2" and I delete some files and then return to the original folder c++ - windows

View 7 Replies View Related

C++ :: How To Protect Entire TMP Directory

Mar 13, 2014

The general design of my app work-flow:

My application is processing a large amount of data (approx. 50 - 100 GB of txt data). given the machine regular user usually has, my app is writing some tmp data into a local tmp directory. and this is working just fine until users get comfortable with my software and start changing that content of local tmp dir (while the program is running). which does not give any problems like crashing a program if handled at the right time but produces wrong results in the end. now this is not my problem but i would still like to somehow restrict users from even peeking into the tmp dir. I am just tired of getting emails saying my software is cr.... (maybe it is but i don't think it is because of that)

So is it possible to somehow encrypt the entire dir so that only the program has access to it . it would be even better if the dir could look as some encrypted index file so that when user sees the warning :

"tmp" may be a binary file. See it anyway?

View 6 Replies View Related

C :: How To Get User Home Directory

Oct 20, 2014

I want to obtain the user's home directory. I know it can be done with getenv("HOME"), but if I'll inspect the value of the enviroment variable HOME, it might work when I run it now, but it won't work on Windows, since windows uses HOMEPATH to save the user's home directory.

Is there a different, more cross-platform way to do it?

View 5 Replies View Related

C :: Merging All TXT Files In A Directory

Dec 6, 2013

I'm writing a program to merge all .txt files in a directory. I had the code working and then made small change. It started crashing and I couldn't get it back to working.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>

[Code] ....

It's crashing around the

Code: while(!feof(in)){ .

If I comment that section out, the code still works. But, I know that portion of the code works to copy text from one file to another! It's actually from the Schildt complete C reference and I have tested it several times on it's own.

View 5 Replies View Related

C :: Using Process ID As The Name Of File Directory

Jan 31, 2015

I need my Unix program to generate a directory with a format like this: "hinesro.<pid>". I have some code that mostly works, except for the directory ends up with a question mark on the end, like this: "hinesro.12345?". I need it to just display the directory without this question mark. Here is my code:

Code:

// Using headers sys/types.h, sys/stat.h, unistd.h, and stdio.h
int pid = getpid();
char prefix[] = "hinesro.";
char fileName[0];
sprintf(fileName, "%s%d
", prefix, pid);

[Code]...

View 13 Replies View Related

C++ :: Opening A File Within A Directory

Apr 26, 2013

I have problems opening a file within a directory.

#include <dirent.h>
#include <string>
#include <vector>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

[Code] .....

Error Message:
$ ./dirsearch ~/Documents/College/textfiles/
[..]
[yomama.txt]
Error : Failed to open entry file - No such file or directory

Here are my current file permissions:
textfiles$ ls -l
total 8
-rw-rw-rw- 1 jav jav 7 Apr 26 13:14 moretext.txt
-rw-rw-rw- 1 jav jav 10 Apr 26 12:38 yomama.txt

View 6 Replies View Related

C++ :: Listing Files From A Given Directory

Aug 5, 2013

I tried listing files using the code given in "[URL] ..." the program listed all the files present in the current dirctory but if i change the drive and the directory to such as

"C:UsersBaaooDownloadsdirect.h function"

the program does not list files name.

#include <iostream>
#include <dirent.h>
using namespace std;
int main() {

DIR* dir;
dirent* pdir;

[Code] .....

View 1 Replies View Related

C++ :: DLL Search Directory Order

Aug 29, 2013

I was working on a program. "hey if this program were to be published it would be bad for people to see all dll files are in the exe directory"....

So I wondered if there is a way to make compiler see a folder in the same directory with exe file which holds all dll files?

Also look at some programs and saw they have a dll folder which holds dll files....

View 1 Replies View Related

C++ :: Can't Open A Directory In Terminal

Jan 12, 2015

Taking a OS course and my professor gave us files to reference in a directory located at ~agw/class/os/share/proj3. But when I typed this into the terminal I keep getting a permission denied error message.

[lastname@erdos ~]$ ls
dead.letter Desktop Documents Downloads Music Pictures private Public public_html Templates Videos
[lastname@erdos ~]$ ~agw/class/os/share/proj3
/u/sobolev/agw/class/os/share/proj3: Permission denied.
[lastname@erdos ~]$

I'm not sure what I am doing wrong. Ive opened shared directories for this class before and had no issues.

View 1 Replies View Related

C++ :: Cannot Open A Directory In Terminal

Dec 9, 2013

Taking a OS course and my professor gave us files to reference in a directory located at ~agw/class/os/share/proj3. But when I typed this into the terminal I keep getting a permission denied error message.

[lastname@erdos ~]$ ls
dead.letter Desktop Documents Downloads Music Pictures private Public public_html Templates Videos
[lastname@erdos ~]$ ~agw/class/os/share/proj3
/u/sobolev/agw/class/os/share/proj3: Permission denied.
[lastname@erdos ~]$

I've opened shared directories for this class before and had no issues.

View 2 Replies View Related

C/C++ :: Scan A Directory Recursively

Dec 19, 2014

I'm writing a C++ module that is meant to recursively scan a directory and I'm curious what yall think of my strategy.

The program is a music player and so I'm trying to make the directory scanner as lightweight and efficient as I can. I've decided I want to scan the files in two passes- first I just want to get a list of all music files that are found in a directory/subdirectories and then I want to process the list and search for id3s/other tags.

As I'm a scanning the directory, I've decided to store the temporary list in a linked list where each node is containing an array of 100 strings. I did this because I obviously don't know how long the list will be and I from my understanding of the C++ vector class it basically just makes over sized arrays and moves them when it runs out of space. That sounded rather clunky to me, as did a traditional linked list.. I didn't see the point of allocating memory that many times in a row.

View 3 Replies View Related

C/C++ :: Get File List From Directory By Name

Nov 19, 2012

I try to get file names listed by date or name in c. How can i do this.

There is a code: But this gives randomly file names.

DIR *dir;
struct dirent *ent;
    dir = opendir ("c:src");
if (dir != NULL) {  
  /* print all the files and directories within directory */
 
[Code] ....

View 2 Replies View Related

C++ :: Capturing Files In A Directory

Jan 9, 2013

I'm using the following code to capture all files in a directory - but when I pass the "path" var such as "C:SomeDir" ffd.cFileName is just simply "SomeDir" and is seen as a valid folder and no more files are processed.. I'm trying to get the contents in that folder. I'm following this example here - [URL] .....

Code:
bool ListFiles(TCHAR* path) {
HANDLE hFind = INVALID_HANDLE_VALUE;
WIN32_FIND_DATA ffd;
TCHAR * spec = new TCHAR[_MAX_PATH];
static std::stack<TCHAR*> directories;

[Code] .....

View 14 Replies View Related







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