Giter Club home page Giter Club logo

Comments (15)

eriksvedang avatar eriksvedang commented on May 9, 2024 1

Yes, it needs SDL2 and SDL_image to work.

from carp.

eriksvedang avatar eriksvedang commented on May 9, 2024 1

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.

eriksvedang avatar eriksvedang commented on May 9, 2024 1

OK, no problem. Will close this then.

from carp.

eriksvedang avatar eriksvedang commented on May 9, 2024

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.

ephetic avatar ephetic commented on May 9, 2024

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.

eriksvedang avatar eriksvedang commented on May 9, 2024

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.

eriksvedang avatar eriksvedang commented on May 9, 2024

Alternatively:

(use Int)
(use IO)
(defn main [] (println (refstr (+ 2 3))))

from carp.

ephetic avatar ephetic commented on May 9, 2024

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.

paullucas avatar paullucas commented on May 9, 2024

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.

ephetic avatar ephetic commented on May 9, 2024

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.

eriksvedang avatar eriksvedang commented on May 9, 2024

Have you set a 'CARP_DIR' environment variable pointing to the root of the Carp directory?

from carp.

porky11 avatar porky11 commented on May 9, 2024

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.

ephetic avatar ephetic commented on May 9, 2024

CARP_DIR is set and it is calling the ~/.local/bin/carp just installed by Stack.

from carp.

eriksvedang avatar eriksvedang commented on May 9, 2024

I've now implemented the concept of search paths, perhaps this fixes the errors?

from carp.

ephetic avatar ephetic commented on May 9, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.