Comments (7)
Ok, the answer is to use ocamlfind instead in all cases like this:
ocamlfind ocamlc -thread -syntax camlp4o -package eliom.server
However, the documentation states that this will not allow you to have client code, only server side code. Is there a workaround for this?
from eliom.
I'm usually using server only .ml files for database interaction and I don't see this problem (using the default makefile). Using pgocaml's syntax in .eliom files may cause problems with the syntax extension indeed. But your error message seems to speak about a missing dependency on batteries in pgocaml's meta ...
If you find a fix or a workaround we would be happy to integrate it.
from eliom.
I'm using the same package versions as the OP and the default Makefile with the following changes to Makefile.options:
# Source files for the server
SERVER_FILES := $(wildcard *.eliomi *.eliom *.ml)
...
# OCamlfind packages for the server
SERVER_PACKAGES := pgocaml pgocaml.syntax
The error occurs during the generation of dependencies:
$ make byte
Makefile:216: .depend: No such file or directory eliomdep -server -package pgocaml \
-package pgocaml.syntax -package core database.ml > _deps/database.ml.server
Camlp4: Uncaught exception: DynLoader.Error \
("/home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma", \
"error while linking /home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma.\nReference \
to undefined global `Batteries'")
However, upgrading to the development version of Ocsigen (at the time of writing) appears to fix it:
$ opam repository add opamocsigen http://ocsigen.org/opam
$ opam update
...
$ opam upgrade
...
$ make clean
$ rm -f .depends
$ rm -f _deps/*
$ make
$ Makefile:216: .depend: No such file or directory
eliomdep -server -package pgocaml -package pgocaml.syntax -package core \
mti_admin.eliom > _deps/mti_admin.eliom.server
eliomdep -server -package pgocaml -package pgocaml.syntax -package core \
database.ml > _deps/database.ml.server
...
from eliom.
Thank you. If it works with the devt version I guess it's ok.
We will try to release it asap (january I hope. We still have one missing
feature).
If you want to make it work with the stable version, a solution may be to use
pgocaml syntax only in .ml files (not in .eliom), compiled only for server
side (?).
Vincent
I'm using the same package versions as the OP and the default Makefile with
the following changes to Makefile.options:Source files for the server
SERVER_FILES := $(wildcard *.eliomi *.eliom *.ml)
...OCamlfind packages for the server
SERVER_PACKAGES := pgocaml pgocaml.syntax
The error occurs during the generation of dependencies:
$ make byte Makefile:216: .depend: No such file or directory eliomdep -server
-package pgocaml \ -package pgocaml.syntax -package core database.ml >
_deps/database.ml.server Camlp4: Uncaught exception: DynLoader.Error
("/home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma",
"error while linking
/home/mjf/.opam/4.01.0/lib/pgocaml/pa_pgsql.cma.\nReference \ to undefined
global `Batteries'")However, upgrading to the development version of Ocsigen (at the time of
writing) appears to fix it:$ opam repository add opamocsigen http://ocsigen.org/opam $ opam update ... $ opam upgrade ... $ make clean $ rm -f .depends $ rm -f _deps/* $ make $ Makefile:216: .depend: No such file or directory eliomdep -server -package pgocaml -package pgocaml.syntax -package core
\ mti_admin.eliom > _deps/mti_admin.eliom.server
eliomdep -server -package pgocaml -package pgocaml.syntax -package core
\ database.ml > _deps/database.ml.server
...
Reply to this email directly or view it on GitHub:
#20 (comment)
from eliom.
closing because eliom 4 has been released
from eliom.
I'm usually using server only .ml files for database interaction and I don't see this problem (using the default makefile). Using pgocaml's syntax in .eliom files may cause problems with the syntax extension indeed. But your error message seems to speak about a missing dependency on batteries in pgocaml's meta ...
If you find a fix or a workaround we would be happy to integrate it.
Hi, I use .ml fiel for database interaction but cannot compile due to syntax error. could you give me some details about how you compile it and identify the syntax? i will really really appreciate your help..thank you in advance this problem really give me headache
from eliom.
We strongly recommend to use PPX syntax for PGOCaml.
Some examples can be found in Ocsigen Start's template.
For example:
https://github.com/ocsigen/ocsigen-start/blob/master/template.distillery/demo_pgocaml_db.ml
from eliom.
Related Issues (20)
- [Eliom] Remove useless PPX extensions `let%cw_rpc` etc
- [Eliom] Fix syntax extension (optional parameter not working) HOT 3
- [Eliom] Is it possible to use `let%rpc` if the function is used only from client section?
- Replace server_function everywhere (OS template, Eliom manual, tutorials)
- Release new versions
- Remove connected wrappers from BS
- compile with lwt.dev: Fatal error: exception complex open are not supported before OCaml 4.08 HOT 2
- Usage of attached POST action HOT 4
- eliomdep doesn't seem to understand `-map` option HOT 1
- Typing error on Eliom >= 8.9.0 HOT 2
- Unbound constructor HOT 8
- Firefox rejecting cookies over SameSite attribute?
- opam and eliom -> [eliom: make]Killed HOT 1
- Use ocamlformat
- test
- Failure to build with dune cache enabled HOT 1
- Error when running ocsigenserver: The module `B' is not yet initialized HOT 4
- Problem with browser navigation HOT 4
- OCaml 5.2 support HOT 5
- What is the license of eliom-distillery templates ? HOT 2
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 eliom.