Comments (15)
Yes, it needs SDL2 and SDL_image to work.
from carp.
OK, thanks. I'll make sure to fix this when there is support for conditional compilation based on the platform (should come soon).
from carp.
OK, no problem. Will close this then.
from carp.
Hmm, seems like there's a problem with the quote... What OS are you on? Also, I've pushed some changes to the code now, so make sure you build a version from the latest source, maybe it has been fixed.
from carp.
I don't get those errors starting the repl, but I do get:
Welcome to Carp 0.2.0
This is free software with ABSOLUTELY NO WARRANTY.
Evaluate (help) for more information.
鲮 (+ 1 1)
[TYPE ERROR] Trying to refer to an undefined symbol '+' at line 1, column 1 in 'REPL'.
鲮
Additionally, trying to run the tests yields:
$ ./run_carp_tests.sh
Welcome to Carp 0.2.0
This is free software with ABSOLUTELY NO WARRANTY.
Evaluate (help) for more information.
[TYPE ERROR] Can't unify
even? : Int
line 122, column 63 in './examples/basics.carp'
with
expected argument to 'Array.filter' : &Int
line 122, column 56 in './examples/basics.carp'
[TYPE ERROR] Trying to refer to an undefined symbol 'map-filter-reduce-stuff' at line 187, column 7 in './examples/basics.carp'.
Compiled to './out/lib.so'
/bin/sh: ./out/a.out: No such file or directory
[RUNTIME ERROR] callCommand: ./out/a.out (exit 127): failed
鲮
I am on OSX 10.11.6
I just cloned recently:
commit 3b08f90
Date: Tue Oct 17 17:08:53 2017 +0200
from carp.
OK, yes the first error is because you didn't qualify '+', by default you have to write Int.+ to get the int version of plus. A way to solve that is to run (use Int)
first. Entering expressions in the REPL will only print the resulting C code though, so to be able to run the code you need to define a main function.
For example:
(defn main [] (IO.println &(Int.str (Int.+ 2 3))))
The second error should be fixed in the latest commit, just do an update again.
from carp.
Alternatively:
(use Int)
(use IO)
(defn main [] (println (refstr (+ 2 3))))
from carp.
Just pulled and the tests get a lot further. Perhaps this is a standard lib I just don't have on my work computer:
[@"Hi!" @"Hi!" @"Hi!" @"Hi!" @"Hi!"]
[@"hej" @"san" @"!"]
[1 2 3]
[4 5 6]
[7 8 9]
[10 9 8 7 6 5 4 3 2 1 0]
[1.000000 1.100000 1.200000 1.300000 1.400000 1.500000 1.600000 1.700000 1.800000 1.900000 2.000000]
[1 3 5 7 9]
Welcome to Carp 0.2.0
This is free software with ABSOLUTELY NO WARRANTY.
Evaluate (help) for more information.
./out/main.c:1:10: fatal error: 'SDL2/SDL_image.h' file not found
#include <SDL2/SDL_image.h>
^
1 error generated.
[RUNTIME ERROR] callCommand: clang ./out/main.c -o ./out/a.out -D_THREAD_SAFE -I/usr/local/include/SDL2 -fPIC -lSDL2_image -lSDL2 -L/usr/local/lib -lm -I.//core/ -g (exit 1): failed```
from carp.
Had to make a few changes to get the game example running on Arch Linux:
+++ b/core/SDLHelper.h
@@ -1,4 +1,4 @@
-#include <SDL.h>
+#include <SDL2/SDL.h>
--- a/core/sdl.carp
+++ b/core/sdl.carp
@@ -3,7 +3,8 @@
(local-include "../core/SDLHelper.h")
;; Compiler flags
-(add-cflag "-I/usr/local/include/SDL2")
+(add-cflag "-I/usr/include/SDL2")
from carp.
New REPL startup issue. If I start carp outside the repo directory, I get:
~ $ carp
Welcome to Carp 0.2.0
This is free software with ABSOLUTELY NO WARRANTY.
Evaluate (help) for more information.
carp: .//core/Macros.carp: openFile: does not exist (No such file or directory)
~ $ echo $CARP_DIR
/Users/bcleary/dev/carp
~ $ which carp
/Users/bcleary/.local/bin/carp
Works fine if started in ~/dev/carp
commit: 2dbcfac
Date: Wed Oct 18 13:02:44 2017 +0200
from carp.
Have you set a 'CARP_DIR' environment variable pointing to the root of the Carp directory?
from carp.
The first time I probably called an older version of Carp, i Installed some time ago.
Stack installs into ~/.local/bin/
and I used ~/bin/carp
.
But the version was the same for both, so I thought, there is no difference.
I found out, it depends on in which directory I use carp
.
When I'm outside of the Carp
directory, where I built it, I get carp: .//core/Macros.carp: openFile: does not exist (No such file or directory)
.
Inside of the Carp
directory it works as expected.
from carp.
CARP_DIR
is set and it is calling the ~/.local/bin/carp
just installed by Stack.
from carp.
I've now implemented the concept of search paths, perhaps this fixes the errors?
from carp.
Okay, looks like a shell issue. I tried it again in bash (with the export immediately before the command) and it does not report any errors. I must have set it wrong in my zsh profile.
Sorry about that.
from carp.
Related Issues (20)
- memory management crash
- performance: better default string functions
- Bug with REPL displaying result of calling function that returns Char HOT 1
- REPL prompt is not `鯉` on Linux HOT 2
- (()) seems to cause an infinite loop on the latest release
- Packaging issues. HOT 1
- `format` leaks memory HOT 1
- `--eval-preload` does not have access to Core anymore HOT 6
- [Bug] Not handling all cases during pattern-matching in lambdas HOT 8
- [Bug] Control.iterate-until double-uses a variable, and thus is broken HOT 3
- [Feat Request] Exhaustive pattern-matching for `defn` HOT 5
- [Bug] Issue pattern matching structs HOT 7
- Document println*
- Feature Request: Make running tests not dependent on stack?
- CarpHask fails to build with hashable >= 1.4 (GHC 9.2 / Stackage LTS-20) HOT 4
- FR: Better Support for Embedded HOT 5
- Get Can't find symbol 'make-update-deriver' when trying to run example on Windows 11 HOT 7
- [bug] duplicate bindings in environment HOT 2
- Repl crashes on type of Map
- Repl :t command doesn't work with (use) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carp.