Compilation error on file lib/phoenix_ecto/html.ex - web

While compiling a project which use elixir with phoenix web framework, the following compilation error occurs:
==> phoenix_ecto
Compiled lib/phoenix_ecto.ex
Compiled lib/phoenix_ecto/plug.ex
Compiled lib/phoenix_ecto/ison.ex
==> Compilation error on file lib/phoenix_ecto/html.ex ==
** (CompileError) ib/phoenix_ecto/html.ex:7: unknown key :impl for struct Phoenix.HTML.Form
(elixir) src/e ixir_map.erl:175: :elixir_map.--assert_struct_keys/5-1c$"011-0--/5
(elixir) src/e ixir_map.erl:48: :elixir_map.translate_struct/4
(elixir) src/e ixir_clauses.erl:36: :elixir_clauses.clause/7
(elixir) src/e ixir_def.erl:178: :elixir_def.translate_clause/7
(elixir) src/e ixir_def.erl:167: :elixir_def.translate_definition/8
[31m[1mcould not compile dependency phoenix_ecto, mix compile failed. You can recompile this dependency with 'mix deps.compile phoenix_ecto' or update it with 'mix deps.update phoenix_ecto'
How can I get my project to compile correctly?

You need to update both phoenix_ecto and phoenix_html. Try this:
mix deps.clean phoenix_ecto phoenix_html
mix deps.update phoenix_ecto phoenix_html
And you should hopefully be good to go!

I forget to install and compile my application's source code and dependencies with mix do deps.get, compile. I just only install and compile under phoenix directory. Then error emitted like above. After installed and compile under my application. It do well with no error.

As clearly mentioned in the error message, try:
mix deps.compile phoenix_ecto

Related

Running gem5 with DramSim2

So I've been able to build gem5 and run full system simulation . Now i want to integrate it with dramSim2 .I cloned the dramsim2 into ext directory in gem5. I ran the following command to build the .opt file
again
scons build/ARM/gem5.opt
The error it throws is -
build/dramsim2/DRAMSim2/BusPacket.cpp: In member function 'void
DRAMSim::BusPacket::print(uint64_t, bool)':
build/dramsim2/DRAMSim2/BusPacket.cpp:63:2: error: nonnull
argument
'this' compared to NULL [-Werror=nonnull-compare]
if (this == NULL)
^~
build/dramsim2/DRAMSim2/BusPacket.cpp: In member function 'void
DRAMSim::BusPacket::print()':
build/dramsim2/DRAMSim2/BusPacket.cpp:104:2: error: nonnull
argument
'this' compared to NULL [-Werror=nonnull-compare]
if (this == NULL) //pointer use makes this a necessary precaution
^~
cc1plus: all warnings being treated as errors
scons: *** [build/dramsim2/DRAMSim2/BusPacket.os] Error 1
scons: building terminated because of errors.
Anyone know what it means ?
Dramsim2 is outdated, and its original author stop actively maintaining the project. Although you may want to fix the codes as described here, can you simply test if the build passes the failure point by additionally giving -Wno-nonnull compilation switch?
I solved this problem . I changed gcc, g++ version.
I changed gcc version from 6.0 to 4.8.
Use this command and change the version.
sudo update-alternatives --config gcc
sudo update-alternatives --config g++

Yesod build error because of the duplicate definition for symbol "hsprimitive_memcpy"

I followed "Yesod quick start guide" to install Yesod in Windows 10.
But, when I issued the stack build command, it failed.
Environment
Windows 10 (64bits)
stack-0.1.5 (for Windows10 64bits)
Haskell Platform 7.10.2-a (from HaskellPlatform-7.10.2-a-x86_64-setup.exe)
alex-3.1.4.log
GHC runtime linker: fatal error: I found a duplicate definition for symbol
hsprimitive_memcpy
whilst processing object file
C:\Users\xxxxx\AppData\Roaming\stack\snapshots\x86_64-windows\lts-3.8\7.10.2\lib\x86_64-windows-ghc-7.10.2\primitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb\HSprimitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
ghc: panic! (the 'impossible' happened)
(GHC version 7.10.2 for x86_64-unknown-mingw32):
loadObj "C:\\Users\\xxxxx\\AppData\\Roaming\\stack\\snapshots\\x86_64-windows\\lts-3.8\\7.10.2\\lib\\x86_64-windows-ghc-7.10.2\\primitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb\\HSprimitive-0.6.1.0-5Jnw7oEuYtM9dmKXelGXVb.o": failed
It seems that the cause of the error were the duplicated GHC installation.
Thanks for #Reid comment, I realized that I installed Haskel Platform from exe file before and I also installed GHC through stack by folloing the guide.
I unisatlled GHC of Haskel Platform and executed 'stack setup' command.
Then, I executed 'stack build' command and it seemed worked.
I still have problems with the 'stack build' command, but I solved this issue.

Audacity installation error

Getting following error on installing audacity in linux:
export/ExportPCM.cpp: In member function ‘bool ExportPCM::AddStrings(AudacityProject*, SNDFILE*, Tags*, int)’:
export/ExportPCM.cpp:740: error: ‘SF_STR_GENRE’ was not declared in this scope
export/ExportPCM.cpp:764: error: ‘SF_STR_TRACKNUMBER’ was not declared in this scope
make[1]: *** [export/ExportPCM.o] Error 1
make[1]: Leaving directory `/root/audacity/audacity-src-2.0.5/src'
make: *** [audacity] Error 2
Can any one help me in fixing the issue?
I also got the same error. The following is my solution:
From the first error line:
export/ExportPCM.cpp: In member function ‘bool ExportPCM::AddStrings(AudacityProject*, SNDFILE*, Tags*, int)’:
we see that it is caused by libsndfile. Therefore, you just need to compile the latest libsndfile. Download tarball here http://www.mega-nerd.com/libsndfile/#Download
After that, you compile audacity again and compilation will be successful.
This is an error when compiling that package, not during installation. It most likely is the result of some version incompatibility between the code you try to compile and some development version installed on your system which is referred to by the code. You will have to find out what packages usually declare those constants and adjust your versions accordingly.
Apart from that: sure you want to make such a "wild" installation? Typically packages are installed using your systems software management system these days. That is much easier, more robust and allows easy upgrades to newer versions. Audacity should be available for most GNU/Linux distributions.

Haskell Plugins and cabal sandbox

So, I'm trying to use the Plugins package to dynamically load a haskell function from a source file. The source file depends on a package foo with module Foo.Bar. I'm running my project in a Cabal sandbox, where I have foo installed. Both my main program, and the module I'm loading with plugins, depend on foo. I always get one of the following two errors:
When I have foo installed in ~/.cabal, I get the error:
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
aizmvszmaizmlibzm0zi1_FooziBar_zdfTypeableBazzuds2_closure
whilst processing object file
/home/joey/.cabal/lib/foo-0.1/ghc-7.6.3/HSfoo-0.1.o
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation. Exiting now. Sorry.
When I don't have it installed in ~/.cabal, I get a standard "module not found" error. And when I don't have it installed in my sandbox, I get the same module not found error trying to compile my main program code.
The plugins documentation is scarce at best. Any thoughts on how to solve this?
I got this working by using System.Plugins.Make to actually do the compliation, instead of relying on pre-existing object files. Not a complete solution, doesn't explain the problem, but it works for me for now.

Ant LibusbJava compile error: "jni.h: No such file"...fixed, now a memset error

There appears to be a Ant / jni.h problem (for my setup) with LibusbJava. I get the following error when setting up LibusbJava by running
ant linux
in CentOS 6.3 as root (quick and dirty test, thanks for those concerned about user level =0). I will redo with proper restrictions as shown on a libusbjava reference after reflection when first install works. LibusbJava, is a Java wrapper for the libusb library.
The output starts out like this:
[root#somebox LibusbJava]# ant linux -lib $JAVA_HOME/include -lib $JAVA_HOME/include/linux
Buildfile: build.xml
clean:
Build LibusbJava Test Linux:
Build LibusbJava Test:
[echo] Building Library for unit tests:
[exec] /.../libusbjava/trunk/LibusbJava/LibusbJava.cpp:27:17: error: jni.h: No such file or directory
[exec] /.../libusbjava/trunk/LibusbJava/LibusbJava.cpp:34:26: error: test/CuTest.h: No such file or directory
`...`
as it was not set on my system. It appears that jni.h is a header called by C++ code, which I had to add to the LibusbJava.cpp file. This is the new include, /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/include/jni.h. I then get an error with jni.h not being able to fine jni_md.h which is an include in jni.h #include "jni_md.h".
Clearly this is not the right approach, so perhaps I need a correct Ant reference, but I cannot seem to do it with a -lib switch. Besides, this just creates thousands of jni.h file errors during the Ant build attempt.
How can I fix this problem?
Notes: I've set$JAVA_HOME up like JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64 and javac and java work fine.
New discovery... after helpful questions which guided me, I am much closer to successful compilation.
When I install LibusbJava and manually install all the library references in build.xml there is still an error compiling the LibusbJava based on a memset error. I see memset patches for libusb that appeared in 2007 and it's unclear how to use or if they relate. Investigating... Hints, comments and questions welcome. My most sincere thanks for the help thus far.
[exec] /.../libu/libusbjava/trunk/LibusbJava/objects/Usb_Device.cpp: In function ‘void Usb_Device_disconnect(JNIEnv*)’:
[exec] /.../libu/libusbjava/trunk/LibusbJava/objects/Usb_Device.cpp:88: error: ‘memset’ was not declared in this scope
[antcall] Exiting /.../libu/libusbjava/trunk/LibusbJava/build.xml.
BUILD FAILED
but I find no referece to an include string.h or cstring. The header of Usb_Device.cpp mentions it is a C++ Stub for the java class of a java class ch.ntb.inf.libusbJava.Usb_Device. which only has this include #include "Usb_Device.h" which also does not appear to have a string include. Perhaps just insertion of#include`?

Resources