Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Titan » Compiler error(No visibility of module while compiling)
Compiler error [message #1761135] Sun, 07 May 2017 22:33 Go to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
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 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
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:

mkdir bin
cd bin


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 Go to previous messageGo to next message
roland gecse is currently offline roland gecseFriend
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 #1761306 is a reply to message #1761135] Tue, 09 May 2017 15:10 Go to previous messageGo to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 21
Registered: April 2017
Junior Member
hello Elemer Lelik,
I didn't create the makefiles in the directories because the makefile you generate only once. I thought the compiling of the ttcn file should be done before the Makefile Generation. Because the Makefile contains references to all the ttcn modules and .cc and .hh files. Am i wrong?
Should i generate the makefiles and then compile?

With Regards,
Avdoot


Re: Compiler error [message #1761317 is a reply to message #1761306] Tue, 09 May 2017 16:08 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
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 #1761387 is a reply to message #1761317] Wed, 10 May 2017 13:00 Go to previous messageGo to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 21
Registered: April 2017
Junior Member
Hi Elemer Lelik,
Thanks for your input.Now, I got to know a lot about the workflow of TItan. Before generating the makefile i need to generate the source and header files which i am not able to generate because of import statement. So where can i get to know more information about which ttcn files to generate, etc,
Re: Compiler error [message #1761392 is a reply to message #1761387] Wed, 10 May 2017 13:34 Go to previous messageGo to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 21
Registered: April 2017
Junior Member
Hi Elemer Lelik,
The problem is solved. It was my mistake. But, i learned a lot from it. Thanks for your input

With Regards,
Avdoot Chalke
Re: Compiler error [message #1761394 is a reply to message #1761392] Wed, 10 May 2017 13:36 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
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 #1761407 is a reply to message #1761394] Wed, 10 May 2017 16:12 Go to previous messageGo to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 21
Registered: April 2017
Junior Member
hi Elemer Lelik,
After running make i got the following error.
Can you tell me the reason or source of following error?

g++ -c -DLINUX -I/home/avdoot/titan.core/Install/include -Wall -o IPL4asp_PT.o IPL4asp_PT.cc
In file included from IPL4asp_PT.cc:10:0:
IPL4asp_PT.hh:43:27: error: 'IPL4asp__Types' does not name a type
void outgoing_send(const IPL4asp__Types::ASP__SendTo& send_par);

^
IPL4asp_PT.hh:43:54: error: expected unqualified-id before '&' token
void outgoing_send(const IPL4asp__Types::ASP__SendTo& send_par);

^
IPL4asp_PT.hh:43:54: error: expected ')' before '&' token
IPL4asp_PT.hh:43:43: error: expected ';' at end of member declaration
void outgoing_send(const IPL4asp__Types::ASP__SendTo& send_par);
^
IPL4asp_PT.hh:43:56: error: ISO C++ forbids declaration of 'send_par' with no type [-fpermissive]
void outgoing_send(const IPL4asp__Types::ASP__SendTo& send_par);
^
IPL4asp_PT.hh:43:56: error: expected ';' at end of member declaration
IPL4asp_PT.hh:43:64: error: expected unqualified-id before ')' token
void outgoing_send(const IPL4asp__Types::ASP__SendTo& send_par);
^
IPL4asp_PT.hh:44:27: error: 'IPL4asp__Types' does not name a type
void outgoing_send(const IPL4asp__Types::ASP__Send& send_par);
^
IPL4asp_PT.hh:44:52: error: expected unqualified-id before '&' token
void outgoing_send(const IPL4asp__Types::ASP__Send& send_par);
^
IPL4asp_PT.hh:44:52: error: expected ')' before '&' token
IPL4asp_PT.hh:44:43: error: expected ';' at end of member declaration
void outgoing_send(const IPL4asp__Types::ASP__Send& send_par);
^
IPL4asp_PT.hh:44:7: error: 'void IPL4asp__PortTypes::IPL4asp__PT_PROVIDER::outgoing_send(...)' cannot be overloaded
void outgoing_send(const IPL4asp__Types::ASP__Send& send_par);
^
IPL4asp_PT.hh:43:7: error: with 'void IPL4asp__PortTypes::IPL4asp__PT_PROVIDER::outgoing_send(...)'
void outgoing_send(const IPL4asp__Types::ASP__SendTo& send_par);
^
IPL4asp_PT.hh:44:54: error: ISO C++ forbids declaration of 'send_par' with no type [-fpermissive]
void outgoing_send(const IPL4asp__Types::ASP__Send& send_par);
^
IPL4asp_PT.hh:44:54: error: expected ';' at end of member declaration
IPL4asp_PT.hh:44:54: error: redeclaration of 'int& IPL4asp__PortTypes::IPL4asp__PT_PROVIDER::send_par'
IPL4asp_PT.hh:43:56: note: previous declaration 'int& IPL4asp__PortTypes::IPL4asp__PT_PROVIDER::send_par'
void outgoing_send(const IPL4asp__Types::ASP__SendTo& send_par);

I assumed it might be because of dependency and i tried by running the command makedepend but it gave me an error.
Where I am going wrong?
Re: Compiler error [message #1761408 is a reply to message #1761407] Wed, 10 May 2017 16:15 Go to previous messageGo to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 21
Registered: April 2017
Junior Member
Hi Roland Gecse,
I also tried doing your way. But , it gave me the same error and I dont know where I am wrong?

With Regards,
Avdoot Chalke
Re: Compiler error [message #1761409 is a reply to message #1761408] Wed, 10 May 2017 16:25 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
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 #1761410 is a reply to message #1761409] Wed, 10 May 2017 16:50 Go to previous messageGo to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 21
Registered: April 2017
Junior Member
Hi Elemer Lelik,
Below you will find the zip file.

Thank You in Advance!

With Regards.
Avdoot Chalke
  • Attachment: Example.zip
    (Size: 334.58KB, Downloaded 112 times)
Re: Compiler error [message #1761449 is a reply to message #1761410] Thu, 11 May 2017 09:09 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
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 #1761464 is a reply to message #1761449] Thu, 11 May 2017 11:15 Go to previous messageGo to next message
Avdoot Chalke is currently offline Avdoot ChalkeFriend
Messages: 21
Registered: April 2017
Junior Member
Hi Elemer Lelik,
I actually wanted to build a project with CoAP protocol and IPL4asp ports. So, I started from scratch. And regarding the c/c++ files, with my little knowledge about ttcn3, i assumed that the compiler will generate all the source and header files. Am i wrong with my assumptions?

Thank You for your input! i really learned a lot from it.

With Regards,
Avdoot Chalke
Re: Compiler error [message #1761468 is a reply to message #1761464] Thu, 11 May 2017 12:04 Go to previous messageGo to next message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
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 Go to previous message
Elemer Lelik is currently offline Elemer LelikFriend
Messages: 1120
Registered: January 2015
Senior Member
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







Previous Topic:Help Needed on Winpcap using TITAN
Next Topic:Using Titan as a fuzzing engine part 3
Goto Forum:
  


Current Time: Sat Apr 20 01:50:36 GMT 2024

Powered by FUDForum. Page generated in 0.05351 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top