Compile occi under solaris using g++/gcc problem
Hi Expert:
I got some link error when i tried to compile a demo occi code under solaris using g++. Please share experience.
Thanks.
Namespaces are not supported in -compat=4 mode. The only effect of -features=namespace is to recognize "namespace" as a keyword, and disallow it as an identifier. You don't actually get namespace semantics.
The pupose of -compat=4 is to allow code written for C++ 4.x to compile and run until the code can be updated to conform to the C++ Standard. If you want to use features from the C++ standard, like namespaces, you must use Sun C++ in the default standard mode.
If you remove -compat=4, the code compiles and links. If you need to use -compat=4 mode, remove uses of namespace, and fix the code to remove name conflicts.
BTW, we recommend against using -features=bool in -compat=4 mode. It can cause odd behavior when part of the code expects boolean expressions to have type int and part of the code expects bool to be a different type.
It appears you are using C++ 5.0, a product that has been obsolete for several years and which is no longer supported. You should consider updating to Sun Studio 11 (C++ 5.8), at no cost.
http://developers.sun.com/sunstudio/
Similar Messages
-
Hi,
I'm trying to compile the current svn release of mono (free implementation of .NET framework) under Solaris 10/x86.
After fixing some GCC specific code, I'm currently stuck with the GCC internal function __builtin_frame_address (and __builtin_return_address).
These functions return information about the current stack trace, e.g. the function that invokes the current function. They are used in the integrated debugger for single stepping and other functionality.
So far I haven't been able to find a workaround for these function within the Studio Compiler.
What's is the best way to implement these function? Does the Studio Compiler (or the libc or some other library) already provide the necessary functionality?
With best regards,
Burkhard LinkeI'm afraid you have to write assembly code for that sort of functions
-
How do I control DAQ boards under Linux using C (gcc)?
I need to control multifunction DAQ boards using C (gcc) under Linux/x86. What drivers/packages do I need to use?
Hi NEB,
You will need to download DAQmxBase 1.3.1 found here:
http://digital.ni.com/softlib.nsf/websearch/47D4C7DDD7C777C886256F230070A606?opendocument&node=132060_US
The readme file contains information about what kernels it has been tested on.
Thanks,
Sal -
Creating simple shared library using gcc under Solaris 10
Hi All:
I apologize if this is too newbie a question but have seen nothing that works for me yet.
I'm trying to create a shared library that contains a single object file using gcc (as installed on Solaris 10). I compiled the source code as follows:
gcc -c -fPIC x.cpp -o x.o
and got the x.o object file created and readable.
I then tried (from sample code on line):
gcc -shared -Wl,-soname,libMyLib.so.1 -o libMyLib.so.1.0.1 x.o
and get the following errors:
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file libMyLib.so.1: open failed: No such file or directory
ld: fatal: File processing errors. No output written to x.o
collect2: ld returned 1 exit status-soname is a GNU ld option. Use -h instead.
NB:
- you should use g++ not gcc to compile C++ code
- this forum is about the Oracle C++ compiler, not gcc. With it, you would do:
CC -c -KPIC x.cpp
CC -G -h libMyLib.so.1 -o libMyLib.so.1.0.1 x.o -
Again - compilation under solaris - help!
Hi all
I'm trying to compile the following test code:
#include <occi.h>
#include <iostream>
using namespace std;
using namespace oracle::occi;
int main(int argc, char ** argv)
Environment *env;
Connection * conn;
try{
env = Environment::createEnvironment();
conn = env->createConnection(user, pass, sid);
env->terminateConnection(conn);
Environment::terminateEnvironment(env);
} catch (SQLException &e) {
cout<<"Exception: %s\n", e.getNLSMessage(env).c_str();
return 0;
My system is Solaris 9 sparc 64-bit
Oracle Database 10.1.0.2
I run this command:
CC -I/u00/oracle/product/10.1.0/db_1/rdbms/public -L/u00/oracle/product/10.1.0/db_1/lib -locci10 test.cpp
and get the famous error
Undefined first referenced
symbol in file
void oracle::occi::Environment::terminateEnvironment(oracle::occi::Environment*) test.o
oracle::occi::Environment*oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode,void*,void*(*)(void*,unsigned),void*(*)(void*,void*,unsigned),void(*)(void*,void*)) test.o
oracle::occi::__RTTI__1nGoracleEocciMSQdDLException_ test.o
[Hint: static member oracle::occi::__RTTI__1nGoracleEocciMSQdDLException_ must be defined in the program]
ld: fatal: Symbol referencing errors. No output written to a.out
I've tried to use:
gcc 3.4.2
Sun Forte 6.0
Sun Forte 6.2
Sun Forte 7
Sun Studio 10
all the same
if I set LD_LIBRARY_PATH and try to link with *.so library - it gives me "wrong ELF class: ELFCLASS64"
I've tried to install and use Client 10.2 - no effect
Under Windows it works perfectly.
What should I do to make this thing compile under Solaris?
Message was edited by:
[email protected]
Message was edited by:
[email protected]If you want your application to be 32 bit
- use Sun Forte 6.2 and link with OCCI library under $ORACLE_HOME/lib32
If you want your application to be 64 bit
- use Sun Forte 8 and link with libraries under $ORACLE_HOME/lib
( You should be passing the 64 bit compile flag "-xarch=v9" ) -
Gcc problems on Solaris 10 X86
I'm using Solaris 10 x86 and gcc from /usr/sfw/bin and have come across a couple of problems:
which gcc
/usr/sfw/bin/gcc
gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/specs
Configured with: /builds/sfw10-gate/usr/src/cmd/gcc/gcc-3.4.3/configure prefix=/usr/sfw with-as=/usr/sfw/bin/gas with-gnu-as with-ld=/usr/ccs/bin/ld without-gnu-ld enable-languages=c,c++ --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Problem 1
cat ll.cc
#include <signal.h>
int CS;
gcc -c ll.cc
ll.cc:2: error: expected unqualified-id before numeric constant
ll.cc:2: error: expected `,' or `;' before numeric constant
CS is defined in the file /usr/include/sys/regset.h as:
#define CS 15
I've changed the code to use MYCS instead and this gets around the problem. Does anyone have a more elegant solution to the problem?
Problem 2
In a g++ compilation I have a file that includes cpp_type_traits.h.
The compilation fails with:
/usr/sfw/lib/gcc/i386-pc-solaris2.10/3.4.3/../../../../include/c++/3.4.3/bits/cpp_type_traits.h:69: error: expected unqualified-id before "namespace"
The relevant line in cpp_type_traits.h is:
namespace __gnu_internal
Knowing rather little about g++ I've been Googling for an hour but not found anyone else with the same problem.
Many Thanks
AndyI'm not fully sure what might cause your problems since I'm not a programmer myself. However, I do wonder if the gcc version located in /opt/sfw/bin may do you some good. When all other options fair I'd recommend getting the Studio 11 package and just use the cc compiler provided by Sun themselves. Its free anyway.
-
How compile OCCI Demo of Oracle 9i with gcc on Redhat Linux 9?
How compile OCCI Demo of Oracle 9i with gcc on Redhat Linux 9?
When I use gcc-3.22 compile,error:undefined reference to 'typeinfo for oracle:occi:SQLException'.
Reputedly gcc-2.95 or gcc-2.96 is the official supported version , did you try it?
Can you help me compile it successfully?
Thank you!
Alex ClarkFor details
compile cmd:make -f demo_rdbms.mk occipool
compile result:
make -f /opt/oracle/product/9.2.0/rdbms/demo/demo_rdbms.mk buildocci
EXE=occipoo
l OBJS=occipool.o
make[1]: Entering directory `/opt/oracle/product/9.2.0/rdbms/demo'
/usr/bin/g++ -L/opt/oracle/product/9.2.0/lib/
-L/opt/oracle/product/9.2.0/rdbms/
lib/ -o occipool occipool.o -locci -lclntsh `cat
/opt/oracle/product/9.2.0/lib
/sysliblist` -ldl -lm
occipool.o(.gcc_except_table+0xe8): undefined reference to `typeinfo for
oracle:
:occi::SQLException'
occipool.o(.gnu.linkonce.t._ZN8occipoolC1Ev+0x18): In function
`occipool::occipo
ol[in-charge]()':
: undefined reference to
`oracle::occi::Environment::createEnvironment(oracle::o
cci::Environment::Mode, void*, void* (*)(void*, unsigned), void* (*)(void*,
void
*, unsigned), void (*)(void*, void*))'
occipool.o(.gnu.linkonce.t._ZN8occipoolD1Ev+0xf): In function
`occipool::~occipo
ol [in-charge]()':
: undefined reference to
`oracle::occi::Environment::terminateEnvironment(oracle
::occi::Environment*)'
occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x355): In function
`occipool::
select()':
: undefined reference to
`oracle::occi::SQLException::SQLException[in-charge](or
acle::occi::SQLException const&)'
occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x395): In function
`occipool::
select()':
: undefined reference to `oracle::occi::SQLException::getErrorCode() const'
occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x3db): In function
`occipool::
select()':
: undefined reference to `oracle::occi::SQLException::getMessage() const'
occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x44f): In function
`occipool::
select()':
: undefined reference to `oracle::occi::SQLException::~SQLException
[in-charge]()'
occipool.o(.gnu.linkonce.t._ZN8occipool6selectEv+0x466): In function
`occipool::
select()':
: undefined reference to `oracle::occi::SQLException::~SQLException
[in-charge]()'
collect2: ld returned 1 exit status
make[1]: *** [buildocci] Error 1
make[1]: Leaving directory `/opt/oracle/product/9.2.0/rdbms/demo'
make: *** [occipool] Error 2 -
Problems starting SunMC Agent 3.6 under Solaris 10
Hi folks,
I just did a test installation of the new SunMC 3.6 Server which worked fine. Afterwards, I did a fresh install of the 3.6 agent on a Sun Enterprise 420R running Solaris 10. I installed the agent in the global zone.
At the end of the setup, when the system asks me if I want to start the agent, which I affirmed. But this didn't work, system says just laconically "Could not start agent". Unfortunately, I can't even find the logs, since there is no log subdirectory under /var/opt/SUNWsymon. Have they moved this under Solaris 10?
Any ideas somebody how to dig into this?
Regards,
PeterHi Mike,
This sounds a lot like a post just a few days ago:
http://forum.sun.com/thread.jspa?threadID=27785&tstart=0Well, yes and no...I read this thread and I found some similarities but it's not the same problem. Besides, this was Solaris 8, I've 10 and my guess is that it has something to do with Sol10.
What do you see when you start the Agent with this command:
/opt/SUNWsymon/sbin/es-start -aiNo error...I end up in a prompt:
bash-3.00# /opt/SUNWsymon/sbin/es-start -ai
info Dec 05 17:48:19 agent Sun Management Center Version: 3.6, Build: 18, H491, (c) 2003 Sun Microsystems, Inc.
info Dec 05 17:48:19 agent registering import actions
info Dec 05 17:48:19 agent loading standard services
info Dec 05 17:48:19 agent standard services load complete
info Dec 05 17:48:19 agent agent host and port: cngaer:1161
info Dec 05 17:48:19 agent trap handler destination host and port: SunMC_server:162
info Dec 05 17:48:19 agent event trap destination host and port: SunMC_server:163
agent:>
I've really no idea what to enter at this prompt. A simple "help" doesn't give me anything but I got something from "ls"
agent:> ls
classes templates _config config services iso shadow contexts rules -
Using Solaris 8 drivers under Solaris 10?
I have a Mylex AcceleRAID 352 SCSI RAID controller card I would like to use under Solaris 10/11. It has drivers for Solaris 8 and is reported to work unofficially under Solaris 9.
What are the chances this will function reliably under Solaris 10/11? Has the driver format changed appreciably? Can anyone comment on using older drivers in newer versions of Solaris?
Many thanks for any advice, comments, or tips.
Regards,
Andrew<i>should I try the big monitor with the 13w3 connector</i>
Yes, this is the primary output.
Attach the monitor to the 13W3 output and change the <b>output-device</b> to the integrated video.
Michael -
NIC install problem under Solaris 10
I have an old 3Com NIC card (ISA) under Solaris 10. 3C509B Etherlink III card and prtconf -pv command shows correct PNP80f7 device id, all correct
resources, IRQ, I/O address .... But fail to work. Is it sun does not support elx driver or something I misconfigured?
My installation as follows:
elx "PNP80F7" entry to /etc/driver_aliases
PNP80F7|TCM5094.... elx net isa elx.bef "3Com"
entry to /boot/solaris/devicedb/master
#devlinks
#touch reconfigure ; rebootI use these cards for my x86 installations as well. The one thing that I've had to do is force the speed and duplex using the 3Com driver diskettes before installing the operating system. For whatever reason, Solaris 10 finds the card but will not initialize it properly whenever I the card is programmed to auto-negotiate. Forcing the card to half-duplex on the card itself works almost all of the time for me.
Get the driver diskettes from 3Com's site, boot from a bootable floppy, run 3c9x5cfg (if I recall correctly), and change the duplex and speed to whatever is appropriate. I've had the best luck with half-duplex. (If you need a boot diskette, you can get them from http://www.bootdisk.com.) -
Problems compiling KVM under windows
Hi there,
We tried to compile KVM under windows platforms and failed.
Compilation failed at the java files under j2me_cldc\tools\jcc
Therefore we do not have: nativeFunctionTableWin.c and nativeRelocationWin.c
Can you please help us to compile the java files or send us the *.c files.
Thanks
Ronny Sherer.
mailto:[email protected]I had the same trouble and this is what I did to get the KVM to compile.
1. First of all to compile under windows you need a the Visual Basic Compiler and Linker to compile the C files.
Also, in order for the makefiles to work properly, you need to install cygwin with basic command line functions (make,find,pwd...). And you need to place the cygwin commands ahead of the windows commands in your PATH eg set PATH = C:\cygwin;C:\windows.
2. COPY the classes dir in j2me_cldc\bin\common\api
TO the j2me_cldc\api dir
3. Then modify the makefiles - where it has $(JAVAC) imediately after it type -target 1.1
so for example in j2me_cldc\api\makefile the line
$(JAVAC) -g$(DEBUGFLAG) -d tmpclasses -bootclasspath classes \
becomes
$(JAVAC) -g$(DEBUGFLAG) -target 1.1 -d tmpclasses -bootclasspath classes \
NOTE: nowhere did I find anything to suggest that the KVM must be compiled under Java 1.1 but this is what worked for me. -
I am currently doing a project which requires the execution of Solaris applications through the use of Java Servlet with this Runtime method - Runtime.getRuntime.exec()
This means that if the client PC tries to access the servlet in the server PC, an application is supposed to be executed and launched on the server PC itself. Actually, the servlet part is not an issue as the main problem is the executing of applications in different platforms which is a big headache.
When I tried running this program on a Windows 2000 machine, it works perfectly fine. However, when I tried it on a Solaris machine, nothing happens. And I mean nothing... no errors, no nothing. I really don't know what's wrong.
Here's the code.
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
response.setContentType("text/html");
PrintWriter out = response.getWriter();
Process process; Runtime runtime = Runtime.getRuntime();
String com= "sh /opt/home/acrobat/";
String program = request.getParameter("program");
try
process = runtime.exec(com);
catch (Exception e)
out.println(e);
It works under Windows when com = "c:\winnt\system32\notepad.exe"
When under Solaris, I have tried everything possible. For example, the launching of the application acrobat.
com = "/opt/home/acrobat"
com = "sh /opt/home/acrobat"I have also tried reading in the process and then printing it out. It doesn't work either. It only works when excuting commands like 'ls'
BufferedReader read = new BufferedReader(new InputStreamReader(process.getInputStream()));Why is it such a breeze to execute prgrams under Windows while there are so many problems under Solaris.
Can some experts please please PLEASE point out the errors and give me some advice and help to make this program work under Solaris! Please... I really need to do this!!
My email address - [email protected]
I appreciate it.
By the way, I'm coding and compiling in a Windows 2000 machine before ftp'ing the .class file to the Solaris server machine to run.it is possible that you are trying to run a program that is going to display a window on an X server, but you have not specified a display. You specifiy a display by setting the DISPLAY environment variable eg.
setenv DISPLAY 10.0.0.1:0
To check that runtime.exec is working you should try to run a program that does not reqire access to an X Server. Try something like
cmd = "sh -c 'ls -l > ~/testlist.lst'";
alternatively try this
cmd = "sh -c 'export DISPLAY=127.0.0.1:0;xterm '"
you will also need to permit access to the X server using the xhost + command -
Compiling c++ in Solaris 2.6
I am attempting to compile C++ programs with SUN compiler
4.2, under Solaris 2.6 in an Ultra 5 machine.
When I issue the CC command, at the end of the commmand
I append -I/path of STL library/ and I get errors on the STL
functions. It acts as if it doesn't see the STL library.
Does anyone know the proper syntax?Here is ur program. Should compile with
CC -o vec vec.C
I feel all ur problems are only coz u'r new to STL. Please go through some documentation on "How to use STL?"
MSDN has a good tutorial.
#include <iostream.h>
#include <vector> //it's not vector.h
//"using namespace std" is VERY bad coding practice.
//instead use this.
using std::vector;
//preferably should be doing this.
typedef vector<int> VECOFINT;
int main()
VECOFINT v;
int i;
cout << "size = " << v.size() << endl;
for ( i = 0; i < 10; i++)
//u can't do v = i. use push_back();
v.push_back(i);
cout << "\nCurrent vector contents:\n";
//u have to use iterators for getting values
VECOFINT::iterator it = v.begin();
for ( ; it != v.end(); it++ )
cout << (*it) << "\n" << endl;
return 0;
} -
Swedish chars ��� not working under Solaris
Hi All,
I created the following little code and it is not working under Solaris 7, JDK1.4.1_01. (also tested some other but does not work)
public class HelloSweden
public static void main(String [] args)
String newName="���";
String charsetName = "iso-8859-2";
byte [] s = {(byte)229, (byte)228, (byte)246};
try
newName = new String(s, 0, s.length, charsetName);
catch ( java.io.UnsupportedEncodingException e )
System.err.println(e.getMessage());
e.printStackTrace();
System.out.println("new name is: "+newName);
for(int i=0; i<newName.getBytes().length; i++)
System.out.println(i+"."+":"+newName.getBytes());
The problem is that on Solaris 7 the output is:
new name is: ???
0.:63
1.:63
2.:63
Whereas on Linux it works fine:
new name is: ���
0.:-27
1.:-28
2.:-10
I also tried the "javac -encoding iso8859-1" option but no use.
Could anybody help?
Thnx,
GFI also tried the "javac -encoding iso8859-1" option
but no use.
Was the output exactly the same or were the numbers correct, at least?
You may need to compile with:
javac -encoding ISO-8859-1 ClassName.java
and then run with:
java -Dfile.encoding=ISO-8859-1 ClassName
You can set the character encoding explicitely like that. The character encoding depends on locale settings; if you set LC_ALL to a Swedish locale ("sv_SE"?) javac and java should start using the correct encodings automatically. -
Announcing availability of x86 hosted cross compiler for SPARC/Solaris
We are pleased to announce the release for GCC For Sun Systems 4.2.0 cross compilers!
This is a Solaris/x86 hosted compiler with target code generation for
SPARC/Solaris systems. If you develop on your OpenSolaris, or Solaris
x86 laptop or desktop, you can now start compiling your sources for
SPARC systems. Almost all features available in the
native SPARC GCC For Sun Systems 4.2.0 compiler are available
for use in the cross compiler. Please refer to the mini cross compiler howto
page for additional details on install and usage, and gotchas in cross
development environment.
Please continue to provide us your feedback and issues, which helps
us make the product better.
Thanks
GCCFSS teamCan GCCFSS also cross compile from in reverse - from SPARC to x86/x64?
Thank you
Maybe you are looking for
-
I have AirPrint on my Ipad...when I try to print, a box opens and wants username and password. HELP!!
-
I have the Norton Security Suite provided with Comcast subscription (cable network) I have a Dell Inspiron with VISTA, but hopefully that's not a problem, as I've had Firefox on it for 4 years now. Thanks!
-
WLAN showing up as 802.11a/g but not 11n
Using a wifi scanner like Metageek inssider or chanalyser, I'm seeing one of our WLANs as only 802.11a or g but not 802.11n like it should be. All the other SSIDs on that AP/controller are showing as 802.11n. I can't for the life of me think how this
-
While attempting to clean my pc of superfluous software, I inadvertantly deleted files needed by itunes thus necessitating a removal and reinstall of itunes. After downloading the new itunes, the install program fialed and gave the messHow do I solv
-
Error in Blackberry application using Sybase Unwired Platform
Hi Experts, I am developing a mobile application, in which I need to give authorization to all SAP users. For this I had created an RFC enabled Function Module in SAP R/3, which checks the input username and password. If the username and password sat