eclipse,makefile,make , Eclipse Makefile: Make Variables are skipped


Eclipse Makefile: Make Variables are skipped

Question:

Tag: eclipse,makefile,make

I have a project with a Makefile in it, on Unix console it works fine, compiles, builds and I can run the binary at the end.

I imported the project into Eclipse workspace and somehow Makefile module of Eclipse cannot build the project now. It gives the following error:

g++: error: /src/main: No such file or directory

Whereas there should have been

g++ -I $(APR_INCLUDE) -I $(CMS_HOME)/src/main 

which uses two make variables. I already put them before this line and define them as :

export APR_INCLUDE=/usr/include/apr-1
export CMS_HOME=~/Desktop/activemq-cpp-library-3.8.4

Same Makefile is fine with console, but not with Eclipse, which is weird.

Any thoughts?

Here is where I put my export lines:

obstacleDetection_cpp: src/obstacleDetection.cpp protoc_middleman
    export APR_INCLUDE=/usr/include/apr-1
    export CMS_HOME=~/Desktop/activemq-cpp-library-3.8.4
    g++ -I  $(APR_INCLUDE) -I $(CMS_HOME)/src/main -g -o src/obstacleDetection.o -c src/obstacleDetection.cpp
    cd libs && cp $(CMS_HOME)/src/main/.libs/libactivemq-cpp.so.18.0.4 . && ln -sf libactivemq-cpp.so.18.0.4 libactivemq-cpp.so.18
    g++ -L $(CMS_HOME)/src/main/.libs/ -g -o bin/obstacleDetection src/obstacleDetection.o src-gen/Point.pb.cc src-gen/Point.pb.h -lactivemq-cpp -lssl -lprotobuf -pthread
    @echo "Success. Run the executable from the binary directory with: LD_LIBRARY_PATH=../libs/ ./obstacleDetection"

Answer:

This is not right:

obstacleDetection_cpp: src/obstacleDetection.cpp protoc_middleman
        export APR_INCLUDE=/usr/include/apr-1
        export CMS_HOME=~/Desktop/activemq-cpp-library-3.8.4
        g++ $(APR_INCLUDE) -I $(CMS_HOME)/src/main ...

All lines in the recipe (that is, lines that are indented with a TAB in a target context like this) are passed to the shell. These are not make variable assignments. There are two things wrong with that:

First, each logical line in the recipe is passed to a new shell. That means any changes to the process context (such as the environment or the working directory) are present only for the duration of that logical line; once the shell processing that line exits, all those changes are lost. So, these lines have no impact: they set an environment variable in the shell, then the shell exits and that setting is gone.

Second, the variable references you make in your compile line, such as $(APR_INCLUDE), are make variable references, not environment variable references. So even if those environment variable assignments still had effect, they would not be used because you're not referring to environment variables here.

You want to create make variable assignments. That can only be done outside of a recipe. Also, you don't need to export them because only make needs to see them (make will expand them before invoking the shell). So, your makefile should look like this:

APR_INCLUDE = /usr/include/apr-1
CMS_HOME = $(HOME)/Desktop/activemq-cpp-library-3.8.4

obstacleDetection_cpp: src/obstacleDetection.cpp protoc_middleman
        g++ -I  $(APR_INCLUDE) -I $(CMS_HOME)/src/main -g -o src/obstacleDetection.o -c src/obstacleDetection.cpp
        cd libs && cp $(CMS_HOME)/src/main/.libs/libactivemq-cpp.so.18.0.4 . && ln -sf libactivemq-cpp.so.18.0.4 libactivemq-cpp.so.18
        g++ -L $(CMS_HOME)/src/main/.libs/ -g -o bin/obstacleDetection src/obstacleDetection.o src-gen/Point.pb.cc src-gen/Point.pb.h -lactivemq-cpp -lssl -lprotobuf -pthread
        @echo "Success. Run the executable from the binary directory with: LD_LIBRARY_PATH=../libs/ ./obstacleDetection"

Related:


Spring Roo Shell in Eclipse: Could not create sts.roo.ui.rooShellView


eclipse,spring-roo,spring-tool-suite
IDE: springsource-tool-suite-3.6.4.RELEASE-e4.4.2 / eclipse-4.4.2 with sts-3.6.4.201503051146-RELEASE IDE Plugin: Spring IDE Roo Support v3.6.4.201503051146-RELEASE (via Eclipse Marketplace) Maven project configuration for Eclipse AJDT v0.14.0.201302011330 (via http://dist.springsource.org/release/AJDT/configurator/) Spring Roo: spring-roo-1.3.1.RELEASE / spring-roo-2.0.0.M1 Reproduce Step: import project created by Spring-Roo into eclipse right click project choose "Spring Tools" click "Open Roo Shell"...

Makefile: wildcard and patsubst does not change file source names


c,makefile
I am trying to write a Makefile for my project, all the *.c and *.h files are in a folder called src, and the Makefile looks like this -- CC := gcc CFLAGS := -g -Wall -ansi -pedantic -std=gnu99 LDFLAGS := -lm INCLUDES := $(wildcard src/*.h) IFLAGS := $(addprefix -I/,$(INCLUDES))...

A make rule for verbosity


makefile,make
Typically we have this in a Makefile %.o:%.c $(cc) $(flags) -o [email protected] -c $< When the amount of flags is huge, I feel better to write this instead %.o:%.c $(info $(cc): $< --> [email protected]) @$(cc) $(flags) -o [email protected] -c $< However it can be useful to sometime see everything. So...

html form action not working when using eclipse


java,eclipse,jsp,servlets
I am new to JSP and Java Servlet. I was going through this tutorial by Java Brains. In this tutorial get and post method is handled. I wrote my html code under web-content. </head> <body> <form action="http://localhost:8080/SimpleServletProject/hello" method="post"> <input name="userName" /> <input type="submit" /> </form> </body> Following is the hello.java...

exec-maven-plugin error, even on working example


java,eclipse,maven
EDIT5 Updated / I'm using Maven 3.3.3. I just create new project and added compile and exec plugin, as examples on web. I tried to execute, but I got error [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project QNAProject: An exception occured while executing the Java class. com.jadex.qna.QNAProject.App ->...

Mysterious claim of a missing { in eclipse


java,eclipse
I have a case of a mysterious missing curly brace that I don't see any use for. Eclipse says, "Syntax error on token ";", { expected after this token". Either I am missing something very silly or there is something new I have to learn about Java. This is the...

JSF facets not available in Eclipse


java,eclipse,jsf,facets
So I am watching a tutorial about how to configure JSF in eclipse. I understand that you click file -> new -> Dynamic Web Project. And then it gives you a few options. The Target Runtime will be (for me) Apache Tomcat version 8, and dynamic web module version will...

Match string in XText regardless of upper/lower case


java,eclipse,pattern-matching,dsl,xtext
I want to create a rule in XText that matches to a string, but does not care in what case the string is. For example, I want it to match against both "DUCK", "DucK" and "duck". Is there a more simple way of doing it than covering all cases, like:...

UISpec4J tests in Eclipse are not found


java,eclipse,user-interface,testing,uispec4j
I am trying to run tests using the UISpec4J library, but Eclipse says it can not find them. I have tried restarting Eclipse, cleaning the project, etc. The class gives no errors and I have followed the examples given on the website. package com.health.gui; import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test;...

makefile library dependencies - resolve circular dependency


c++,makefile,gnu-make
I am trying to build a feature into my makefile which allows me to specify a list of libraries a particular library depends on This will allow dependants of a library to automatically be rebuilt if that library's dependencies are rebuilt, and also have the dependencies added to the link...

IntelliJ - use imported modules as dependencies like maven projects in Eclipse


eclipse,scala,maven,intellij-idea,sbt
I've been asking myself this question for a couple of years but never really found the solution. I used to work with eclipse (on maven java projects). I could import a project -let's call it 'proj-A'- and if one of proj-A's dependencies was found in the workspace with the same...

Java eclipse I want to open the form like tab [on hold]


java,eclipse
Java eclipse: I want to open the form as shown below http://i.stack.imgur.com/U0wT5.png...

Link target to libraries


makefile,cmake,mingw,cmake-gui
I have a "CMakified" version of CryptoPP and I am using CMake-GUI to create a MakeFile which ming-make could process as shown in the image below. The "MakeFile" creation was successful but when I executed mingw32-make.exe I got below errors at the very end. Linking CXX executable cryptest.exe CMakeFiles\cryptest.dir/objects.a(test.cpp.obj):test.cpp:(.text+0x8e82): undefined...

Not Able to consume external RestFul web service from Client in Eclipse or from restclient-ui


java,eclipse,web-services,restful-url,rest-client
I am not able to consume RESTful webservice from client. I have written in eclipse, even not able to consume it from restclient-ui, but can access sample RESTful web service which is running in my location web logic server. I am in Corporate/company Network. Getting error Connection Time out exception....

Meaning of connectionTimeout in tomcat


java,eclipse,tomcat
What does that parameter mean for tomcat. It was declared in server.xml as follows: <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/> So, I tried to change it <Connector connectionTimeout="2" port="8080" protocol="HTTP/1.1" redirectPort="8443"/> and didn't notice any effect. I expected that each page the load takes for more than 2 milliseconds would produce...

guidance needed on using apache commons math


java,eclipse,apache
I am trying to utilize the Apache Commons Math (3.5) library in Eclipse IDE. I have downloaded the JAR file and have added the library to my project correctly. However my problem lies when I actually try using classes from the Apache Commons library. I try to create a new...

make error during building webkitgtk


linux,makefile,cmake,make
I use UBuntu 14.04 LTS. I need to build webkitgtk 2.8.3 Here is an example instruction which I have used: linuxfromscratch When I run sudo make -j8 I get following log: Scanning dependencies of target JavaScriptCore-4-gir Scanning dependencies of target fake-generated-webkitdom-headers [ 0%] Scanning dependencies of target WebKit2-fake-api-headers Scanning dependencies...

How to change Eclipse IDE GUI icons?


eclipse,user-interface,icons
Elipse icons are ugly. Fact! I would like to replace the icons with more flat, monochromatic and minimalist icons, but I can't find documentation on how to change icons from Eclipse's user interface. How could I do this? It's needed to recompile eclipse?...

one eclipse install not displaying utf8


java,eclipse,svn,utf-8
I have Eclipse installed on an old machine and a new machine. I download from svn repository on old Eclipse, UTF8 character in a java file displays fine. I download onto new Eclipse, UTF8 character displays as "?". I deduce that the file is saved correctly in SVN. I have...

Compilation Error on maven


java,eclipse,maven,maven-plugin
Working on maven project. I m trying to build using maven but I m getting the following error! I m working on eclipse using JDK 8. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) I also tried the above solution, but still I m getting error! [INFO] Scanning for projects... [INFO] [INFO]...

How to find references to a class that's referenced indirectly via exported jar in Eclipse?


java,eclipse
I have two Eclipse projects, Project_A and Project_B. Project_B is compiled and exported as a .jar file that's used by Project_A. Is there a way to select a class in Project_B and find all references to it in both Project_A and Project_B? Normally I'd use "Find all References" (Ctrl +...

Disable Wrapping Cursor in Eclipse


eclipse,vim,vi
I'm mostly using Vi (edit: Vim) for text editing and the viPlugin for Eclipse Juno. Eclipse seems to have a very annoying behaviour of "wrapping" the cursor to the next/previous line, if yout reach the end/start of a line through cursor keys. (Reproduce by placing the cursor on the first...

Showing previous searches in PyCharm


eclipse,full-text-search,pycharm
Eclipse allows viewing one's previous searches in one's search history even going so far as to show the exact state in which one left a previous search. For example, if one removed (i.e. excluded) a search result from a previous search, that previous search is shown without that search result...

Can Make be made to understand that a/../z and b/../z are the same location?


makefile,make,gnu-make
I have a somewhat large and complex Makefile setup that postprocesses some data files. Overall it work quite well, but I have run into an annoying issue where Make builds the same target many times over under different directory names. As a simple example, consider the Makefile foo : 1/foo...

Open a properties file from a class in a Dynamic Web Project


java,eclipse,jsp,properties-file
I'm using Eclipse for EE Developer. I need to access to a properties file (db.properties) from a class's method (DBQuery.java). The class is located inside a package inside the src folder. For the properties file i tried almost everything that i could find over the net to make it work,...

Eclipse CDT - No Console Output on OSX


c++,eclipse,osx,terminal,64bit
New to the C++ world and wanted to fiddle around using Eclipse's IDE for C/C++ called CDT. I am on OSX 10.10.2 using eclipse-cpp-luna-SR2-macosx-cocoa-x86_64. Sadly this simple example is not printing anything in the eclipse terminal. #include <iostream> using namespace std; int main() { cout << "Hello World" << endl;...

Fortran: makefile error


makefile,fortran,fortran90
I have a fortran main program called solidsolver.f90, and a module called read_mesh.f90. The module contains two subroutines and is used in the main program. I can compile them manually but not with a makefile. My makefile is named makefile.makefile, and it gives me an error: make: *** No targets...

No hello World output for Neo4j


java,eclipse,neo4j
I am just starting out with Neo4j and this is my first stackoverflow question! I tried to run the Hello-World example in Eclipse with the user library of Neo4j. ( https://github.com/neo4j/neo4j/blob/2.2.2/community/embedded-examples/src/main/java/org/neo4j/examples/EmbeddedNeo4j.java) I only changed the DB_PATH='data/graph.db' ( because in my neo4j-server.properties :org.neo4j.server.database.location=data/graph.db) The output I got in the console is:...

Match a pattern preceded by a specific pattern without using a lookbehind


regex,eclipse,lookahead
Is there a way to match a B only if preceded by an A? The A can be at any position behind the B, with any amount of characters between. Examples: A_B (Matches `B`) C_B (No match) I've tried: (?=A)[^B]*B But it matches all the characters preceeding B as well....

Unfortunately, (My app) has stopped. Eclipse Android [duplicate]


java,android,eclipse,adt
This question already has an answer here: What is a Null Pointer Exception, and how do I fix it? 12 answers I'm a beginner in android developing and I'm trying to build a simple app but I'm getting this error in the emulator.(Unfortunately,(App) has unexpectedly stopped). LogCat http://i.stack.imgur.com/VZhuL.png package...

Tomcat 7 PermGen Space or Failed to Create JVM


java,eclipse,tomcat,tomcat7,permgen
I'm currently searching for any help about this. I'm trying to start a Tomcat 7 server, but I only get PermGen Space exception. I tried to change the XXMaxPermSize value, but when I change it, I get a Pop Up at launch of my Eclipse : "Failed to Create the...

Eclipse CDT shows … not resolved errors for ARM neon intrinsics, but produces the binary


c++,eclipse,arm,neon
I develop ARM-Neon based embedded software for Cortex A8 and A9 processors. I use Eclipse CDT Luna for development environment. I opened a project and added #include "arm_neon.h" at the beginning of my main code, and the following flags to both C++ compiler and linker miscellaneous flags part in project...

What are my next steps on finding the cause of this exception?


java,android,eclipse,debugging
I'm fairly new to Eclipse, Java, and Android programming. I've taken over development of an Android application. Someone has made a change several months ago that is causing the application to crash (exception) in code that is not part of the application code. I don't have any idea where or...

Can I install 2 or more Android SDK when using Eclipse


java,android,eclipse,sdk,versions
I am new to android developments. I am setting up my android development environment using Eclipse. I have a test smart phone with Android version 4.2.2. The automatic installation installed the latest Android SDK version, which is 5.1.1. My questions are: 1. Do I have to install the SDK version...

Java: unhandled exception


java,eclipse,exception,exception-handling,try-catch
I would like to handle an exception but the Eclipse editor is giving me tips which I'm not understanding. This is the method's code: public Collection<String> listOfFriends(String codePerson) throws NoSuchCodeException { Collection<String> s = new LinkedList<>(); try { people.get(codePerson).getFriendsCodes().forEach( code -> s.add(getPerson(code))); } catch (Exception e) { e.printStackTrace(); } return...

How to save a json file locally with dojo toolkit


javascript,android,json,eclipse,dojo
I'm trying to create a JSON file with dojo toolkit that need to be saved into local memory of the phone. The app need to be valid for android and IOS. I'm using ECLIPSE with ADT as a IDE. My principal issue is that normally the file created with dojo...

apply formatter only on edited code - eclipse [duplicate]


java,eclipse,save,formatter
This question already has an answer here: How to turn off the Eclipse code formatter for certain sections of Java code? 10 answers I have implemented a formatter in eclipse for my code, when I try to save the changes it applies formatting on complete file. Is it possible...

Scala running issue on eclipse


eclipse,scala
I configured everthing within eclipse for scala. I create a snippet to show you the issue, i can't see in run options run as scala application, i also tried to find my main class under build configuration option but i can't find it. How i can solve it?...

Close module in android studio


android,eclipse,android-studio
in eclipse there is simple option to close or open project. How can I do it in android studio to close and open module without import it and delete each time?

Makefile: two different executables taking two overlapping subsets of code


c,makefile
This is my situation, I am trying to write a Makefile for my c program, it has these components -- 2 Headers: src/header1.h src/header2.h N Sources: src/src1.c src/src2.c src/src3.c ... src/srcn.c 2 Mains: src/main1.c src/main2.c main1.c and main2.c takes all the same src*.c and header*.h files, but in a different...

How to force team members to comment using eclipse plugin or something else


eclipse,jenkins,eclipse-plugin,coding-style,build-automation
Currently, I am working in a new project and it was difficult for me to understand since there is no comment. I wonder if it is possible to force team members(including me) to add more comments. I would like to automate this ject in jenkins later if possible.

Makefile overriding default implicit rule


c++,c,makefile,make
Why this rule cannot override the default implicit rule ? When make is invoked like: make myapp (suppose myapp.c is there). The make runs the default command to build and link the program instead the commands defined in this implicit rule: #... omitted code LCUS=$(LIBS)/libcus.a #... omitted code % :...

Why does Eclipse reference a 1.4 JRE?


java,eclipse
When attempting to create a new Java Project, eclipse is telling me that the workspace is using a 1.4 JRE (see screenshot). Any ideas why it might be saying this? I don't even have a 1.4 JRE installed on my machine. I'm using GGTS 3.5.1 on Juno 3.8.2. My GGTS.ini...

undefined reference to `vtable for implementation' error


c++,build,makefile
I wrote some c++ files and after compiling with out make file it works fine . But when using make file it pop out some errors . My codes are : include directory files : application.h #ifndef APPLICATION_H #define APPLICATION_H #include "employee.h" #include "employee_data.h" #include "employee.h" ...some defintions here... #endif...

Importing Spring MVC Project Manually to Eclipse


java,eclipse,spring,spring-mvc
I have a little problem. I had googled for this problem and I haven't found any solution related. My problem is, my office internet using proxy that banned me to download zip file. I need Spring MVC Project template in Spring Tool Suite (STS). So I downloaded the zip file...

Eclipse not compiling because of ClassNotFoundException


java,eclipse,amazon-web-services,compilation,aspectj
After following an AWS tutorial for Eclipse, my code no longer compiles and runs. I decided to undo what the tutorial told me, so I may have changed some settings that I forgot to unchanged but I really cannot find the root of my problem. Eclipse seems to be back...

Eclipse Layout: static instead of relative values?


android,eclipse,layout
I have a layout with two Buttons. One button is in the Center of the left half, and the other button is in the Center of the right side. But I use relative values (left="60dp" etc.). How can I have the same result with static values? Because I don't want...

WebDriver Selenium browse file Java


java,eclipse,junit,webdriver
Can't browse file using webdriver. driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS); driver.findElement(By.id("1434461513889_57_7_input.file")).sendKeys("C:\\PDF_V1_COL88810_6L_Frangipani_TL_Fr_P1211089.pdf"); Have this error: NoSuchElementException: Unnable to locate element: {"method":"id","selector":"BatchUploadPlugin_57_fileupload"} HTML code...

Modify ivy classpath entry


java,eclipse,eclipse-plugin,ivy,ivyde
In the picture below, I want Ivy settings path to NOT include ${ivyproject_loc} Property Files to NOT include ${project_loc} Here is what I have right now. I was thinking it might be easier to remove the ivy library and add it the way I want it. I know how to...

Remote debugging tomcat with OpenShift


eclipse,tomcat,openshift,remote-debugging
I am using openshift for my tomcat webapp. I am able to run the app but unable to debug it. As openshift starts tomcat in debug mode, I was expecting I'll be able to debug. Host: $OPENSHIFT_JBOSSEWS_IP Value of this is 127.5.20.129 for me which I got from command: rhc...