I want to develop a simple C application for learning purposes using Eclipse (Juno) CDT.
For that, I created the sample project provided in the IDE that creates a simple Hello World executable.
But when I want to build the project, the following errors comes up:
make: all
make: Error -- Could not find configuration file /etc/startup.mk
What does this mean? I can't find a file named like this anywhere on my system. Curiously enough, it works on my OS X with the same setup perfectly. Just not on my Windows machine.
What is going wrong here?
Edit: make -V show the following output:
D:\>make -V
make - Version 7.0 build 1182
Built-in Rules (cannot be changed):
OS:=NT
.IMPORT .IGNORE : ROOTDIR
.MAKEFILES:makefile
.SOURCE : .NULL
#B = $(#:b)
#D = $(#:d)
#F = $(#:f)
%B = $(%:b)
%D = $(%:d)
%F = $(%:f)
*B = $(*:b)
*D = $(*:d)
*F = $(*:f)
<B = $(<:b)
<D = $(<:d)
<F = $(<:f)
?B = $(?:b)
?F = $(?:f)
?D = $(?:d)
System Configuration:
SWITCHAR = /
OSVERSION = 01
OSRELEASE = 5
DIRSEPSTR = /\:
SHELL = /mksnt/sh.exe
SHELLFLAGS = /c
SHELLMETAS =
GROUPSHELL = /mksnt/sh.exe
GROUPFLAGS =
GROUPSUFFIX =
MAKEDIR = D:/
PWD = D:/
The make executable that is in your path is not the GNU make that eclipse expects and needs. It is probably a tool that comes with some other product -- make is a pretty common name. If your windows is not too old, you could try where make to locate the culprit and remove it from your path. Once you have done that, eclipse will be able to the GNU make by itself if you used the standard installation of your toolchain, or you could add it to your path. Alternatively, you can customize the eclipse build settings and explicitly point it to the make you want to use.
The make you want is probably in C:\MinGW\msys\1.0\bin, but could be somewhere else depending on how you installed the toolchain. There is also a mingw32-make in C:\MinGW\bin -- all assuming that you are using MinGW
Related
I am a newbie to Creo toolkit. For trial purpose, I need to edit the location of the source and target folders in the default make-file available. A part of the make-file is given below for reference.
# File Name
MAKEFILENAME = make_install
# Machine Type
PRO_MACHINE_TYPE = x86e_win64
# Executable names
EXE = pt_inst_test.exe
EXE_DLL = pt_inst_test.dll
# Pro/Toolkit Source & Machine Loadpoint (EXTERNAL USE - DEFAULT)
PROTOOL_SRC = $(PROE_INSTALL_PATH)\protoolkit
PROTOOL_SYS = $(PROTOOL_SRC)/$(PRO_MACHINE_TYPE)
# Pro/Toolkit Source & Machine Loadpoint (PTC INTERNAL USE)
#PROTOOL_SRC = $(PTCSRC)/protoolkit
#PROTOOL_SYS = $(PTCSYS)
# Include File Paths
INCS = -I. -I$(PROTOOL_SRC)/protk_appls/includes -I$(PROTOOL_SRC)/includes
In the above given code, I need to replace the source (PROE_INSTALL _PATH) with the required folder location (For ex: C:\Users\sagarp\Desktop\trial) without editing the environment variable. Is it possible? If so, please help me with the basics of creating a make-file on my own.
I just started using Creo toolkit and saw this question.
It's an old question but I'd still post the answer.
You can update the
PROTOOL_SRC = $(PROE_INSTALL_PATH)\protoolkit
by giving relative path.
It could be current dir or whatever you prefer.
Example for current dir :
PROTOOL_SRC = .
PROTOOL_SYS = $(PROTOOL_SRC)/$(PRO_MACHINE_TYPE)
I have to make a C (not C++) project to the specifications given by my teacher.
To allow us to test this project he has given us a .pl file that should test the project and a folder full of .in and .out files.
I work on a Win10 machine and has Eclipse for C installed (Kepler).
How can I set up my project to run the provided test?
Do I need to change anything in the test since I don't work on Linux and not from a cmdl?
The program is a train travel planner.
Here is the .pl file:
#!/usr/bin/env perl
use warnings;
use strict;
my ( $createmode ) = #ARGV;
my $testdir = "./tests";
if( defined($createmode) ) {
if($createmode cmp "create") {
print "Brug:\n";
print "\tcheck.pl - tests if your programs output matches .out-filerne\n";
print "\tcheck.pl create - makes new .out-files (deletes the excisting files!)\n";
exit();
}
$createmode=1;
}
# print "$testdir/tests.tst";
open(TESTS, "$testdir/tests.tst");
my $koereplan;
my $startst;
my $slutst;
while (<TESTS>) {
/([\w\d]+)\.in\s+\"(.+)\"\s+\"(.+)\"/ && do {
$koereplan="$testdir/$1";
$startst=$2;
$slutst=$3;
# print $koereplan."\t".$startst."\t".$slutst."\n";
open(RUN, "./travelplanning $koereplan.in '$startst' '$slutst' |");
my $cost=0;
while(<RUN>) {
/^(\d+)\s+(\d+)$/ && do {
$cost=$1+$2*15;
}
};
#print "Cost fra programmet: $cost";
my $outfile="$koereplan.$startst.$slutst.out";
# print $outfile."\n";
if($createmode) {
open(OUT, ">$outfile") or die "Couldn't open '$outfile' for writing";
} else {
open(IN, "<$outfile") or die "Couldn't open '$outfile' for reading";
}
if($createmode) {
print OUT "$cost\n";
} else {
my $facit=<IN>;
if($facit cmp "$cost\n") {
chomp $facit;
print "ERROR: $koereplan.in $startst $slutst gav $cost og facit er $facit.\n";
#last;
} else {
chomp $facit;
print "SUCCES: $koereplan.in $startst $slutst gav $cost og facit er $facit.\n";
};
};
};
}
Some names are in Danish, sorry about that. Koereplan = timetable, slut = end.
Excample of the .in files:
Esbjerg, 07:48
Bramming, 08:00
Vejen, 08:15
Kolding, 08:30
Middelfart, 08:45
Odense, 09:14
Nyborg, 09:29
Korsør, 09:42
Slagelse, 09:53
Sorø, 10:01
Ringsted, 10:10
Roskilde, 10:26
Høje Taastrup, 10:34
Valby, 10:42
København H, 10:48
This is just station names and departure times.
The .out files just contain one number each, the number of minutes the corresponding trip will take.
The scaffold project also came with makefile files, but I haven't been able to use them in my environment, I have simply taken the "business-files" to another project made in Eclipse, and that works fine for compiling and running the project in Eclipse. But that doesn't allow me to use the test script (that I currently can't even open in Eclipse).
If you feel it helps, here is the assignment: assignment on course website
But I think I can solve the assignment itself, it's using the teachers test I'm unsure about how to do.
To start Eclipse CDT choose 1 of these methods:
Start eclipse from the terminal that works, e.g.:
$ /path/to/eclipse.exe &
Make sure msys and mingw's bin directories are in the PATH and start eclipse the "normal" way
Then you can import your project as a new C Project and build/debug/run within CDT as normal:
Choose File menu | New | Makefile Project with Existing Code
Enter path to your project and name. But leave indexer settings as <none>* and press Finish
Open the Make Target view
Right-click on the project and choose New...
Fill in the target you want to build
Double-click on the new green icon and the build will run with the output in the Console view.
Something seems strange in CDT, if I use the obvious setting of MinGW GCC for indexer settings, then I can't do make properly as CDT is insisting on using internal builder.
I am trying to get Rsyslog's imfile plugin working without
any real success.
Here is useful OS version information:
# cat /etc/centos-release
CentOS Linux release 7.1.1503 (Core)
And here is Rsyslog version information:
# rsyslogd -v
rsyslogd 7.4.7, compiled with:
FEATURE_REGEXP: Yes
FEATURE_LARGEFILE: No
GSSAPI Kerberos 5 support: Yes
FEATURE_DEBUG (debug build, slow code): No
32bit Atomic operations supported: Yes
64bit Atomic operations supported: Yes
Runtime Instrumentation (slow code): No
uuid support: Yes
See http://www.rsyslog.com for more information.
I tried both legacy and RainerScript format of the configuration.
None of them works for me, sadly. I must be doing something completely wrong
but I simply can not decide on what it could be.
Here is my actual testing configuration (in RainerScript, the
former legacy version I tested was exactly the same in it's meaning):
# cat /etc/rsyslog.conf
global(
workDirectory = "/tmp"
)
module(
load = "imuxsock"
)
module(
load = "imjournal"
stateFile = "journal.state"
)
module(
load = "imfile"
pollingInterval = "10"
)
ruleset(name = "test-ruleset") {
if $syslogtag contains "test-syslogtag" then {
action(
type = "omfile"
file = "/tmp/test-file.log"
)
stop
}
}
input(
type = "imfile"
tag = "test-syslogtag"
stateFile = "test-input.state"
facility = "daemon"
severity = "debug"
file = "/tmp/test-input.in"
ruleset = "test-ruleset"
)
if prifilt("*.*") then {
action(
type = "omfile"
file = "/tmp/rsyslog-testing.log"
)
}
No warning nor error are produced by the Rsyslog with the above
configuration but also nothing from the /tmp/test-input.in file
is copied to the /tmp/test-file.log.
(I also double-checked the /var/log/audit/audit.log, of course, and ...
nothing suspicious is there. Being desperate on what's going on, I also
tried to setenforce 0 to switch SELinux off completely and to restart
the Rsyslog afterwards. It did not helped so the root cause of the problem
may not be SELinux-related issue.)
Also, the test-input.state file is correctly created in the global
workDirectory path (/tmp in this testing case). I also tried
standard paths (logs in /var/log, state file in /var/lib/rsyslog)
and it does not work either although all related files were created properly.
What's weird: I can not see any change in the state file if I populate the
input log file with some testing data even after Rsyslog restart using
# systemctl restart rsyslog (it should update the state file by default).
Just to point out: the imjournal and imuxsock plugins work and populate the fallback log file /tmp/rsyslog-testing.log correctly. Also
manually running Rsyslog on foreground with -D and/or -d options
did not helped me much to clarify why the imfile plugin does not work
for me in this particular configuration.
So, could you please
check my RainerScript syntax whether there is no obvious fault (I guess there is no such),
show me some working imfile plugin configuration on EL7?
Thank you very much.
--
mjf
With a few minor changes it finaly started to work properly. I think the
main root cause of the problem in my case must have been my testing it in
the /tmp directory where Rsyslog does not seem to work properly for some
reason on CentOS 7.
(May it be the /tmp is populated by the File System Namespace even
despite the fact that Systemd option PrivateTmp is not set to true in
the Rsyslog unit file and this option should be set to false by
default according to the Systemd manual page? This is higly unprobable, but
I haven't managed myself to dig more further into it yet. If I find it out,
I will update this answer.)
The other minor cause might have been incorrect filter written in
RainerScript (my real testing instance contained a horrible typo I
simply over-looked). So here is the resulting testing configuration that
works like charm for me.
# cat /etc/rsyslog.conf
global(
workDirectory = "/var/lib/rsyslog"
)
module(
load = "imuxsock"
)
module(
load = "imjournal"
stateFile = "journal.state"
)
module(
load = "imfile"
pollingInterval = "10"
)
ruleset(name = "test-ruleset") {
if $programname == "test-syslogtag" then {
action(
type = "omfile"
file = "/var/log/test-file.log"
)
stop
}
}
input(
type = "imfile"
tag = "test-syslogtag:"
stateFile = "test-input.state"
facility = "daemon"
severity = "debug"
file = "/var/log/test-input.in"
ruleset = "test-ruleset"
)
if prifilt("*.*") then {
action(
type = "omfile"
file = "/var/log/rsyslog-testing.log"
)
}
A little hint for those not knowing it - the $syslogtag and the
$programname seem to be close relatives: $syslogtag := $programname ":".
You can easily find out all the $ prefixed variables you can match against
by using RSYSLOG_DebugFormat output template which is already compiled in.
I hope it helps.
--
mjf
I am trying to run ADNI .mnc image in MATLAB
I added folder emma-master, niak-0.7.1-ammo, mia and niak-0.7.1-ammo to my path. All these folders are located in
D:\EMINA BURCH\PhD Thesis\MATLAB Packages
But when I want to open ._bq_t_15T.mnc located also in D:\EMINA BURCH\PhD Thesis\MATLAB Packages
that is h = openimage('._bq_n_15T.mnc')
I get the following error
Error using miinquire (line 145)
Error getting image dimensions from file D:\EMINA BURCH\PhD Thesis\MATLAB Packages._bq_n_15T.mnc
Error in openimage (line 173)
DimSizes = miinquire (filename, 'imagesize');
When I enter debug mode in minquire function after the line
[stat,out] = system(['mincinfo -vardims image ' minc_file]);
I get stat = 1 and out = 'mincinfo' is not recognized as an internal or external command, operable program or batch file.
May You, please help me with this issue.
system isn't able to automatically recognise the different requirements that might be needed to run the same system command on different operating systems. Using commands like ispc, isunix, ismac and computer, you can automatically check and call different versions of the commands as appropriate:
if ispc
[stat,out] = system(['mincinfo.exe -vardims image ' minc_file]);
else
[stat,out] = system(['mincinfo -vardims image ' minc_file]);
end
Of course, you also have to have the appropriate program on your MATLAB path for this to work.
I am just beginning to develop a simple openssl engine. In this process, I referred to this nice website http://sinodun.com/2009/02/developing-an-engine-for-openssl/
I downloaded openssl 1.0.0c and compiled in my own folder as follows:
./config --prefix=/home/workingDir/openssl --openssldir=/home/workingDir/openssl
make
make install
Then I proceeded to copy this simple_engine.c file and compiled it to simple_engine.o and then built shared library simple_engine.so.
These are found in 'workingDir'
After these steps, I changed the 2 openssl.cnf files available under openssl/apps and openssl1.0.0c/ main folders such that:
openssl_conf = openssl_def
[openssl_def]
engines = engines_section
[engines_section]
simple = simple_section
[simple_section]
engine_id = simple
dynamic_path = /home/workingDir/simple_engine.so
MODULE_PATH = /home/workingDir/simple_engine.so
init = 0
[req]
distinguished_name = req_distinguished_name
[req_distinguished_name]
After this I set the LD_LIBRARY_PATH to point to /home/workingDir
Then when I did:
./openssl engine
I get the following error:
Error configuring OpenSSL
3076019848:error:25066067:DSO support routines:DLFCN_LOAD:could not load the shared library:dso_dlfcn.c:185:filename(/home/workingDir/simple_engine.so): /home/workingDir/simple_engine.so: undefined symbol: ENGINE_get_static_state
3076019848:error:25070067:DSO support routines:DSO_load:could not load the shared library:dso_lib.c:244:
3076019848:error:260B6084:engine routines:DYNAMIC_LOAD:dso not found:eng_dyn.c:450:
3076019848:error:260BC066:engine routines:INT_ENGINE_CONFIGURE:engine configuration error:eng_cnf.c:204:section=simple_section, name=dynamic_path, value=/home/workingDir/simple_engine.so
3076019848:error:0E07606D:configuration file routines:MODULE_RUN:module initialization error:conf_mod.c:235:module=engines, value=engines_section, retcode=-1
What is the problem? Please help. I am unable to proceed and don't find any documentation.
Thanks
The problem was the MODULE_PATH in the openssl.cnf. When I removed it , it works after recompiling the openssl with shared libs!