Hello Everyone, I am experiencing errors when trying to compile a project in Java 8. The errors are caused by swing components. The code I am using is the following: import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class Main2 { public Main2(){ JFrame f = new JFrame (); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setSize(100, 100); JPanel p = new JPanel(); JLabel l = new JLabel("Test"); p.add(l); f.add(p); f.setVisible(true); } public static void main(String[] args) { new Main2(); } } The problems are caused by the p.add(l) and the f.add(p). They throw a `The method add(JLabel) is undefined for the type JPanel` and a `The …

Member Avatar
Member Avatar
+0 forum 3

Hi fellow members, I have wrote two abstract classes, with the second inheriting from the first. However, I receive this error when I try to compile: "error C2143: syntax error : missing ',' before '<'." Will somebody help me out? Thanks! template <class DataType> class AbstactArrayClass { friend ostream& operator << (ostream& s, AbstactArrayClass<DataType>& ac); public: virtual int size() const = NULL; virtual DataType& operator[] (int k) = NULL; }; template <class DataType> ostream& operator << (ostream& s, AbstactArrayClass<DataType>& ac) { s << "["; for (int i = 0; i < ac.size(); i++) { if (i > 0) { s …

Member Avatar
Member Avatar
+0 forum 1

I am making a erp using WPF-C# and i have a confustion on how can i connect my app to sql server after compiling. I am asking this because my app connects to DB when i compile it with Visual Studio and SQL server is already installed on my pc, So my erp app works fine on my pc but the issue is that when i run the app on another computer, App runs but DB connection failed. I installed SQL server to another computer but not working. So i make a form which ask DB connection parameters at the …

Member Avatar
Member Avatar
+0 forum 6

My Name is Leonard E. Norwood Jr. I'm Undergraduate student from Norfolk State University in Norfolk Virginia. Getting down to the point, my program is supposed to print out a list of pre-set numbers in reversal. I used pointers for this, however, something went wrong so I'm trying my best to trace this program and assume that there is something wrong with one of the for loops that is causing something to happen. This program can compile but nothing is happening, I just need some slight assitance. #include <stdio.h> { int i, j; float ar[5] = {12.75, 18.34, 9.85, 23.78, …

Member Avatar
Member Avatar
+0 forum 6

Well this is quite a large program so there is a lot of information to sort through, but when I compile it now it comes up with this: /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp: In member function ‘virtual int dbase::todo()’: /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:393: error: invalid conversion from ‘const char*’ to ‘int’ /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:394: error: invalid conversion from ‘const char*’ to ‘int’ /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:420: error: a function-definition is not allowed here before ‘{’ token /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `}' at end of input /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `while' at end of input /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected `(' at end of input /Users/Adam/Adam's Work/Programming/C++/Code/OS2.cpp:4034: error: expected primary-expression …

Member Avatar
Member Avatar
+1 forum 12

Line 49 is giving me a C2679 error and I'm not sure how to fix it. Help? #include <iostream> #include <fstream> using std::cout; using std::cin; using std::ifstream; using std::ofstream; const int MAX_SSN = 12; const int MAX_WAGE = 6; const int MAX_HOURS = 3; const char STATUS = 1; int ReadData ( int ssn[] [MAX_SSN], int wage[] [MAX_WAGE], int hours[] [MAX_HOURS], char status[] [STATUS] ); int main () { int ssn[11][MAX_SSN]; int wage[11][MAX_WAGE]; int hours[11][MAX_HOURS]; char status[11][STATUS]; return 0; } int ReadData ( int ssn[] [MAX_SSN], int wage[] [MAX_WAGE], int hours[] [MAX_HOURS], char status[] [STATUS] ) { int num_records = …

Member Avatar
Member Avatar
+0 forum 1

Hello, i try to compile ctorrent, it starts but l have this message "error c++ compiler cannot create executables". I dont know how to do? i re-install g++(gcc), i dont know where is the problem please help me ant thanks a lot!!!

Member Avatar
Member Avatar
+0 forum 1

Hi I have windwos source code(first.c) how can I compile it and creating executable file under linux? I run kali linux. I appreciate your help

Member Avatar
Member Avatar
+0 forum 11

i have some problem about link the library to executable. i tried to statically linking but when i create the .a file i always failed, what i want to know is there any way for the exe look up into current directory instead of the system if i has all the depedency. Hope someone has some experience on it, thanks for the attention

Member Avatar
Member Avatar
+0 forum 2

Hello! So recently I have written a lexer/tokenizer and am working on a parser for a language with a friend. At this point everything is going great but I'm beginning to think about how I want to do code generation. Are there languages or systems that generate for example C code, compiles it then executes? If I were to do this how should I set this up? What are other ways code generation is done? Right now I'm thinking about generated C or maybe even D code and compiling. Any ideas or other methods? Thanks!

Member Avatar
Member Avatar
+0 forum 9

I have been looking at the code below and it is driving me nuts. Can anyone explain the error and resolution? When I compile to code below I receive the following compilation error: cannot find symbol symbol : class User location: class com.atlassian.jira.rpc.soap.beans.RemoteUser package com.atlassian.jira.rpc.soap.beans; import com.atlassian.jira.user.util.UserManager; import com.atlassian.jira.user.util.UserUtil; public class RemoteUser extends RemoteEntity { String fullname; String email; public RemoteUser() { //do nothing } public RemoteUser(User user) { this.name = user.getName(); this.fullname = user.getFullName(); this.email = user.getEmail(); } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getFullname() { return …

Member Avatar
Member Avatar
+0 forum 1

hey everybody im new to java i have a book and im learning the language from it but i want to know a compiler where i can run the programs i have "IDEA" but it is really confusing can anybidy help me please???

Member Avatar
Member Avatar
+0 forum 6

I need to modify an object in a QVector. I'm the `[]` operator to point to the object, which is overloaded with a constant and a non-constant version. The problem I'm having is that I don't know how to specify the non-const version, so I get compile errors telling me that it couldn't convert a constant to a non-constant object.

Member Avatar
Member Avatar
+0 forum 2

Hi, started programming 2 days ago, and i'm having a problem with Java saying one of my variables isn't initialised. Couls someone help please?! Thanks, code below: public static void adding() { int n = getN(); int total; for (int i=1; i<=n; i++) { total = i + 1; } System.out.println(total); } public static int getN() { String input = JOptionPane.showInputDialog(null, "How many numbers would you like to add up?"); int n = Integer.parseInt(input); return n; } and the error code: adding.java:22: error: variable total might not have been initialized System.out.println(total); ^ 1 error I'm trying to create a program …

Member Avatar
Member Avatar
+0 forum 1

Im using a Mac, lwjgl, and Java 7 (Execution enviroment: 6). Hey Im trying to build my project and It gives me a message that says: A fatal error has been detected by the Java Runtime Environment, It works fine when I run it in eclipse, and the execution enviroment is set to 1.6, I dont know how to make the jar file compatible with Java 7. How can I build it so it works?

Member Avatar
Member Avatar
+0 forum 1

Can mobile phones run c++ compilers such as borland and turbo? If yes pls do tell where i can download them thanks

Member Avatar
Member Avatar
+0 forum 4

hi. i have a html form that allows user to browse and upload the code using the upload button ( which runs php). the files gets uploaded. now i need to either change that existing php file or add a new button in html file and compile and run the code that was uploaded and display its result. the project is to develop online app. that can take the c++ code of students and upload it and allow uploded code to compile and run. <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br />"; } else …

Member Avatar
Member Avatar
+0 forum 2

Alright, so I need some more help. This time, the problem is not inherently in the code (Though I've had trouble with that thus far too). I am currently playing around with open and close file dialogs trying to get what seems to be an out-dated "GetOpenFileName()" function to work. and this lead me down the path of what is this IFileOpenDialog this and that and other things... EVENTUALLY, I found the suggestion to use the Open Watcom compiler instead of the GCC compiler. I followed the code::blocks instructons to plug the Watcom compiler in and now I am getting …

Member Avatar
Member Avatar
+0 forum 12

public class Calculate { Calculate() { int x,y,sum, multiply,devide; x=12; y=5; sum=x+y; multiply=x*y; devide=x/y; } public static void main(String[] args) { System.out.println("the sum of two numbers:" + sum); System.out.println("the multiple of two numbers:" + multiply); System.out.println("the devition of two numbers:" + divide); } }

Member Avatar
Member Avatar
+0 forum 8

So Ive googled this error but I cant find an explanation of why this is happening in my code.. Error: g++ -o code code.cpp code.cpp:8:17: error: too many decimal points in number code.cpp:8:43: error: too many decimal points in number code.cpp:1:1: error: expected unqualified-id before '<' token make: *** [code] Error 1 My code: //Includes #include <stdlib.h> using namespace std; //Other Functions //Main function void signalEnd(); int main(int argc, char** argv) { //main code here signalEnd(); } void signalEnd() { system("./done.sh"); } I know usually you declare a function above the main to use it but in my current way …

Member Avatar
Member Avatar
+0 forum 1

I've been trying to get this to build for hours, I have no idea what's wrong. Any help is appreciated, thank you. Here's the code: main.cpp #include "SDL/SDL.h" #include "Core.h" #include "GameStates.h" #include "globals.h" int main(int argc, char** args) { if(core.Initilization(640, 480, 32, SDL_SWSURFACE) == -1) { SDL_Quit(); } while(core.desiredstate != core.quit) { ::currentstate->EventHandling(); ::currentstate->Logic(); core.ChangeState(); ::currentstate->Render(); ::currentstate->Update(); } SDL_FreeSurface(core.screen); SDL_Quit(); } Core.h: #ifndef CORE_H #define CORE_H #include "SDL/SDL.h" #include <string> class Core { public: SDL_Surface* Load(std::string filename); SDL_Surface* screen; bool Initilization(int SCREEN_WIDTH, int SCREEN_HEIGHT, int SCREEN_BPP, int FLAGS); void ApplySurface(int x, int y, SDL_Surface* source, SDL_Surface* destination); void SetState(int …

Member Avatar
Member Avatar
+0 forum 3

I put together a vb.net program that does some string parsing and creates a fixed-width file at the end. When I run it on each of my 2 machines it creates a properly formatted file. When my client downloads the msi file, installs it, and runs it, he gets several extra spaces on each record of the file, and the number of spaces is inconsistent from record to record. Here is the code, although it runs fine on my side, so I am thinking it must have something to do with the compiler maybe??? The spaces are added to the …

Member Avatar
Member Avatar
+0 forum 5

Hello guys, I need to develop my own peap protocol. I've found some source code to inspect, but i dont know how to compile it. In Linux? In Visual Studio C? Please help me. I'm getting so pressed :s Here is the source codes : client : http://www.codeforge.com/article/116327 server : http://www.codeforge.com/article/116325 Thank you ;

Member Avatar
Member Avatar
+0 forum 3

Hi Its been about a year since I've been on this site, Back when I use to use XP for my operating system and Dev-C++ for my compiler. But Now I have WIndows 8 and I tried downloading Dev-C++ but I kept getting this message. "g++.exe has stopped working." So I downloaded Microsoft Visual C++ 2010 and I don't know how to compile. When I build I get this message 1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------ 1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup 1>c:~\visual studio 2010\Projects\HelloWorld\Debug\HelloWorld.exe : fatal error LNK1120: 1 unresolved externals ========== Build: 0 …

Member Avatar
Member Avatar
+0 forum 12

I would like to know how to compile the jBullet demos, found here: http://jbullet.advel.cz/download/jbullet-20101010.zip in the eclipse IDE. It seems like it should be a fairly easy but i may be missing some small simple task. If you do know the answer, please be fairly direct and detailed. Thanks!

Member Avatar
+0 forum 0

Hey guys, I recently had an assignment to write a sort algorithm we have not yet gone over in class. I had no problem getting my code written and to compile, but now that it compiles I keep getting an error that says "Exception in thread "main" java.lang.NoSuchMethodError: main" I figured their is an issue with my main section of code but I cannot figure it out, if anyone could help, thanks in advance. public class shell { public shell(int[] anArray) { a = anArray; } public void sort() { int increment = a.length / 3 + 1; while ( …

Member Avatar
Member Avatar
+0 forum 2

Hi all. I'm using DragonFireSDK to make an iPhone app, which means that I can't use any external libraries other than the SDK one. I am trying to get an integer variable for score to a function which will display text on the screen. However, that function takes a char* variable. Here is my code (I've marked the lines that I think matter to the error): [CODE]//=============================================== // Example.cpp //=============================================== #include "DragonFireSDK.h" #include <math.h> #include <cstdio> //=============================================== int BackgroundImage; int BackgroundView; int CircleImage; int CircleView; int ShieldImage; int ShieldView; int Blob1Image; int Blob2Image; int Blob3Image; int BlobViews [10]; int LeftArrowImage; …

Member Avatar
Member Avatar
+0 forum 7

I use Visual Studio 2010 Ultimate. After fixing one of my problems, I ran into another. I have 2 files in my project named, let's say, A and B. The problem is when I try to run the code from B, VS outputs code from A. Any ideas on how to fix this? Help!

Member Avatar
Member Avatar
+0 forum 18

I am having trouble compiling an exe. I tried both py2exe and cxfreeze with similar results, I made an exe but it didn't work. I figured out that I needed to send the image files and sounds with it (should have thought of that to begin with). Now that I added the code for that I get a syntax error: >c:\python26\python.exe setup.py py2exe SyntaxError: data_files=("images\menu_items", ^ Here is a copy of the code from my setup file. [CODE] from distutils.core import setup import glob import py2exe setup(console=["TargetPracticeV11.pyw", data_files=("images\menu_items", [glob.glob("images\menu_items\\*.gif"), glob.glob("images\menu_items\\*.png"), glob.glob("images\menu_items\\*.jpg")]), ("images\menu_items\\buttons", [glob.glob("images\menu_items\\buttons\\*.gif"), glob.glob("images\menu_items\\buttons\\*.png")]), ("images\\level_objects", [glob.glob("images\level_objects\\*.gif"), glob.glob("images\level_objects\\*.png")]), ("sounds", [glob.glob("sounds\\*.wav"), glob.glob("sounds\\*.mid"), …

Member Avatar
Member Avatar
+0 forum 2

You can use and assemble with MASM611 very easily in Notepad++. Ihave find a very nice customization of Notepad++ on a blog. You can find it at [URL="http://easymasm.blogspot.com/"]http://easymasm.blogspot.com/[/URL]

Member Avatar
Member Avatar
+0 forum 2

The End.