compilation

Undefined reference to global variable during linking

99封情书 提交于 2020-08-21 08:29:18
问题 I am trying to compile a program which is divided into 3 modules, corresponding to 3 source files: a.c , b.c , and z.c . z.c contains the main() function, which calls functions in a.c and b.c . Furthermore, a function in a.c calls a function in b.c , and viceversa. Finally, there is a global variable count which is used by the three modules and is defined in a separate header file, global.h . The code of the source files is the following: a.c #include "global.h" #include "b.h" #include "a.h"

Recompile with -Xlint : unchecked for details

倾然丶 夕夏残阳落幕 提交于 2020-08-11 05:24:32
问题 Hi guys I have this warning on my code. I try to compile using @SuppressWarnings("unchecked") It compile but at the time of the execution the program can't find the main class. How can I solve this problem? Below the code: import java.util.*; @SuppressWarnings("unchecked") class ProgRub { public static void main(String argv[]) { Hashtable rubrica = new Hashtable(20); String chiave, valore; Menu mioMenu = new Menu(); int scelta; scelta = (int) mioMenu.scelta(); while (scelta != 5) { if (scelta

Recompile with -Xlint : unchecked for details

折月煮酒 提交于 2020-08-11 05:23:47
问题 Hi guys I have this warning on my code. I try to compile using @SuppressWarnings("unchecked") It compile but at the time of the execution the program can't find the main class. How can I solve this problem? Below the code: import java.util.*; @SuppressWarnings("unchecked") class ProgRub { public static void main(String argv[]) { Hashtable rubrica = new Hashtable(20); String chiave, valore; Menu mioMenu = new Menu(); int scelta; scelta = (int) mioMenu.scelta(); while (scelta != 5) { if (scelta

Should I always compile Java code with latest javac compiler?

有些话、适合烂在心里 提交于 2020-08-09 09:43:21
问题 I'm about to upgrade a tomcat installation from version 6.0 to version 8.5, and also upgrading the JVM from 6 to 8. Our java code is compiled with java 6 as for now. I know that running java code on the latest JVM is always a good idea performance-wise (not to mention security-wise). In this way some code compiled with java 1.6 might run faster on JVM 8 compared to JVM 6. But how about compilation? Does one gain anything by compiling code written in java 6 with a java 8 compiler (i.e. only

How can a compiler compile itself?

痴心易碎 提交于 2020-07-31 06:42:21
问题 I am researching CoffeeScript on the website http://coffeescript.org/, and it has the text The CoffeeScript compiler is itself written in CoffeeScript How can a compiler compile itself, or what does this statement mean? 回答1: The first edition of a compiler can't be machine-generated from a programming language specific to it; your confusion is understandable. A later version of the compiler with more language features (with source rewritten in the first version of the new language) could be

Linux randomly deleted my file while compiling what do I do?

烂漫一生 提交于 2020-07-30 07:47:40
问题 gcc -L/root/Desktop - Wall -o prog3.c -pthread -lcopy /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.0: In function '_start': (.text+0x20): undefined reference to 'main' collect2: error: ld returned 1 exit status This is my error code. prog3.c is nowhere to be found, what on earth happened is there any way to get my file back?? The bold is the command I ran and the rest is the resultant console output 回答1: Your problem is here: -o prog3.c . gcc ’s -o option is used to tell

Linux randomly deleted my file while compiling what do I do?

前提是你 提交于 2020-07-30 07:47:06
问题 gcc -L/root/Desktop - Wall -o prog3.c -pthread -lcopy /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/Scrt1.0: In function '_start': (.text+0x20): undefined reference to 'main' collect2: error: ld returned 1 exit status This is my error code. prog3.c is nowhere to be found, what on earth happened is there any way to get my file back?? The bold is the command I ran and the rest is the resultant console output 回答1: Your problem is here: -o prog3.c . gcc ’s -o option is used to tell

IntelliJ downloads Gradle dependencies but cannot find them during compile

核能气质少年 提交于 2020-07-24 03:16:32
问题 IntelliJ downloaded the dependencies listed in my build.gradle file and they show up in the External Library, but IntelliJ fails to find them during compile. It just throws a bunch of "package x does not exist" and "cannot resolve symbol". Under the Project Structure -> Modules -> Dependencies they all show up and are listed as compile. If I try to build it with Gradle it's successful, so it's just IntelliJ. Any ideas? If it's important, I'm using this on a Mac. 回答1: Found the answer.

IntelliJ downloads Gradle dependencies but cannot find them during compile

孤街浪徒 提交于 2020-07-24 03:15:22
问题 IntelliJ downloaded the dependencies listed in my build.gradle file and they show up in the External Library, but IntelliJ fails to find them during compile. It just throws a bunch of "package x does not exist" and "cannot resolve symbol". Under the Project Structure -> Modules -> Dependencies they all show up and are listed as compile. If I try to build it with Gradle it's successful, so it's just IntelliJ. Any ideas? If it's important, I'm using this on a Mac. 回答1: Found the answer.

IntelliJ downloads Gradle dependencies but cannot find them during compile

◇◆丶佛笑我妖孽 提交于 2020-07-24 03:13:49
问题 IntelliJ downloaded the dependencies listed in my build.gradle file and they show up in the External Library, but IntelliJ fails to find them during compile. It just throws a bunch of "package x does not exist" and "cannot resolve symbol". Under the Project Structure -> Modules -> Dependencies they all show up and are listed as compile. If I try to build it with Gradle it's successful, so it's just IntelliJ. Any ideas? If it's important, I'm using this on a Mac. 回答1: Found the answer.