Compiler error [message #1761135] |
Sun, 07 May 2017 22:33 |
Avdoot Chalke Messages: 21 Registered: April 2017 |
Junior Member |
|
|
Hello guys... I am totally new to TTCN3. I have a problem related TTCN3. I have a project with different folders containing TTCN3 files and the ttcn modules have the import statement to access its variables from different directory. But while compiling through command line it gives me an error stating that there is no module with the identifier __.ttcn . Can anyone guide me where i am going wrong?
[Updated on: Tue, 09 May 2017 14:27] Report message to a moderator
|
|
|
Re: Compiler error [message #1761175 is a reply to message #1761135] |
Mon, 08 May 2017 15:01 |
|
Hi Avdoot,
Welcome to TTCN-3 and Titan.
the compiler has to see all .ttcn (and .asn, .cc, .hh -if any), files to be able to compile. simplest way to solve this is to create a shell script that will
symlink all used files:
create a directory say bin (as in for binaries) which will be used to compile:
create and save a file say createlink.sh
with the following content:
#!/bin/sh
ln -s /path/to/the/first/file/file1.ttcn .
ln -s /path/to/the/second/file/file2.ttcn .
ln -s /path/to/the/third/file/file3.cc
:
:
chmod + x createlinks.sh
./createlinks.sh
this will symlink all used files into the bin directory
now you can run make (assuming you already have a generated Makefile)
I hope this helps
Best regards
Elemer
|
|
|
Re: Compiler error [message #1761214 is a reply to message #1761135] |
Tue, 09 May 2017 05:43 |
roland gecse Messages: 20 Registered: December 2015 |
Junior Member |
|
|
You can use ttcn3_makefilegen to skip generating symlinks.
For example, assuming the following directory structure with 3 modules, where m imports contents of both m1 and m2:
./m.ttcn
./d1/m1.ttcn
./d2/m2.ttcn
Say you would like to build in ./tmp then cd to ./tmp and run the makefile generator with:
ttcn3_makefilegen -s ../m.ttcn ../d1/m1.ttcn ../d2/m2.ttcn
You can build in ./tmp by running make!
I also recommend to study the TITAN User Guide s3.2 for a better understanding of TITAN build mechanism!
[Updated on: Tue, 09 May 2017 08:10] Report message to a moderator
|
|
|
|
Re: Compiler error [message #1761317 is a reply to message #1761306] |
Tue, 09 May 2017 16:08 |
|
Hi Avdoot,
after you have created the symlink as above , you have to generate the Makefile with:
makefilegen -f *.ttcn *.cc *.hh
or
makefilegen -f file1.ttcn...filen.ttcn file1.cc...filen.cc file1.hh..filen.hh
(makefilegen followed by the list of files you want to compile; -f will cause any previous files to be overwritten)
This will generate a Makefile in the bin directory
only after this you can start compilation with make.
Distributed Makefile is a bit more complicated , let's avoid that for the moment.
You need one central Makefile, in a directory where all files needed are either present or symlinked.
I suggest you look at the earlier posts where we published example projects with the description of the workflow.
Best regards
Elemer
|
|
|
|
|
Re: Compiler error [message #1761394 is a reply to message #1761392] |
Wed, 10 May 2017 13:36 |
|
Hi Avdoot,
great ;
both the language and the tool have their learning curve, but past that you'll find out that is enormously efficient in network stuff.
Best regards
Elemer
|
|
|
|
|
Re: Compiler error [message #1761409 is a reply to message #1761408] |
Wed, 10 May 2017 16:25 |
|
Hi Avdoot,
can you please pack your source files/directories, including your Makefile, scripts etc. into a compressed file and upload it here so we can take a look?
BR
Elemer
|
|
|
|
Re: Compiler error [message #1761449 is a reply to message #1761410] |
Thu, 11 May 2017 09:09 |
|
Hi Avdoot,
please find attached a compressed archive with your corrected project.
The biggest problem was that you have started from one of the published projects and arbitrarily removed files, especially C/C++ files.
Both test ports and protocol modules may consist of several files, that can contain TTCN-3 or C/C++ source code. For test ports , these constitute the test port body itself; for protocol modules, these might contain the encoding/decoding functions.
After unpacking the file, please do
cd ~/bin
../src/createlink.sh
make
The files should compile and create an executable named CoAP.
This can be run with
ttcn3_start ./CoAP coap.cfg
Mind you I have not checked whether it executes correctly.
Please also check the small changes I have made ; they are a prerequisite to successful compilation.
Also, please download the CoAP conformance test in github/titan.misc and compile/execute it for reference.
Best regards
Elemer
-
Attachment: CoAP.tgz
(Size: 680.01KB, Downloaded 124 times)
[Updated on: Thu, 11 May 2017 10:41] Report message to a moderator
|
|
|
|
Re: Compiler error [message #1761468 is a reply to message #1761464] |
Thu, 11 May 2017 12:04 |
|
Hi Avdoot,
the compiler will generate source/header files from TTCN-3 and ASN.1 files, but there are some C/C++ files that have be added separately: some codecs, test ports, external functions etc.
Best regards
Elemer
|
|
|
Re: Compiler error [message #1761469 is a reply to message #1761464] |
Thu, 11 May 2017 12:04 |
|
Hi Avdoot,
the compiler will generate source/header files from TTCN-3 and ASN.1 files, but there are some C/C++ files that have be added separately: some codecs, test ports, external functions etc.
Best regards
Elemer
|
|
|
Powered by
FUDForum. Page generated in 0.05351 seconds