Arduino HTTPClient not working - httpclient

I have an Arduino with an Ethernet shield.
I have the httpclient library, and I am trying to run the PachubeClient example.
When I compile, it gives me many errors:
PachubeClient.cpp:25:25: error: Credentials.h: No such file or directory
PachubeClient.cpp: In function 'void setup()':
PachubeClient:47: error: 'ssid' was not declared in this scope
PachubeClient:47: error: 'passphrase' was not declared in this scope
PachubeClient:55: error: a function-definition is not allowed here before '{' token
PachubeClient:95: error: expected `}' at end of input
Why?

I haven't played around with the Arduino development environment at all but that error message means you're either missing the Credentials.h file or the compiler doesn't know where to find it. Verify that the file exists and then check your compiler settings to make sure that you're passing it the path to the header files.

Related

Check for empty file and quit cakebuild

I am attempting to write a check in my Cake build script to pull in a file from BuildParameters and check if the file contents are empty -- if contents are empty, throw an exception and quit the build.
I am attempting to use FileReadText from the FileHelpers namespace but for some reason I cannot get my build to recognize the file command. I am following the syntax and documentation found here: https://cakebuild.net/api/Cake.FileHelpers/FileHelperAliases/97F5679A
Here is the code I am trying in build.cake:
var fileReadText= FileReadText(Parameters.TestParameters.TestListFP);
var fileText= fileReadText.ThrowIfNullOrEmpty(nameof(fileReadText));
The argument Parameters.TestParameters.TestListFP is set in my Parameters.cake file as such:
TestListFP = context.File("C:\Some\Path\some_file_name.txt");
Using the above code, I see this error:
error CS0103: The name 'FileReadText' does not exist in the current
context
Note that I do not have a ICakeContext in build.cake, just BuildParameters.
I tried to resolve the issue by adding using Cake.FileHelpers; at the top of my build.cake file, but then I see this error:
The type or namespace name 'FileHelpers' does not exist in the namespace 'Cake' (are you missing an assembly reference?)
The script works fine without my FileReadText code, so I know TestListFP is actually a valid file.
I think I am inherently misunderstanding how to use FileHelpers and FileReadText and I could not find any examples of usage in documentation or anywhere else. If anyone has guidance on how to use this method, or a better way to accomplish what I am trying to do, I would appreciate the help.
Have you added the #addin pre-processor directive, as mentioned here:
https://github.com/cake-contrib/Cake.FileHelpers/#cakefilehelpers
You can easily reference Cake.FileHelpers directly in your build script via a cake addin:
#addin "Cake.FileHelpers"

"No rule to make target" error when linking matlab's libraries

My cmake script is as follows:
FIND_PACKAGE(Matlab REQUIRED)
GET_FILENAME_COMPONENT(Matlab_BIN_DIRS ${Matlab_LIBRARIES} PATH)
SET(Matlab_LIBS "${Matlab_BIN_DIRS}/libmat.so ${Matlab_BIN_DIRS}/libmx.so")
INCLUDE_DIRECTORIES(${Matlab_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(myAPP ${Matlab_LIBRARIES} ${Matlab_LIBS})
following error information was printed when I built my projects.
:-1: error: No rule to make target '/usr/local/MATLAB/R2015b/bin/glnxa64/libmat.so /usr/local/MATLAB/R2015b/bin/glnxa64/libmx.so', needed by 'cimgio'. Stop.
But it worked after modifying the last line as
TARGET_LINK_LIBRARIES(myAPP ${Matlab_LIBRARIES} libmat.so libmx.so)
why full paths does not work here?

POSTGRESQL - ERROR: could not load library pgafis.so : undefined symbol: lfsparms_V2

I'm using PGAFIS library for fingerprint matching. For this i have installed postgresql and having some user defined c functions.
PGAFIS contain makefile, .control file, sql and unpacked sql file everything
I have compiled and pgafis.so file for the same and everyfile is on right location.
In my PGAdmin-III when i run CREATE EXTENSION pgafis it gives me following error:
ERROR: could not load library "/usr/lib/postgresql/9.4/lib/pgafis.so": /usr/lib/postgresql/9.4/lib/pgafis.so: undefined symbol: lfsparms_V2
SQL state: XX000
Please help. Thanks in advance
(This is a follow-up from Postgresql user defined c function issues)
I expect you forgot to link to the required library.
Try adding
PG_LIBS = -lmindtct
or whatever. If it's not on the default linker path you'll need to need to add -L/path/to/the/containing/directory to PG_CPPFLAGS too.

CMake add_custom_command inside of a macro

My CMake code looks like the following:
macro(macro_name target_name)
add_custom_command(TARGET ${target_name}
POST_BUILD
COMMAND MyCommand)
endmacro()
Running this I get the following message:
CMake Warning (dev) at ... (add_custom_command):
Policy CMP0040 is not set: The target in the TARGET signature of
add_custom_command() must exist. Run "cmake --help-policy CMP0040" for
policy details. Use the cmake_policy command to set the policy and
suppress this warning.
The target name "target_name" is unknown in this context.
The same code inside of a function works great but I need macro for other things.
CMake policy (http://www.cmake.org/cmake/help/v3.0/policy/CMP0040.html) suggests just ignoring of this warning (and ignoring of adding of postbuild step at all) or treating it as error depending on the settings.
This: http://www.cmake.org/cmake/help/v3.0/command/macro.html states that parameters behavior in macros is different from one in functions.
How do I properly refer to macro parameters to get this work?
I've managed to figure out the reason: in my case wrong directory was used as ${CMAKE_CURRENT_BINARY_DIR} inside of the macro. Fixing paths allowed to get desirable result

Compiler error when putting class in App_Code folder for common use

I have put a class in the App_Code folder, so it should be accessible for all my source files. Intellisense indeed sees the class (in code-behind), but when I run the site from the browser I get a compiler error:
**Compilation Error**
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'ClsTranslation' is not defined.
Source Error:
Line 38: End If
Line 39:
**Line 40: Dim clsTrans As ClsTranslation**
Line 41: clsTrans = New ClsTranslation()
Line 42: lblLevel0.Text = clsTrans.GetResource("", "Modules")
Source File: C:\inetpub\wwwroot\myproject\InfoSiteMap.aspx.vb Line: 40
I am running this site as a web project and therefore the build-option content/compile for my App_Code/class is not available. I also tried to map the file to the pre-compiler using the # Reference directive, but this seems to work for user controls only and not for classes. Also tried to put the class in a namespace, all with same result.
Any suggestions?
Most of the time, when I do this, the build action of the file is to "Content" instead of "Compile". Highlight the class in solution explorer and hit f4 and change this.